The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Transfer Tool incorrectly defaults 'maxsql' to 0

Discussion in 'General Discussion' started by jleckie, May 4, 2016.

Tags:
  1. jleckie

    jleckie Member

    Joined:
    Feb 4, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Midwest
    cPanel Access Level:
    Root Administrator
    This happens when the option to transfer databases is NOT checked. The incoming account does not adopt the max database limit that I've set in the "Standard" package, with which it is created; it sets its own, which is 0.

    My use case: I want to create a new database for a site, not transfer the old one. So I add some database / user / permission creation code in a Standardized Hook that fires on Accounts::Create(which is fired when an account is transferred over.)

    Here is the API error:

    Code:
    {
        "apiversion": 3,
        "func": "create_database",
        "module": "Mysql",
        "result": {
            "data": null,
            "status": 0,
            "errors": ["(XID 6qjn27) You have reached your maximum allotment of databases (0)."],
            "messages": null,
            "metadata": {}
        }
    }
    Any idea of a way I can circumvent this? My next step is going to be to try and reassign the same Standard package on account creation before running the database creation hook; maybe it will override the bad maxsql limit. Here is the feedback from the Accounts::Create event if it's pertinent:

    Code:
    {
       "contactemail" : "",
       "maxftp" : "0",
       "bwlimit" : 0,
       "pass" : "HIDDEN",
       "owner" : "root",
       "max_defer_fail_percentage" : "unlimited",
       "spf" : null,
       "gid" : "",
       "maxsub" : "0",
       "useip" : "n",
       "hasshell" : "n",
       "user" : "REDACTED",
       "featurelist" : "default",
       "mxcheck" : "remote",
       "no_cache_update" : 0,
       "homeroot" : "/home",
       "hascgi" : "n",
       "domain" : "REDACTED.com",
       "quota" : 0,
       "digestauth" : "n",
       "plan" : "Standard",
       "is_restore" : 1,
       "dkim" : null,
       "force" : 0,
       "skip_mysql_dbowner_check" : 0,
       "max_email_per_hour" : "unlimited",
       "homedir" : "/home/REDACTED",
       "maxaddon" : 0,
       "maxlst" : "0",
       "locale" : "en",
       "maxpop" : "0",
       "maxsql" : "0",
       "cpmod" : "paper_lantern",
       "uid" : "",
       "forcedns" : 1,
       "useregns" : 0,
       "maxpark" : 0
    }
     
    #1 jleckie, May 4, 2016
    Last edited: May 4, 2016
  2. jleckie

    jleckie Member

    Joined:
    Feb 4, 2016
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Midwest
    cPanel Access Level:
    Root Administrator
    So this was kludgy but it worked. /usr/local/cpanel/logs/error_log complained loudly though.

    The response from the Packages::changepackage API request:

    Code:
    {
        "metadata": {
            "reason": "Account Upgrade/Downgrade Complete for REDACTED",
            "command": "changepackage",
            "result": 1,
            "output": {
                "raw": "<pre>\nChanging the account bandwidth limit from “unlimited” to “unlimited”.\nChanging Feature List to default\nChanging the maximum email accounts from “0” to “5”.\nChanging the maximum SQL databases from “0” to “5”.\nChanging the maximum FTP accounts from “0” to “5”.\nChanging the maximum mailing lists from “0” to “5”.\nChanging the maximum subdomains from “0” to “5”.\nChanging \"Maximum Hourly Email by Domain Relayed\" from unlimited to unlimited\nChanging \"Maximum percentage of failed or deferred messages a domain may send per hour\" from unlimited to unlimited\nChanging the maximum parked domains from “0” to “0”.\nChanging the maximum addon domains from “0” to “0”.\nShell Access Set Correctly (noshell)\nChanging cPanel theme from paper_lantern to paper_lantern\nChanging plan from Standard to Standard\nSetting quota to “250”.\nFilesystem quotas are not enabled. The “REDACTED” user does not require any changes.\nBandwidth limit (unlimited) is lower than (unlimited) (all limits removed)<br /><blockquote><div style='float:left;'>Enabling...</div><div style='float:left;'>...REDACTED.com...</div><div style='float:left;'>Done</div></blockquote><br /><div class='clearit' style='clear:both; width:80%;'>&nbsp;</div><span class=\"b2\">Warning, this will not change shared IP accounts to dedicated IP accounts, or the reverse.</span>\n<span class=\"b2\">Warning: Changing a user’s package does not affect their Digest Authentication settings.</span>\n"
            },
            "version": 1
        }
    }
    The feedback:

    Code:
    [2016-05-04 17:09:52 -0500] warn [mysql] There is no such grant defined for user 'REDACTED' on host 'localhost' at /usr/local/cpanel/Cpanel/Mysql.pm line 1851.
      Cpanel::Mysql::_password_hashes(Cpanel::Mysql=HASH(0x2c4a8a0), ARRAY(0xdbb658)) called at /usr/local/cpanel/Cpanel/Mysql.pm line 740
      Cpanel::Mysql::updateprivs(Cpanel::Mysql=HASH(0x2c4a8a0), "REDACTED_wordpress") called at /usr/local/cpanel/Cpanel/Mysql.pm line 317
      Cpanel::Mysql::create_db(Cpanel::Mysql=HASH(0x2c4a8a0), "REDACTED_wordpress") called at /usr/local/cpanel/Cpanel/AdminBin/DB.pm line 89
      Cpanel::AdminBin::DB::CREATE_DATABASE(bin::admin::Cpanel::mysql=HASH(0x2f71208), "REDACTED_wordpress") called at /usr/local/cpanel/Cpanel/AdminBin/Script/Call.pm line 122
      Cpanel::AdminBin::Script::Call::_dispatch_method(bin::admin::Cpanel::mysql=HASH(0x2f71208)) called at /usr/local/cpanel/Cpanel/AdminBin/Script.pm line 161
      Cpanel::AdminBin::Script::new("bin::admin::Cpanel::mysql", "alarm", 120) called at /usr/local/cpanel/Cpanel/AdminBin/Script.pm line 74
      Cpanel::AdminBin::Script::run("bin::admin::Cpanel::mysql", "alarm", 120) called at bin/admin/Cpanel/mysql.pl line 21
    
    [2016-05-04 17:09:52 -0500] warn [mysql] There is no such grant defined for user 'REDACTED' on host 'localhost' at /usr/local/cpanel/Cpanel/DBAdmin.pm line 166.
      Cpanel::DBAdmin::_log_error_and_output_return(Cpanel::Mysql=HASH(0x2c4a8a0), "There is no such grant defined for user 'REDACTED' on host 'lo"...) called at /usr/local/cpanel/Cpanel/DBAdmin.pm line 189
      Cpanel::DBAdmin::_log_error_and_output(Cpanel::Mysql=HASH(0x2c4a8a0), "There is no such grant defined for user 'REDACTED' on host 'lo"...) called at /usr/local/cpanel/Cpanel/Mysql.pm line 746
      Cpanel::Mysql::updateprivs(Cpanel::Mysql=HASH(0x2c4a8a0), "REDACTED_wordpress") called at /usr/local/cpanel/Cpanel/Mysql.pm line 317
      Cpanel::Mysql::create_db(Cpanel::Mysql=HASH(0x2c4a8a0), "REDACTED_wordpress") called at /usr/local/cpanel/Cpanel/AdminBin/DB.pm line 89
      Cpanel::AdminBin::DB::CREATE_DATABASE(bin::admin::Cpanel::mysql=HASH(0x2f71208), "REDACTED_wordpress") called at /usr/local/cpanel/Cpanel/AdminBin/Script/Call.pm line 122
      Cpanel::AdminBin::Script::Call::_dispatch_method(bin::admin::Cpanel::mysql=HASH(0x2f71208)) called at /usr/local/cpanel/Cpanel/AdminBin/Script.pm line 161
      Cpanel::AdminBin::Script::new("bin::admin::Cpanel::mysql", "alarm", 120) called at /usr/local/cpanel/Cpanel/AdminBin/Script.pm line 74
      Cpanel::AdminBin::Script::run("bin::admin::Cpanel::mysql", "alarm", 120) called at bin/admin/Cpanel/mysql.pl line 21
    Any ideas on how to mitigate the error messages?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Would you mind opening a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page