Openprovider-WHMCS-domains icon indicating copy to clipboard operation
Openprovider-WHMCS-domains copied to clipboard

[BUG] Openprovider API downtime causes web server to hang and breaks entire WHMCS installation

Open Lippur opened this issue 2 years ago • 13 comments

Describe the bug Enabling the latest version of the module (as of 12/12/2022) on a WHMCS 8.6.1 causes the entire WHMCS to stop working if the Openprovider API is experiencing downtime. Pages keep loading indefinitely, both on the frontend and the admin side. Other PHP scripts not affiliated with WHMCS load fine. Simply moving the openprovider folder out of modules/registrars, thereby disabling it, fixes the problem immediately.

To Reproduce Steps to reproduce the behavior:

  1. Move the /modules/registrars/openprovider folder to the /modules/registrars directory of WHMCS
  2. Reload the page
  3. Page does not load
  4. Move the openprovider directory out of WHMCS
  5. Refresh the page
  6. Page does load

Expected behavior I expect the OpenProvider module not to break WHMCS

Screenshots

Server info:

  • Distro: Ubuntu 22.04
  • PHP: 7.4 FPM
  • Web server: Apache, tested with both MPM worker and prefork

Additional context This is pretty critical, since I have now had to disable the module to keep WHMCS working, which means customers are not able to purchase, manage, or renew domains.

Lippur avatar Dec 13 '22 01:12 Lippur

Good to hear I'm not the only one. Seems to coincide with the planned API maintenance from previous night.

JacketShirtsMan avatar Dec 13 '22 09:12 JacketShirtsMan

It's pretty insane that the Openprovider API going down completely kills the entire WHMCS installation, especially since these downtimes are not uncommon. The error handling for failed network requests should definitely be improved in the module.

Lippur avatar Dec 13 '22 12:12 Lippur

Our WHMCS installations didn't go down but then I've lost track of what versions of the OpenProvider module we're running on. I tend to not touch them if they're working OK. I know in the past the OpenProvider account balance widget on the admin home page used to cause the page not to load if the credentials were incorrect, so it wouldn't surprise me if other errors aren't being handled gracefully.

willdashwood avatar Dec 13 '22 12:12 willdashwood

Our WHMCS installations didn't go down but then I've lost track of what versions of the OpenProvider module we're running on. I tend to not touch them if they're working OK. I know in the past the OpenProvider account balance widget on the admin home page used to cause the page not to load if the credentials were incorrect, so it wouldn't surprise me if other errors aren't being handled gracefully.

The admin panel widget increases the page load time from 2 seconds to over 10 seconds, even when it is working, which is incredibly annoying in its own right.

Lippur avatar Dec 13 '22 12:12 Lippur

Yeah I've never figured out how to disable it

willdashwood avatar Dec 13 '22 12:12 willdashwood

Just found out that 1 of our installations did go down; it was running v5.4-REST whereas the others are on v5.6-REST. So perhaps this has been fixed in more recent releases?

willdashwood avatar Dec 13 '22 13:12 willdashwood

I use 5.6.3. The beta for PHP 8.1. I've yet to wait for a PHP 8.1 fix for 1 module, so it's still running PHP 7.4. Will try downgrading to 5.6.2 Official. Only thing I don't understand is: Is the maintenance still busy or did something change on the API side?

JacketShirtsMan avatar Dec 13 '22 13:12 JacketShirtsMan

Well it all seems to be working for me, although no formal announcement on twitter.

willdashwood avatar Dec 13 '22 13:12 willdashwood

Version 5.6.2 is working for me. So a 5.6.3 beta really is a beta ;). But that does not solve the problem, as PHP 8.1 is still on the pipeline of being activated.

JacketShirtsMan avatar Dec 13 '22 13:12 JacketShirtsMan

We were on the latest version as of yesterday, I even updated it again just in case to see if it would fix it. No change. But it probably does not happen right now because the API is back up.

Lippur avatar Dec 13 '22 14:12 Lippur

5.6.3 is indeed working again. Still needs fixing though. 1 module should not brick customers whole installations...

JacketShirtsMan avatar Dec 13 '22 15:12 JacketShirtsMan

I haven't really delved into the code but to me, it makes sense to pass all OpenProvider API calls to a function that gracefully handles any errors.

willdashwood avatar Dec 13 '22 15:12 willdashwood

FYI, if you want to get rid of the balance widit altogether, you can just delete:

./modules/registrars/openprovider/Controllers/Hooks/Widgets/BalanceWidget.php

Edit: And also:

./modules/registrars/openprovider/Controllers/Hooks/AdminWidgetController.php

willdashwood avatar Dec 19 '22 16:12 willdashwood

Hi @Lippur @JacketShirtsMan @willdashwood,

We have fixed the balance widget issues in the latest release - version 5.8.0.

We tried to test the reported problem in latest version by making API non-resolvable (by setting non-resolvable address for API base URL in hosts file locally) and we were unable to reproduce the behavior. So I would suggest you to upgrade to the latest version of the module.

If you experience any such issues with latest version of the module, please contact our support team with following details so that we can investigate it:

  • Reseller ID
  • module logs
  • WHMCS, Openprovider module and PHP version details.

Thank you!

sapillai avatar Jun 03 '24 10:06 sapillai