openprovider / Openprovider-WHMCS-domains

Openprovider WHMCS Domain Module
43 stars 31 forks source link

[BUG] Unable to download support file #314

Closed GARMTECH closed 5 months ago

GARMTECH commented 5 months ago

Describe the bug Trying to download support file from Addons > Openprovider > Download gets a 503 (Ooops) WHMCS error.

[WHMCS Application] ERROR: TypeError: OpenProvider\WhmcsDomainAddon\Controllers\Admin\SupportController::getModuleLog(): Return value must be of type string, null returned in /var/www/html/modules/addons/openprovider/Controllers/Admin/SupportController.php:109 Stack trace: #0 /var/www/html/modules/addons/openprovider/Controllers/Admin/SupportController.php(67): OpenProvider\WhmcsDomainAddon\Controllers\Admin\SupportController->getModuleLog() #1 /var/www/html/modules/addons/openprovider/vendor/wedevelopcoffee/wpower/src/Core/Instance.php(47): OpenProvider\WhmcsDomainAddon\Controllers\Admin\SupportController->download() #2 /var/www/html/modules/addons/openprovider/vendor/wedevelopcoffee/wpower/src/Core/Launch.php(54): WeDevelopCoffee\wPower\Core\Instance->execute() #3 /var/www/html/modules/addons/openprovider/openprovider.php(75): WeDevelopCoffee\wPower\Core\Launch->output() #4 /var/www/html/eagle/addonmodules.php(0): openprovider_output() #5 {main} {"exception":"[object] (TypeError(code: 0): OpenProvider\\WhmcsDomainAddon\\Controllers\\Admin\\SupportController::getModuleLog(): Return value must be of type string, null returned at /var/www/html/modules/addons/openprovider/Controllers/Admin/SupportController.php:109)"} []

To Reproduce Steps to reproduce the behavior:

  1. Go to admin interface
  2. Click on Addons
  3. Click on Openprovider
  4. Push Download button
  5. See error

Expected behavior Downloading of support file.

Server info:

sapillai commented 5 months ago

Hi @GARMTECH,

From the stack trace, it seems your module log is empty and hence the error in downloading files. After enabling module logging, please reproduce the error so that module and activity logs will be populated.

GARMTECH commented 5 months ago

I'm sure you should handle empty logs, so script will not throw a 503 error in such cases.

sapillai commented 5 months ago

Hi @GARMTECH,

A task is already added for developers to show a user friendly error message instead of the WHMCS Oops error when module log is empty.

sapillai commented 4 months ago

Hi @GARMTECH,

This has been improved in the latest version of the module. You will now see a friendly error message with clear instructions when module log is empty instead of the WHMCS Oops error.

image