Error trying to use Whost::XMLUI::cPanel::cpanel_exec

mkly

Registered
Mar 12, 2014
1
0
1
cPanel Access Level
Root Administrator
In post Accounts::Create hook I have this code where $user is the user just created and $dbname is just a test name at this point
Code:
        Whostmgr::XMLUI::cPanel::cpanel_exec({
                        'cpanel_xmlapi_module' => 'Mysql',
                        'cpanel_xmlapi_func' => 'adddb',
                        'cpanel_xmlapi_apiversion' => 1,
                        'cpanel_xmlapi_user' => $user,
                        'arg-0' => $dbname
                },
                undef,
                1
        );

        Whostmgr::XMLUI::cPanel::cpanel_exec({
                        'cpanel_xmlapi_module' => 'Mysql',
                        'cpanel_xmlapi_func' => 'adduser',
                        'cpanel_xmlapi_apiversion' => 1,
                        'cpanel_xmlapi_user' => $user,
                        'arg-0' => $dbuser,
                        'arg-1' => 's3crEt!'
                },
                undef,
                1
        );
Results in the database being created but the database user not being created

Code:
[2014-03-15 19:00:39 -0400] info [cpmysql] Creating MySQL virtual user t2user_tdb for user t2user
[2014-03-15 19:00:39 -0400] warn [servers_queue] Cannot queue task mysqluserstore ( no id, probably a duplicate ) at /usr/local/cpanel/Cpanel/LoggerAdapter.pm line 26
	Cpanel::LoggerAdapter::warn(Cpanel::LoggerAdapter=HASH(0x1e64580), 'Cannot queue task mysqluserstore ( no id, probably a duplicate )') called at /usr/local/cpanel/bin/servers_queue line 90
	main::queue_tasks('mysqluserstore') called at /usr/local/cpanel/bin/servers_queue line 75
The part that seems strange is that main::queue_tasks() does not appear to be getting the arg-0 and arg-1 parameters I'm passing into the second cpanel_exec.

Any ideas?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello :)

Feel free to submit this as a bug report so we can attempt to reproduce the issue and verify if it's a flaw with the API:

Submit A Bug Report

Post the ticket number here and we can update this thread with the outcome.

Thank you.