Problema con error: "Failed Ajax request or invalid JSON returned."

Good evening, someone is kindly kind to the next one please
I have already tried with the solutions of the forum but it does not solve the problem the version is 3.1.1
error

I see that the message appears when the button is clicked

  • Make recommendation
  • and schedule publication

but also, I have another problem: when I want to modify the metadata it does not update the data since at the moment of saving the icon on the right it remains spinning and never ends …

I hope you can help me please, regards

Hi @JoseCandido,

On both counts, check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Captura%20de%20pantalla%20de%202018-05-04%2002-27-54

this errors in the log
[:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-pluginSettings-1-citationstylelanguageplugin.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.293404 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-journalSettings-1.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.294031 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-locale-list.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.296891 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-pluginSettings-1-defaultthemeplugin.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.302586 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-locale-47d110ff502787b3cc2b483bcb43d5ce.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.308322 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-locale-f32497eef8ec1768f0319169c7ea6da4.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.308951 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-locale-974072916506638d13a48c208d129913.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website
[Sun Apr 29 03:44:06.309359 2018] [:error] [pid 1004] [client ::1:60002] PHP Warning: file_put_contents(/var/www/html/Pyf/ojs0416/cache/fc-locale-0c1e490e75245d6d4617296f00dfcf8c.php): failed to open stream: Permiso denegado in /var/www/html/Pyf/ojs0416/lib/pkp/classes/cache/FileCache.inc.php on line 90, referer: http://localhost/Pyf/ojs0416/index.php/pyf/management/settings/website

In relation to this problem I have seen that in Windows it works but in the Linux server it does not

Hi @JoseCandido,

Your file permissions in the cache directory need correcting so that PHP can manage the files there – see the FAQ for an article on file permissions. Also, make sure you direct error/warning messages via your PHP configuration to the log file rather than the browser or they’ll interfere with AJAX requests.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, but what should I do now since the permissions of the CACHE and PUBLIC folder are in 777

In fact it worked fine with ojs 3.1.0, but when applying update to ojs 3.1.1 these problems appeared,

Please, if you are so kind in supporting me with all this, I thank you very much.

Hi @JoseCandido,

The error messages above suggest that permissions in cache aren’t allowing PHP to edit files there. Either the permissions aren’t set fully (e.g. they’re set on the directory but not its contents) or your server has other things to consider like SELinux extensions.

Note that 777 permissions are never safe to use, though they can be helpful for debugging/tinkering.

OJS 3.1.0 and 3.1.1 don’t have different needs for file permissions, so what worked on 3.1.0 should also work for 3.1.1.

Regards,
Alec Smecher
Public Knowledge Project Team

We have faced the same problem out sky (it was working fine for close to three years). We receive this message (Failed Ajax request or invalid JSON returned.) when we want to “Schedule for Publication”. What should we do. We are runing multiple journals. It happens we do get this message in one of our journals. Other journals works fine. OJS version is " 3.1.1.4".

I just resolve the probem by turning off the “forthcomingissue” plugin. It looks like if the plugin is on you need to have a forthcoming issue??? Since as long as we had the forthcoming it was working fine??? I am not sure but my best guess.

Hi @Alireza_Mosavi_Jarra,

That’s a third-party plugin – I’d suggest raising the issue with the plugin’s author. You can do that by creating a new entry here, with details about the problem you encountered: Issues · ajnyga/forthcoming · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team