Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron & Client Area errors: Post-install, errors with API Class (includes) & Client Area info (if no-PVE) #13

Closed
lsthompson opened this issue Jun 9, 2023 · 24 comments
Labels
bug-splat Something isn't working

Comments

@lsthompson
Copy link
Member

End user reported error with WHMCS System Cron post-install.

Unable to include the PHP Class for PVE2 API. Pushed tweak to use ROOTDIR prefix.

ERROR: Error: Failed opening required 'modules/addons/pvewhmcs/proxmox.php' (include_path='.:/usr/share/pear:/usr/share/php') in /sites//billing/modules/servers/pvewhmcs/pvewhmcs.php:5

Stack trace:
#0 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Module/AbstractModule.php(0): unknown()
#1 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Product/Server.php(0): WHMCS\Module\AbstractModule->load('pvewhmcs')
#2 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Product/Server.php(0): WHMCS\Product\Server->getModuleInterface()
#3 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Cron/Task/TenantUsageMetrics.php(0): WHMCS\Product\Server->getMetricProvider()
#4 [internal function]: WHMCS\Cron\Task\TenantUsageMetrics->__invoke()
#5 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): call_user_func_array(Object(WHMCS\Cron\Task\TenantUsageMetrics), Array)
#6 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Scheduling/Task/AbstractTask.php(0): WHMCS\Scheduling\Task\AbstractTask->execute()
#7 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Scheduling\Task\AbstractTask->run()
#8 /sites//billing/vendor/whmcs/whmcs-foundation/lib/Cron/Console/Command/AbstractCronCommand.php(0): WHMCS\Cron\Console\Command\AbstractCronCommand->executeCollection(Object(WHMCS\Scheduling\Task\Collection))
#9 /sites//billing/vendor/symfony/console/Command/Command.php(298): WHMCS\Cron\Console\Command\AbstractCronCommand->execute(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /sites//billing/vendor/symfony/console/Application.php(1028): Symfony\Component\Console\Command\Command->run(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /sites//billing/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(WHMCS\Cron\Console\Command\AllCommand), Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /sites//billing/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /sites//billing/crons/cron.php(0): Symfony\Component\Console\Application->run(Object(WHMCS\Cron\Console\Input\CliInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 {main} {"exception":"[object] (Error(code: 0): Failed opening required 'modules/addons/pvewhmcs/proxmox.php' (include_path='.:/usr/share/pear:/usr/share/php') at /sites//billing/modules/servers/pvewhmcs/pvewhmcs.php:5)"} []

Error: Failed opening required 'modules/addons/pvewhmcs/proxmox.php' (include_path='.:/usr/share/pear:/usr/share/php') in /sites//billing/modules/servers/pvewhmcs/pvewhmcs.php:5

LH202321616

@lsthompson lsthompson added the bug-splat Something isn't working label Jun 9, 2023
@lsthompson
Copy link
Member Author

Routed end user to this issue. Pushed commit to prefix ROOTDIR onto API class file: 4950738

Need to know update, and whether the module is otherwise functional?

@elitbiz

This comment was marked as abuse.

@elitbiz

This comment was marked as abuse.

@elitbiz

This comment was marked as abuse.

@lsthompson
Copy link
Member Author

lsthompson commented Jun 9, 2023

@elitbiz that error would make sense if it can't populate the data / connect, though ideally would be caught earlier.

$vm_status=$proxmox->get('/nodes/'.$first_node.'/'.$guest->vtype.'/'.$params['serviceid'] .'/status/current');
L501: $vm_status['diskusepercent'] = intval( $vm_status['disk'] * 100 / $vm_status['maxdisk'] );

Re: Your original Cron error, is that still problematic with each Daily Cron firing?

Re: Proxmox API access, can you verify ANY connections from WHMCS?

Re: Functionality, we only pushed 1.1-beta a few days ago now.

@lsthompson lsthompson changed the title Cron Error: Post-install, error with API Class servers/pvewhmcs.php to modules/proxmox.php Cron & Client Area errors: Post-install, errors with API Class (includes) & Client Area info (divide-by-0 if no-PVE) Jun 10, 2023
@lsthompson lsthompson changed the title Cron & Client Area errors: Post-install, errors with API Class (includes) & Client Area info (divide-by-0 if no-PVE) Cron & Client Area errors: Post-install, errors with API Class (includes) & Client Area info (if no-PVE) Jun 10, 2023
@lsthompson
Copy link
Member Author

Hi @elitbiz just checking in for an update? Would be great to get it running smoothly for you. :-)

@WaldperlachFabi
Copy link

Same problem, how can I check if the connection is working currently? When setting up the Server in WHMCS(8.6.0) it connected successfully!

@lsthompson
Copy link
Member Author

lsthompson commented Jun 12, 2023

You should be able to see the connections from your WHMCS server on the Proxmox host in the /var/log/pveproxy/pveproxy.log file.

@WaldperlachFabi
Copy link

Yes it connects:
::ffff:IP - - [12/06/2023:09:18:23 +0200] "POST /api2/json/access/ticket HTTP/1.1" 200 1325
::ffff:IP - root@pam [12/06/2023:09:18:23 +0200] "GET /api2/json/nodes HTTP/1.1" 200 331
::ffff:IP - root@pam [12/06/2023:09:18:23 +0200] "POST /api2/json/nodes/pve01/lxc HTTP/1.1" 400 164
::ffff:IP - - [12/06/2023:09:18:25 +0200] "POST /api2/json/access/ticket HTTP/1.1" 200 1325
::ffff:IP - root@pam [12/06/2023:09:18:26 +0200] "GET /api2/json/nodes HTTP/1.1" 200 331
::ffff:IP - root@pam [12/06/2023:09:18:26 +0200] "POST /api2/json/nodes/pve01/lxc HTTP/1.1" 400 164
::ffff:IP - - [12/06/2023:09:18:30 +0200] "POST /api2/json/access/ticket HTTP/1.1" 200 1325
::ffff:IP- root@pam [12/06/2023:09:18:30 +0200] "GET /api2/json/nodes HTTP/1.1" 200 331
::ffff:IP - root@pam [12/06/2023:09:18:30 +0200] "POST /api2/json/nodes/pve01/lxc HTTP/1.1" 400 164

@lsthompson
Copy link
Member Author

Great. Does it create the VM/CT okay? @elitbiz says that it doesn't for them.

@WaldperlachFabi
Copy link

No it doesn’t create it, it only throws the error i sent…

@lsthompson
Copy link
Member Author

Got it, thanks. This is in Admin Area or Client Area? Screenshot also please.

@WaldperlachFabi
Copy link

After ordering(with auto setup on) and clicking on the server this shows up in client area:
IMG_0910
IMG_0911
In admin area:
IMG_0912
IMG_0913

@elitbiz

This comment was marked as abuse.

@elitbiz

This comment was marked as abuse.

@lsthompson
Copy link
Member Author

Thank you both! Will work on this and get a test fix to you shortly.

@lsthompson
Copy link
Member Author

lsthompson commented Jun 12, 2023

Hi, please update from master and check Admin + Client areas again?

If the VM/CT Creation doesn't work, please:

  1. Verify that you have IP/s configured in the WHMCS Module?
  2. Send over the PHP errors/log when it fails, including a trace

@WaldperlachFabi
Copy link

WaldperlachFabi commented Jun 12, 2023

Okay now I get a „VM/CT not found in Cluster Resources.“ page. I get the following error when I want to create it manually in admin panel:
IMG_8968

if I want to add an IP to an IP pool, the button doesn’t render and I get the following error when trying to add an IP to an pool:
IMG_8969
IMG_8970
The Error:

ParseError: The (real) cast has been removed, use (float) instead in /var/www/vhosts/abc/whmcs/modules/addons/pvewhmcs/Ipv4/Address.php:32
Stack trace:
#0 /var/www/vhosts/web8209.web07.bero-webspace.de/cp.waldperlachfabi.de/whmcs/modules/addons/pvewhmcs/pvewhmcs.php(1195): require_once()
#1 /var/www/vhosts/abc/whmcs/modules/addons/pvewhmcs/pvewhmcs.php(239): add_ip_2_pool()
#2 /var/www/vhosts/abc/whmcs/admin123/addonmodules.php(0): pvewhmcs_output()
#3 {main}

One more question: for example I have 3 ips assigned to the proxmox Server. 123.456.789.1(main ip of the proxmox server), 123.456.789.4 and 123.456.789.6 how would the ip pool have to look like?

@WaldperlachFabi
Copy link

Here are the logs of the Proxmox Servher when trying to manually create the server in admin area(with getting the error) and after trying to access it from client area!

::ffff:IP - - [12/06/2023:14:30:44 +0200] "POST /api2/json/access/ticket HTTP/1.1" 200 1325
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes HTTP/1.1" 200 329
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/config HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/cluster/resources HTTP/1.1" 200 736
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13
::ffff:IP - root@pam [12/06/2023:14:30:44 +0200] "GET /api2/json/nodes/pve01//88/rrd HTTP/1.1" 501 13

@lsthompson
Copy link
Member Author

lsthompson commented Jun 12, 2023

Thank you kindly, that's very helpful. I've pushed 2 commits now to master - 1x for IPv4 add, 1x for icon.

As for acceptance of order (ie. provisioning of VM/CT), can you please send any WHMCS/PHP logs that you can see?

If none are being generated or stored, you can change your WHMCS Config to log/display errors. Or use debug mode.

https://docs.whmcs.com/Enabling_Error_Reporting
https://docs.whmcs.com/Troubleshooting_Module_Problems

Re: IP Pool, you would only want to have IP Addresses in the Pool which you intend to assign to VMs/CTs.

@WaldperlachFabi
Copy link

Okay, so unfortunately there aren’t any errors displayed.

when ordering and accepting from admin area, you will receive this message:
IMG_8975

When having module log enabled, it won’t give an exact error either:
IMG_8974

where can I find the php logs?

hope this helps you!

@elitbiz

This comment was marked as abuse.

@lsthompson
Copy link
Member Author

@elitbiz update from master again. That error should be cleared already.

@WaldperlachFabi thank you, I'll see what we can improve to get the actual error thrown/logged instead.

@lsthompson
Copy link
Member Author

Closed #13, moved current troubleshooting to new issue #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-splat Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants