Control Web Panel
WebPanel => CentOS 7 Problems => Topic started by: xotabu4 on April 20, 2018, 09:37:44 AM
-
Hi everyone,
I've installed fresh version of the CWP 7, added new CWP7 module to WHMCS and while trying to create account from WHMCS in CWP panel getting error. After turning on Debug in WHMCS, I've got such error:
<html><head><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>The application could not run because of the following error:</p><h2>Details</h2><div><strong>Type:</strong> ErrorException</div><div><strong>Code:</strong> 2</div><div><strong>Message:</strong> mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given</div><div><strong>File:</strong> /usr/local/cwpsrv/var/services/api/v1/index.php</div><h2>Trace</h2><pre><div>#0 [internal function]: Slim\Slim::handleErrors(2, 'mysqli_fetch_as...', '/usr/local/cwps...', 0, Array)
<div>#1 /usr/local/cwpsrv/var/services/api/v1/index.php(0): mysqli_fetch_assoc(false)
<div>#2 [internal function]: {closure}()
<div>#3 /usr/local/cwpsrv/var/services/api/v1/Slim/Route.php(0): call_user_func_array(Object(Closure), Array)
<div>#4 /usr/local/cwpsrv/var/services/api/v1/Slim/Slim.php(0): Slim\Route->dispatch()
<div>#5 /usr/local/cwpsrv/var/services/api/v1/Slim/Middleware/Flash.php(0): Slim\Slim->call()
<div>#6 /usr/local/cwpsrv/var/services/api/v1/Slim/Middleware/MethodOverride.php(0): Slim\Middleware\Flash->call()
<div>#7 /usr/local/cwpsrv/var/services/api/v1/Slim/Middleware/PrettyExceptions.php(0): Slim\Middleware\MethodOverride->call()
<div>#8 /usr/local/cwpsrv/var/services/api/v1/Slim/Slim.php(0): Slim\Middleware\PrettyExceptions->call()
<div>#9 /usr/local/cwpsrv/var/services/api/v1/index.php(0): Slim\Slim->run()
<div>#10 {main}</pre></body></html>
-
and what happens if you use any other option (Change password, Suspend, etc)
-
I'm having my CWP (brand new instance) server call a PHP script, which hits the API, and I have the exact same issue as the OP when trying to create a new account. If I change the action to 'list', instead of 'add', I get
{"status":"OK","msj":"no records exist"}
, which is correct.
-
and what happens if you use any other option (Change password, Suspend, etc)
When I execute an API call to change a password, it works just fine:
{"status":"OK"}
I tested it, and the new password must be used, in order to log in with the user.
It looks like there's an issue with the Add Account web service.
-
The action to add a new user account partially completes, because if you run a second identical request, you receive this the second time:
{"status":"Error","msj":"already exists in \/etc\/passwd!"}
-
I figured out why I was receiving this error. I was sending "default" as the value for the package key. When I changed it to "1", the request worked. I believe the correct value for this field should correspond to HTML value of the Option element in the drop-down, not the text of the element.
Hopefully this helps someone else.