Failed Ajax invalid JSON request - file upload OJS (only in review phase)

Hi all,

I have a recent installation of OJS on my server and have repeated errors whenever I try to upload a file after the initial submission. So, the first time a submission is created, this causes no issues to upload files, but during the review process, or whenever an author wished to update a file, you get the following error message:

failedajax

In my error log I see the following message:
[Tue Jun 08 21:01:57.902825 2021] [core:crit] [pid 20962:tid 46957005420288] (13)Permission denied: [client 87.65.231.169:50963] AH00529: /home/bjpahost/public_html/public/journals/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/home/bjpahost/public_html/public/journals/’ is executable, referer: http://belgjpaediatrics.be/index.php/bjp/workflow/index/56/3

However, I checked the files and directories and they should be readable/executable as needed.

Could anyone help me out?

  • Application Version - OJS 3.3.0.6
  • PHP 7.4.16

Hi Levi,

It’s complaining about a permission on an .htaccess file. But can you post the permissions on

/home/bjpahost/public_html/public/journals/

please? The .htaccess file begins with a period and may not show up/be affected by regular commands.

Cheers,

Thanks for your reply.

I have a .htaccess file in this folder containing this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

The folder itself has 777 permission

Is that file in your public/journals/ folder? If so, it should not be there. What is the permission on the file itself?

Indeed. I have added this because I thought it was necessary to allow for access. Can I ask what you mean by permission on the file itself?

Hi @Levi_Hoste

There’s no requirement to place an .htaccess file inside the public/journals folder. What you’ve shared so far would be a requirement if you had turned on RESTful urls in your config file, but in that case the .htaccess file would sit in your root OJS folder.

By permissions on the file itself, I mean what you see when you run:

ls -l .htaccess

which will show you the permissions on the file itself. The error you’re logging is:

“unable to check htaccess file, ensure it is readable”

Which suggests that the permissions are wrong.

Cheers,
Jason

The permissions of my .htaccess file are now set to 0755. And it is placed only in the root folder (public_html) where my OJS is installed. I have deleted other htaccess files.

What should be written inside the .htaccess?

Are you using RESTful urls? If not you do not need any .htaccess files at all.

Cheers,
Jason

No, I am not indeed. I added an .htaccess because I thought that was the issue. Also before adding one, it gave me the error that the .htaccess file was inaccessible…

@jnugent Could you please take a second look at this? Or anyone who possibly have some insights in this?

Many thanks!

Hi @Levi_Hoste

To be honest, if there’s no .htaccess file at all in the web tree, I’m not sure why you’re seeing that error. In addition to that error, are there any actual PHP “Fatal Errors” in your server log?

Jason

Dear @jnugent, thanks for your swift response!

I have found the error message below (listed in my Google DevTools).
I hope it helps, since I do not find a specific error in my server log.

GET http://belgjpaediatrics.be/index.php/bjp/$$$call$$$/wizard/file-upload/file-upload-wizard/start-wizard?fileStage=6&reviewRoundId=&submissionId=57&stageId=4&uploaderRoles=17-16-4097&_=1624369955740 500 (Internal Server Error)
send @ jquery.min.js?v=3.3.0.6:2
ajax @ jquery.min.js?v=3.3.0.6:2
a.fn.pkpAjaxHtml @ pkp.min.js?v=3.3.0.6:392
a.pkp.controllers.modal.AjaxModalHandler.modalOpen @ pkp.min.js?v=3.3.0.6:290
a.pkp.controllers.modal.ModalHandler @ pkp.min.js?v=3.3.0.6:276
a.pkp.classes.ObjectProxy.parent @ pkp.min.js?v=3.3.0.6:93
a.pkp.controllers.modal.AjaxModalHandler @ pkp.min.js?v=3.3.0.6:289
a.pkp.classes.ObjectProxy.parent @ pkp.min.js?v=3.3.0.6:93
a.pkp.controllers.modal.WizardModalHandler @ pkp.min.js?v=3.3.0.6:290
a.pkp.classes.ObjectProxy.parent @ pkp.min.js?v=3.3.0.6:93
b @ pkp.min.js?v=3.3.0.6:91
a.pkp.classes.Helper.objectFactory @ pkp.min.js?v=3.3.0.6:89
(anonymous) @ pkp.min.js?v=3.3.0.6:392
each @ jquery.min.js?v=3.3.0.6:2
each @ jquery.min.js?v=3.3.0.6:2
a.fn.pkpHandler @ pkp.min.js?v=3.3.0.6:392
a.pkp.classes.linkAction.ModalRequest.activate @ pkp.min.js?v=3.3.0.6:116
a.pkp.controllers.linkAction.LinkActionHandler.activateAction @ pkp.min.js?v=3.3.0.6:299
a.pkp.classes.Handler.handleEvent @ pkp.min.js?v=3.3.0.6:98
dispatch @ jquery.min.js?v=3.3.0.6:2
v.handle @ jquery.min.js?v=3.3.0.6:2