Problems after upgrading OMP 3.2.0.3

Hi @asmecher,
I’ve just installed OMP 3.2.0.3 and installation was successful but I have these warnings in my error.log:

  • [Wed May 13 13:50:29.450622 2020] [php7:warn] [pid 104170] [client x.x.x:37372] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/omp/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https://x.x.x/index.php/press1/management/settings/website

  • [Wed May 13 13:50:30.116224 2020] [php7:warn] [pid 104169] [client x.x.x:37373] PHP Warning: file_exists(): open_basedir restriction in effect. File(plugins/gateways/README/index.php) is not within the allowed path(s): (/home/omp/:/home/omp/plugins/gateway:/usr/share/php5/:/var/lib/php5/:/tmp/:/:/ompdata) in /home/omp/lib/pkp/classes/plugins/PluginRegistry.inc.php on line 243, referer: https://x.x.x/index.php/press1/management/settings/website

No plugins can be searched in plugin gallery. When I search for a plugin, there’s nothing to return. My proxy is well configurated, because I can get to pkp.sfu.ca with a wget command. And it has been checked that there’s a request to pkp.sfu.ca from my server and that pkp.sfu.ca returns a reply to my server. But I get nothing in plugin gallery.

I’ve just installed OJS 3.2.0.3 and I can’t search for plugins either.

Thanks.
Regards.

Hi @rmga,

Is your proxy configured in config.inc.php?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi!

Yes:
http_host = x.x.x.x
http_port = 8080

I’ve tried by configurating allow_url_fopen=Off on /etc/php.ini, but I get nothing. These are the logs:

[Thu May 14 08:45:55.944929 2020] [php7:warn] [pid 73900] [client1x.x.x.x9622] PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php on line 39

[Thu May 14 08:46:24.583977 2020] [php7:warn] [pid 73931] [client x.x.x.x:9669] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/ojs/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https://x.x.x/index.php/rev1/management/settings/website

[Thu May 14 08:46:35.136802 2020] [php7:warn] [pid 73934] [client x.x.x.x:9676] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/ojs/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https:/x.x.x/index.php/rev1/management/settings/website

Thanks.
Regards.

Hi @rmga,

The warning:

[Wed May 13 13:50:30.116224 2020] [php7:warn] [pid 104169] [client x.x.x:37373] PHP Warning: file_exists(): open_basedir restriction in effect. File(plugins/gateways/README/index.php) is not within the allowed path(s): (/home/omp/:/home/omp/plugins/gateway:/usr/share/php5/:/var/lib/php5/:/tmp/:/:/ompdata) in /home/omp/lib/pkp/classes/plugins/PluginRegistry.inc.php on line 243, referer: https://x.x.x/index.php/press1/management/settings/website

…appears because you seem to have a file called README in plugins/gateways; I’m not sure where this came from but you should be able to remove it to resolve the warning. (This will be ignored without causing a warning in a future release.)

As for this warning:

[Wed May 13 13:50:29.450622 2020] [php7:warn] [pid 104170] [client x.x.x:37372] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/omp/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https://x.x.x/index.php/press1/management/settings/website

…it explains why the Plugin Gallery is empty. Are there any related warnings/errors appearing above that?

There is not enough information to track down the cause of the warning…

[Thu May 14 08:45:55.944929 2020] [php7:warn] [pid 73900] [client1x.x.x.x9622] PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/ojs/lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php on line 39

…but I suspect it is cosmetic. To track it down, you’d probably need to temporary edit lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php at line 39 to dump a stack trace, which would help indicate the cause of the problem.

Regards,
Alec Smecher
Public Knowledge Project Team

And how can I dump a stack trace on that php file?

There’s no log above “empty gallery” log :frowning:

Is there any way to get more trace for that problem?

Thanks.

Regards,

Hi @rmga,

You can dump a stack trace to the PHP log by calling:

error_log(print_r(debug_backtrace(),true));

The output from this can be very verbose, so I would caution you to only call it when you need to. For the above warning, you could use:

if (!is_string($string)) error_log(print_r(debug_backtrace(),true));

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks so much, @asmecher

What’s the name of the php file where I need to add the if clause?
Regards.

Hi @rmga,

It’s the one I mentioned above: lib/pkp/lib/vendor/smarty/smarty/libs/plugins/modifier.escape.php

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I added the if clause you toldme at the end of the file:


but I get nothing at all in logs. Only the usual log:

[Mon May 18 10:43:50.264925 2020] [php7:warn] [pid 38271] [client 192.168.128.73:48203] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/ojs/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https://trevistas.uah.es/index.php/Quodlibet/management/settings/website

Hi @rmga,

You’ve added that after the return statements, so it’ll never get executed. It needs to be added higher up in the file (ideally at the very beginning of the function).

Regards,
Alec Smecher
Public Knowledge Project Team