Problems after upgrading OMP 3.2.0.3

Hi @rmga,

What about the warning you included in your first post?

Regards,
Alec Smecher
Public Knowledge Project Team

It still appears this log in OMP and OJS:
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

Hi @rmga,

Does your configured proxy work with HTTPS on that port, or just HTTP?

Regards,
Alec Smecher
Public Knowledge Project Team

The proxy is configured with https. I have configured https in proxy item in my config.inc.php. And I’m able to access other https sites by the same proxy that I’m using in OJS. The proxy administrator checked that I reached the pkp site properly.
Regards.

Hi @rmga,

Is your allow_url_fopen setting still set to Off?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes. It 's set to off.

Could I need to configure anything in my /etc/php.ini?

I have the same problem in OJS and in OMP. I’ve tried to upgrade both applications to 3.2.03, but I continue with plugin gallery empty.
Regards.

Hi @rmga,

With allow_url_fopen disabled, OJS/OMP/OPS should use lib/pkp/classes/file/wrappers/HTTPSFileWrapper.inc.php to fetch the plugin gallery XML file, which mostly falls back on lib/pkp/classes/file/wrappers/HTTPFileWrapper.inc.php for its implementation. (You’ll see the proxy configuration fetched in the latter, for example.)

I think what’s probably happening is that the open function in HTTPFileWrapper is not succeeding. I’d suggest adding some error_log calls to the various parts of that function to determine which of the return cases is being hit.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi ,
Could you send me an example of error_log call that I should add in the function? Sorry but I don’t have much idea about php programming.
Thanks a lot.
Regards.

Hi @rmga,

In lib/pkp/classes/file/wrappers/HTTPFileWrapper.inc.php, around line 78, you’ll see:

if (!($this->fp = fsockopen($host, $port)))
    return false;

Change this to…

if (!($this->fp = fsockopen($host, $port, $errno, $errstr))) {
    error_log(__FILE__ . ':' . __LINE__ . ' Could not connect to ' . $host . ': ' . $errstr);
    return false;
}

Around line 117, you’ll see:

$this->close();
return false;

Replace this with:

$this->close();
error_log(__FILE__ . ':' . __LINE__ . ' Could not connect to ' . $host . ' (' . $rc . '; ' . $this->redirects . ')');
return false;

(We’ll include these changes in future releases so that debugging is easier. See pkp/pkp-lib#5963 Improve error logging pending proper reimplementation · pkp/pkp-lib@63d101a · GitHub for the changes in github.)

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you so much, @asmecher
I’ll add them and I’ll see if it succeed.
Thanks for your help :slight_smile:
Regard.

Hi @asmecher,

I checked in my config.inc.php and it’s configured like this:
[proxy]
http_host = 193.146.56.1
http_port = 8080

After adding error_log calls you told me, the log says:

[Thu Jun 04 10:42:40.734341 2020] [php7:warn] [pid 14679] [client 1xxx:9938] 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 Jun 04 10:44:31.261129 2020] [php7:notice] [pid 105430] [client xx:9976] /home/ojs/lib/pkp/classes/file/wrappers/HTTPFileWrapper.inc.php:122 Could not connect to x.x.56.1 (400; 5), referer: https://xxx/index.php/Quodlibet/management/settings/website
[Thu Jun 04 10:44:31.261267 2020] [php7:warn] [pid 105430] [clientxxx:9976] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/ojs/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https://xx.xx.es/index.php/Quodlibet/management/settings/website
[Thu Jun 04 10:44:44.152383 2020] [php7:notice] [pid 14679] [client xxx:9980] /home/ojs/lib/pkp/classes/file/wrappers/HTTPFileWrapper.inc.php:122 Could not connect to x.x.56.1 (400; 5), referer: https://xxx.uah.es/index.php/Quodlibet/management/settings/website
[Thu Jun 04 10:44:44.152540 2020] [php7:warn] [pid 14679] [client xxxx:9980] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /home/ojs/lib/pkp/classes/plugins/PluginGalleryDAO.inc.php on line 57, referer: https://xxx.xx.es/index.php/Quodlibet/management/settings/website

Could you tell me another situation where I’m allowed to use the proxy too? How can I test another situation so I can test my proxy connection?
Thanks.
Regards.

Hi @rmga,

The following snippet:

Could not connect to x.x.56.1 (400; 5)

…indicates that your proxy server is responding to the request with a 400 Bad Request header.

If you have access to your proxy server’s log, it may indicate why it’s declining to proxy the connection to the plugin gallery list.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
proxy logs only say there are stuffs trying to connect directly to the Internet, trying to connect to 104.16.219.84. So, there is something that doesn’t have configurated proxy well. Other stuff are trying to connect this DNS myip.opendns.com (208.67.222.222), that it’s not mine.

Besides config.inc.php, is there anything else I need to configure the proxy? any plugin perhaps?

Thanks,
Regards.

Hi @rmga,

What proxy software are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
It’s the proxy contained in Fortinet.
Regards.

Hi @rmga,

It looks like our implementation of an HTTPS proxy client doesn’t like your proxy, and rather than debug and fix it, we would be better served by going with a standard 3rd-party library for that job. I haven’t scheduled this work sooner than OJS/OMP/OPS 3.3, but there’s some work underway here: Replace FileWrapper with 3rd-party implementation · Issue #5963 · pkp/pkp-lib · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
you mean If I need SSO plugin, e.g., I have to install this plugin by myself, don’t you?
Where can I get those plugins and how do I have to install them?
Thanks so much.
Regards.

Hi @rmga,

Take a look at the list of plugins that the Plugin Gallery uses; it’s available here: http://pkp.sfu.ca/ojs/xml/plugins.xml

You’ll need to make sure that the version you choose to install is compatible with your version of OMP (this is part of what the Plugin Gallery does). You’ll see specific compatibilities listed for each plugin. Then you can download the respective package (.tar.gz file) to your local computer, and then upload the plugin package to the plugin list as administrator.

Regards,
Alec Smecher
Public Knowledge Project Team