WHMCS Package Limits are Incorrectly Read from the API

8 posts / 0 new
Last post
#1 Wed, 04/03/2019 - 04:44
eugenevdm.host
eugenevdm.host's picture

WHMCS Package Limits are Incorrectly Read from the API

We noted on multiple Virtualmin servers that packages exist in WHMCS and do not pull the correct disk space and traffic overuse information from the Virtualmin server. We then set up a test environment and found the same. The problem is best illustrated below.

The query below show 8 packages that exist in WHMCS.

The second package has the total wrong limits. The limits should be same as package in test 5. In this case Virtualmin and/or WHMCS has assigned unlimited traffic and disk space but actually Virtualmin has severe test limits (30MB and 10MB) on both.

Package ns2.xxxxx.com has the limits and overuse of package arb.xxxxx.com. So in this case, the incorrect package was assigned.

Package arb.xxxxx.com limits are nowhere else to be found in the query.

I've tried various combinations of change package, re-assign, etc but I'm not making any progress.

Anyone else seen this issue? The risk factor is some clients will get billed for incorrect overuse, and other's won't get billed at all.

select domain, tblproducts.name, diskusage, disklimit, bwlimit, bwusage, lastupdate from tblhosting join tblproducts on tblproducts.id = tblhosting.packageid where domainstatus='Active';
+------------------------+--------------+-----------+-----------+---------+---------+---------------------+
| domain                 | name         | diskusage | disklimit | bwlimit | bwusage | lastupdate          |
+------------------------+--------------+-----------+-----------+---------+---------+---------------------+
| aaaoverusetest1.com    | Small Plan   |         0 |      1024 |      10 |       0 | 2019-04-03 11:35:24 |
| aaaoverusetest2.com    | Small Plan   |         0 |         0 |       0 |       0 | 2019-04-03 11:35:24 |
| aaaoverusetest3.com    | Small Plan   |        30 |      1024 |      10 |      30 | 2019-04-03 11:35:24 |
| aaaoverusetest4.com    | Small Plan   |         0 |      1024 |      10 |       0 | 2019-04-03 11:35:24 |
| aaaoverusetest5.com    | Small Plan   |        30 |      1024 |      10 |      30 | 2019-04-03 11:35:24 |
| arb.xxxx.net           | Default Plan |        30 |      1024 |      10 |      30 | 2019-04-03 11:35:24 |
| ns2.xxxxx.com          | Default Plan |       387 |      1536 |    1024 |     195 | 2019-04-03 11:35:24 |
| whmcsdev.xxxx          | Default Plan |         0 |      1536 |    1024 |       1 | 2019-04-03 11:35:24 |
+------------------------+--------------+-----------+-----------+---------+---------+---------------------+
Sat, 05/25/2019 - 17:21
adamjedgar

did you get this sorted? I am also having problems with both the Blesta and WHMCS modules for Virtualmin. I am almost at the point of giving up and going to a different control panel that i know works with automated provisioning programs. I know the whmcs module works perfectly with ISPconfig and also with VestaCP. It also works with Cyberpanel and to an extent Centos Web Panel, however, the Virtualmin one at present is completely non functional for me. I cant email from whmcs, cant provision from either whmcs or blesta, usermin doesnt work with Authentic theme...its frustrating.

I am not sure if its the non functional authentic theme issue that is dogging Usermin that is causing the problems for me or something else?

As another example, I am also finding that if i use whmcs interface to "Login to Control Panel", whmcs is completely bypassing the two factor authentication in virtualmin and logging me straight into the Control panel interface. WHMCS is only using the username and password to access (not API hash key) so how can this be?

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Sun, 05/26/2019 - 03:51
eugenevdm.host
eugenevdm.host's picture

Hi @adamjedgar,

Yes, it's working now. WHMCS provisioning is working, statistics disk space and traffic usage are updated. All great.

You mention various issues here so let's narrow it down a lot. Mostly I'll try to address the WHMCS issue here. Bear in mind this is a Virtualmin forum so you'll not get too much community support for Blesta unless by chance someone else who uses WHMCS, Virtualmin, and Blesta stumbles across the post.

To fix your WHMCS problem, you have to turn on module logging in WHMCS, Utilities / Log / Module Log.

Next perform an action that invokes the API. One that works well is suspending and then unsuspending a client's account. This will invoke the module twice. Next you have to describe the actual symptoms of the problem. You're describing your frustration, and not the symptoms.

If you have access to another server, you also need to perform the process of isolation. For example, spin up the smallest cheapest possible server, install Virtualmin (it's just one command), then connect with you WHMCS server to this instance. Do some actions and see if it works. It it works, the problem is not your WHMCS setup, but rather your original server. If it doesn't work, then the problem is with your WHMCS setup. So this step, of installing another server, will isolate your problem with 50%.

The other options would be to run the provisioning command from the command line. Here is a simple script that reads all domains on the Virtualmin server:

`<?php $result = shell_exec("wget -O - --quiet --http-user=root --http-passwd=YOUR_ROOT_PASSWORD 'https://your_host.domain.com:10000/virtual-server/remote.cgi?program=lis...'");

echo $result;`

Does that command work?

I can provide more advice but you have to describe symptoms and exact steps (if possible) on how to replicate the problem then from there I'll provide further advice.

Usermin is a mail administration interface. I fail to see how this has anything to do with WHMCS provisioning. But if the interface is a problem, have you tried resetting it to default? Either way, I honestly don't think Usermin has anything to do with your issue. If you have ongoing unrelated issues with Usermin then rather open another post.

Finally if you need more help, I'll gladly assist. Contact me privately via the forum or add my WhatsApp number +27823096710 then we can take it further. Essentially we need to isolate the problem further.

warm regards, Eugene https://vander.host

Eugene van der Merwe

https://vander.host WordPress Website Hosting, VPS Hosting, and Domain Registration

Sun, 05/26/2019 - 06:01
adamjedgar

Hi Eugene, I will start a new thread about this because there are a number of areas that need considering in my setup.

AJECreative is the home of $5 webhosting, $15/month VPS servers (1cpu,1gb RAM, 25GB storage)
Centos7, Debian9, or Ubuntu18LTS
Available Control Panels = Centos-Webpanel, Cyberpanel, or Virtualmin

https://ajecreative.com.au

Thu, 07/11/2019 - 02:41
NickSchick

@eugenevdm.host

I am also having issues with disk usage quotas. The output from the module log seems to show the relevant data from Virtualmin (when cross-checked the information is correct):

    Server quota: 5 GB
    Server block quota: 5242880
    Server quota used: 2.53 GB
    Server block quota used: 2654716
    Server byte quota used: 2718429184
    User quota: 5 GB
    User block quota: 5242880
    User quota used: 597.72 MB
    User block quota used: 612068
    User byte quota used: 626757632
    Databases count: 2
    Databases size: 522.67 MB
    Databases byte size: 548061184
    Bandwidth limit: 25 GB
    Bandwidth byte limit: 26843545600
    Bandwidth start: 11/Jun/2019
    Bandwidth usage: 695.41 MB
    Bandwidth byte usage: 729195245
    Disable if over bandwidth limit: Yes

And this information is present for all virtual servers (domain accounts) across 7 physical Virtualmin installations. What is funny is one of the virtual servers (out of many) actually shows the information correctly in WHMCS - 2 additional virtual servers show information (however the information is wrong very random) and all of the rest show unlimited everything.

I have compared all the configuration files that I could think of and have tried changing the virtual servers (plan upgrade/downgrade, New servers moved to different domain names) anything to try to isolate the issue but no luck. Any help be great!

Mon, 07/15/2019 - 23:05
eugenevdm.host
eugenevdm.host's picture

@NickSchick

I have two suggestions:

  1. Contact WHMCS, Nathan L. who is Technical Analyst II. Refer him to eugene@vander.host ticket # OCQ-028907

He supplied me with a new Virtualmin plugin, which sorted out timeouts.

I'm not saying timeouts are the issue. They actually reproduced the problem and log this bug: PSV-878180

Problem is they said bug fixing could take a while.

Plan B:

I am using a workaround script which reads the API and then loops through domains in WHMCS:

  1. https://github.com/eugenevdm/whmcs-virtualmin-usage

Eugene van der Merwe

https://vander.host WordPress Website Hosting, VPS Hosting, and Domain Registration

Mon, 10/07/2019 - 12:45
YMike322

Thank you so much for sharing this content! It was very useful for my recent programming project with https://ewriters.pro and I'm not professional in programming, so your website was of good help for me!

Thu, 10/24/2019 - 07:01
kayleeflemings

Let me know how to check whether everything works right on this website https://essaypro.com/write-my-essay.html as seems that the issue is the same as you have drawn above. Could you please help me how to check this? Or suggest someone who can help me.