Orcid profile error 500 after author sign-in

I have a problem with the Orcid profile plugin. After the author fills the pop-up window with their sign-in details, the site returns a 500 error page.

The URL in the window with the 500 error is “SITEROOT/index.php/JOURNAL/orcidapi/orcidAuthorize?targetOp=register&code=csQSgN”

I’m on OJS 3.2.0.3 and can’t upgrade OJS for the time being. PHP 7.2.x because switching to PHP 7.3 breaks the site.

The Orcid Module is the latest version v1_1_3-4 from Github.

Any ideas on how to debug this?

Thanks!

Hi @Jorge

What is the PHP fatal error causing the problem? It should be in your server logs.

Best
Jason

For some reason I’m not getting a PHP error in the logs, although there are error logs present. Should I enable extra reporting somewhere?

Hi again. I did find some errors in the log but not the more recent ones, which is puzzling. But I see a problem that has to do with a double slash. I see URLs like these https://pub.orcid.org/v2.1//person which do return a 500 error from the Orcid server. See:

[28-Sep-2022 09:42:42 Europe/Madrid] Unexpected ORCID API response: 500 (/home/ROOT-TO-OJS/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 111, URL https://pub.orcid.org/v2.1//person)
[28-Sep-2022 09:42:42 Europe/Madrid] Unexpected ORCID API response: 500 (/home/ROOT-TO-OJS/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 130, URL https://pub.orcid.org/v2.1//employments)

EDIT: these errors are from an older version of the plugin because I can see this in the plugin: “define(‘ORCID_API_VERSION_URL’, ‘v3.0/’);”

I’m going to try removing that trailing slash from v3.0 and see what happens.

The trailing slash wasn’t the problem. Any suggested settings for the PHP error to get logged?

Hi @Jorge ,

the latest version of the plugin is 1.1.2.26 for OJS 3.2.

Could you install it from the plugin gallery and let me know errors if there are any?

Apparently I can’t downgrade. I get this in the error_log:
ojs2: You are trying to downgrade the product “orcidProfile” from version [1.1.3.4] to version [1.1.2.3]. Downgrades are not supported.

So I put back 1.1.3.4. Is there any way to force the downgrade?

I also found that for some reason almost all php error logging was turned off, sorry for missing that!

I turned back on all error reporting and now at least I have the actual error:

[28-Oct-2022 12:49:39 Europe/Madrid] PHP Deprecated:  Non-static method PKPApplication::getRequest() should not be called statically in /home/ROOT-TO-OJS/plugins/themes/bootstrap3/BootstrapThreeThemePlugin.inc.php on line 107
[28-Oct-2022 12:49:39 Europe/Madrid] PHP Deprecated:  Non-static method PKPApplication::getRequest() should not be called statically in /home/ROOT-TO-OJS/plugins/themes/bootstrap3/BootstrapThreeThemePlugin.inc.php on line 129
[28-Oct-2022 12:49:39 Europe/Madrid] PHP Deprecated:  Non-static method PKPApplication::getRequest() should not be called statically in /home/ROOT-TO-OJS/plugins/generic/publons/PublonsPlugin.inc.php on line 197
[28-Oct-2022 12:49:39 Europe/Madrid] PHP Fatal error:  Uncaught Error: Call to undefined method Application::getHttpClient() in /home/ROOT-TO-OJS/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php:62
Stack trace:
#0 /home/ROOT-TO-OJS/lib/pkp/classes/core/PKPRouter.inc.php(391): OrcidHandler->orcidAuthorize(Array, Object(Request))
#1 /home/ROOT-TO-OJS/lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#2 /home/ROOT-TO-OJS/lib/pkp/classes/core/Dispatcher.inc.php(143): PKPPageRouter->route(Object(Request))
#3 /home/ROOT-TO-OJS/lib/pkp/classes/core/PKPApplication.inc.php(278): Dispatcher->dispatch(Object(Request))
#4 /home/ROOT-TO-OJS/index.php(68): PKPApplication->execute()
#5 {main}
  thrown in /home/ROOT-TO-OJS/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php on line 62

I simply uploaded 1.1.2.3 via FTP and it seems to have downgraded fine.

However, the error is the same: Call to undefined method Application::getHttpClient()

Hello @Dulip_Withanage,

Any ideas what to try here?

Thanks!

If you are proficient with SQL, you could delete the corresponding record for the plugin in the versions table of your OJS database. Be sure to make a backup of the database before.

E.g.

select * from versions where product like "orcidProfile";

Then identify the version you want to delete and use the appropriate delete statement.
Then delete orcidProfile directory in your plugins/generic and do a reinstall of the corresponding plugin version.

Thanks @mpbraendle! This has allowed me to reinstall the plugin from the module gallery… and IT WORKS!!! I’ve been able to link the profile without errors.

Hi,

We just noticed last week we are in the same hole.
@Jorge, to what version did you revert? Did you make any other change?
I reverted to 1.1.2-26 but it did not help much here.

For the record, I’m in OJS stable-3.2.1 (dockerized) with PHP7.3 and logs shows:

PHP Notice:  Undefined variable: url in /var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php on line 85, referer: https://orcid.org/
ORCID CURL error:  (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 85, URL ), referer: https://orcid.org/
Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 111, URL https://pub.orcid.org/v3.0//person), referer: https://orcid.org/
Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 130, URL https://pub.orcid.org/v3.0//employments), referer: https://orcid.org/
PHP Notice:  Undefined variable: url in /var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php on line 85
ORCID CURL error:  (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 85, URL )
Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 111, URL https://pub.orcid.org/v3.0//person)
Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 130, URL https://pub.orcid.org/v3.0//employments)

As said, reverting to 1.1.2-26 (removing the versions lines and unziping it on the generic folder) didn’t work either. I got exactly same error.

When I visit /person or /employments endpoints with browser I get a 500 error but removing it don’t make things better because I get a 404 instead… so I can’t tell if the double slash of “v3.0//” is wrong or not.

I think he issue is before, as in pages/OrcidHandler.inc.php (line 85) looks like results variable is empty (so API didn’t returns anything?).

Cheers,
m.

I’m also getting this error, latest plugin version 1.1.2-28 for the OJS 3.2.1. Any solution?

Hi @Jorge

hmm, I checked the 3.2.1 plugin code and do not see Application::getHttpClient()
in the plugin code.

Just a general not on the recent additions of the plugins

We have released an update for all major releases to reflect the changes in the Orcid API URL.

Please install the plugin for your OJS version from the OJS Plugin Gallery.

System: OJS/OPS 3.4
Plugin version: 1.3.4.5
URL: Release Change the public API URL and add redirection · pkp/orcidProfile · GitHub

System: OJS/OPS 3.3 (LTS rlease)
Plugin version: 1.1.3.10
URL: Release Change the public API URL and add redirection · pkp/orcidProfile · GitHub

System: OJS 3.2 (no active support, only very critical changes)
Plugin version: 1.1.2.29
URL: Release Change the public API URL and add redirection · pkp/orcidProfile · GitHub

@marc - I’m on OJS 3.2.0.3 and I installed the version from the gallery.

Hi @Dulip_Withanage

Thanks for the heads up and the fix. Should I install the linked version via FTP then?

Sorry, this is wrong. The “revert to former version” workarround also worked to me, but I forget to report it back.

In short: If you are on OJS 3.2 DON’T update the ORCID plugin yet.

For the record… sometimes OJS could lie about plugin’s versions. :slight_smile:

OJS tells me the plugin is on version 1.2.2.30 (from 2023-10-31):

While in reality the plugin (acroding to version.xml) is still 1.1.2.26 (from 2022-01-26):

Cheers,
m.

Which means that during/after installation the version upgrade was not carried out (php tools/upgrade.php upgrade).
Sometimes this may also fail because downgrades are not allowed. Then the versions table must be tweaked.

1 Like

Thanks for your comments Martin.

I always though that a “upgrade.php check” was enough to force a “plugin check” but looks like I’m wrong.

To be full sure OJS is fine i did the following:

  1. Disable the plugin.
  2. Full cleaned the orcid DB rows in versions table.
  3. $ php tools/upgrade.php upgrade
  4. Enable the plugin.

And in gallery page, plugin information is still 1.1.2.30, while DB is showing 1.1.2.26.

Could it be that in the gallery this date indicates the version “to upgrade to” instead of the current version? :sweat_smile:

Now that I say it out loud it makes sense and I feel pretty stupid because of the confusion… but in my favor I have to say that a little tag that says "Upgrade to: " or something like that would avoid this kind of confusion.

In any case, I’m still struggling with the problem.
Assuming I’m on 1.1.2.26, orcidPlugin keeps returning the following:

[Thu Nov 09 09:52:46.148737 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] PHP Notice:  Undefined variable: url in /var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php on line 85, referer: https://orcid.org/
[Thu Nov 09 09:52:46.148793 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] ORCID CURL error:  (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 85, URL ), referer: https://orcid.org/
[Thu Nov 09 09:52:46.579679 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 111, URL https://pub.orcid.org/v3.0//person), referer: https://orcid.org/
[Thu Nov 09 09:52:46.764979 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 130, URL https://pub.orcid.org/v3.0//employments), referer: https://orcid.org/
[Thu Nov 09 09:52:47.376514 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] PHP Notice:  Undefined variable: url in /var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php on line 85
[Thu Nov 09 09:52:47.376565 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] ORCID CURL error:  (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 85, URL )
[Thu Nov 09 09:52:47.802240 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 111, URL https://pub.orcid.org/v3.0//person)
[Thu Nov 09 09:52:47.992121 2023] [php7:notice] [pid 13021] [client 172.19.0.21:50654] Unexpected ORCID API response: 500 (/var/www/html/plugins/generic/orcidProfile/pages/OrcidHandler.inc.php line 130, URL https://pub.orcid.org/v3.0//employments)

My current theory is that there may be some filtering issue in the firewall… as the error shows just after a network crisis in our data processing center.

Hi,

I installed the last release of the plugin for OJS 3.2 (released this week with a fix to issue #281) and now authors can associate their orcid following the mail’s link, but users can’t register with the orcid button.

Workaround? I just hide the orcid button in registration.

Publishing the issue in github.

Cheers,
m.

The new issue is filed here: