Jump to content
  • 0

cPanel - Force Server Limits Question


evolvewh

Question

When the box is checked for 'force server limits' and 'First non full - server' is selected, what is Blesta looking at to determine this? I have 2 servers added in a group at the moment and one of them is maxed out for the 'Accounts' I setup. We just had this service provisioned and Blesta added the account on the server that was already full based on what's entered for 'Accounts'. This is using Blesta 4.1.2 and cPanel v2.5.0

Link to comment
Share on other sites

25 answers to this question

Recommended Posts

  • 0
18 hours ago, cyandark said:

I have the same problem, and looks like is a bug. 

What is the server/server group setup?  And which module are you experiencing it on? (I think this is happening on modules that use the default module row selection but I just want to make sure).

Link to comment
Share on other sites

  • 0
6 minutes ago, Jono said:

I'd love to get this fixed in 4.2.  Any info you guys can give me that might help me recreate this error would be greatly appreciated.  @cyandark @evolvewh

I look in the logs and I don't see anything that jumps out. Everything is a success. For the servers, every full one is showing maxed out (ie, 250/250) and 'force server limits' is checked under the server group settings and Add Order is 'first non full server'. Can you give me any other places to look? Any other log files elsewhere? I don't see anything in /home/user/logs_blesta/ either

Link to comment
Share on other sites

  • 0
2 minutes ago, evolvewh said:

Can you give me any other places to look?

Well it is not really an error since it "succeeds", it just doing the wrong thing, so we probably won't find any help in the logs.  Maybe just some more info about your server group and package.   Is it just two servers?  Is there just one server group for the module?  Have you confirmed that the package is using the server group rather than the individual server?  Have you seen this in more than one module?  

Also just to make sure, have you modified any code in module.php?

Link to comment
Share on other sites

  • 0
1 minute ago, Jono said:

Well it is not really an error since it "succeeds", it just doing the wrong thing, so we probably won't find any help in the logs.  Maybe just some more info about your server group and package.   Is it just two servers?  Is there just one server group for the module?  Have you confirmed that the package is using the server group rather than the individual server?  Have you seen this in more than one module?  

Also just to make sure, have you modified any code in module.php?

No code has been modified in module.php

There are 2 server groups setup for cPanel with 4 different servers at the moment (2 in each group). 1 server is full in each group and 1 is not and the issue occurs within each server group. I have not seen this happen with any other module.

Link to comment
Share on other sites

  • 0
1 minute ago, evolvewh said:

No code has been modified in module.php

There are 2 server groups setup for cPanel with 4 different servers at the moment (2 in each group). 1 server is full in each group and 1 is not and the issue occurs within each server group. I have not seen this happen with any other module.

Thank you much, hopefully this info will guide me to our problem.

Link to comment
Share on other sites

  • 0
4 minutes ago, evolvewh said:

Just to confirm, having both servers listed as 'assigned' shouldn't matter right? I've always thought I need to leave them both there so that the statistics load in the clients account area.

By 'assigned' you mean that they are in the 'Assigned Servers' section when edit a server group that is of course not a problem since that is simply how you assign the server to the group.  As far as statistics, do you mean the 'Statistics' tab when editing the service?  Because I'm fairly sure that info will be pulled exclusively from whatever server got assigned to that service.

Link to comment
Share on other sites

  • 0
41 minutes ago, Jono said:

By 'assigned' you mean that they are in the 'Assigned Servers' section when edit a server group that is of course not a problem since that is simply how you assign the server to the group.  As far as statistics, do you mean the 'Statistics' tab when editing the service?  Because I'm fairly sure that info will be pulled exclusively from whatever server got assigned to that service.

Yes I was talking about the 'Assigned Servers' section in the server group and talking about the stats that are pulled from each cPanel account for each client. I didn't figure this was an issue but I thought I'd double check so that I didn't send you off in the wrong direction when you're looking for the cause of the bug.

Link to comment
Share on other sites

  • 0

I just thought of something.  Is it possible that the service was created before the limit was reached and then provisioned after?  The module row is selected when the service is created.  If the service was created when the server was at 49/50, then another service was created bumping the server to 50/50, than this service would still be created on this server and would bump the server to 51/50.   I imagine the easiest way to check this is to see if the bad behavior still happens when you create a service now. @evolvewh @cyandark

Link to comment
Share on other sites

  • 0
9 minutes ago, Jono said:

I just thought of something.  Is it possible that the service was created before the limit was reached and then provisioned after?  The module row is selected when the service is created.  If the service was created when the server was at 49/50, then another service was created bumping the server to 50/50, than this service would still be created on this server and would bump the server to 51/50.   I imagine the easiest way to check this is to see if the bad behavior still happens when you create a service now. @evolvewh @cyandark

That wasn't the case with us this time but I could see where your example could be another issue. The server that the service was assigned to has been maxed out for a long time now (6+ months).

Link to comment
Share on other sites

  • 0
2 minutes ago, Jono said:

And this error just started occurring now?  When is the last time you upgraded and from what version?  (BTW thanks for all your help on this).

We just recently migrated back from the cPanel Extended module but I've seen it a couple of times now (wasn't paying close attention at first). We've stayed current with every version of Blesta and haven't customized anything other than the support manager plugin.

You're welcome for all of the help with this and I appreciate you making it a high priority since we can't resend welcome emails if we had to change a server because of this.

Link to comment
Share on other sites

  • 0

I am using cPanel Core in a local installation with 1 server group and 2 cPanel servers, both servers has a limit of 10 accounts. However, the module continues to create new accounts on the first server instead of using the second one that is empty,.
dev1.cyandark.com 11/10
dev2.cyandark.com 0/10

I'm going to check the code tomorrow and if I find something I'll publish an update with a little more technical information. 

Link to comment
Share on other sites

  • 0

I am sure I'm missing some other things but in the module.php file, I see 'account_limit' and 'account_count' mentioned. In the cPanel files, I see no mention of 'account_count' anywhere and it makes me think the module isn't taking into consideration the actual count.

I don't know if this would be the place for it or not:

components/modules/cpanel/cpanel.php

Line 472

public function addModuleRow(array &$vars)
    {
        $meta_fields = ['server_name', 'host_name', 'user_name', 'key',
            'use_ssl', 'account_limit', 'name_servers', 'notes'];
        $encrypted_fields = ['user_name', 'key'];

 

Link to comment
Share on other sites

  • 0
48 minutes ago, evolvewh said:

In the cPanel files, I see no mention of 'account_count' anywhere and it makes me think the module isn't taking into consideration the actual count.

It is mentioned on lines 518, 1551, 1565, 1575, and 1936.  cPanel.php handles updating account_count, but module.php handles selecting a server based on that account_count.

Since the other thread about this error occurring on direct admin, I am thinking that the problem is with module.php or another related core file.

Link to comment
Share on other sites

  • 0

I haven't been able to duplicate this issue either using:

  1. A fresh install of v4.1.2
  2. cPanel module v2.5.0
  3. Two cPanel servers setup
    1. One that has reached its account limit
    2. One that has not yet reached its account limit
    3. Both assigned to a single server group "A"
      1. The server group set to an Add Order of "First Non-Full server"
      2. "Force Server Limits" checked
  4. A package that uses the cPanel module
    1. Package module options set to use the cPanel server group "A" (i.e. not a specific cPanel server)
    2. "Standard" Account Type

Creating a new service set to "Provision using the cPanel module" always creates the service on the server that has not reached its account limit.

Questions:

  1. Are you creating the service via the API, via cron, or via the client UI as opposed to the admin UI I tested with?
  2. Have you checked the module rows (servers) to ensure they contain module row meta information for the account limit and account total? This is what's shown on the table in cPanel server listing under the "Accounts" column, e.g. "150/250"
    1. Values would be stored in the `module_row_meta` table where there should be a `key` for "account_limit" and "account_count" each with an integer `value` for a particular `module_row_id` from the server group.
Link to comment
Share on other sites

  • 0
25 minutes ago, Tyson said:

I haven't been able to duplicate this issue either using:

  1. A fresh install of v4.1.2
  2. cPanel module v2.5.0
  3. Two cPanel servers setup
    1. One that has reached its account limit
    2. One that has not yet reached its account limit
    3. Both assigned to a single server group "A"
      1. The server group set to an Add Order of "First Non-Full server"
      2. "Force Server Limits" checked
  4. A package that uses the cPanel module
    1. Package module options set to use the cPanel server group "A" (i.e. not a specific cPanel server)
    2. "Standard" Account Type

Creating a new service set to "Provision using the cPanel module" always creates the service on the server that has not reached its account limit.

Questions:

  1. Are you creating the service via the API, via cron, or via the client UI as opposed to the admin UI I tested with?
  2. Have you checked the module rows (servers) to ensure they contain module row meta information for the account limit and account total? This is what's shown on the table in cPanel server listing under the "Accounts" column, e.g. "150/250"
    1. Values would be stored in the `module_row_meta` table where there should be a `key` for "account_limit" and "account_count" each with an integer `value` for a particular `module_row_id` from the server group.

@Tyson the client has placed an order and we are accepting the order on the admin side after manually reviewing it. I did check the database and there is an 'account_count' and 'account_limit' stored in the `module_row_meta` table and the values are accurate.

We'll keep an eye on it over the next couple of weeks and see if the issue happens again or not.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...