Doctrine Posted March 10, 2018 Report Posted March 10, 2018 Hello Got this error: An internal error occurred, or the server did not respond to the request. Latest directadmin, latest Blesta, packages created without any problem, i could check the user package, server IP. But i cannot suspend users for example. Seems everything is configured correctly. Input: Quote s1.servername.eu|suspendUser s:5:"username"; Here is the output from the module: Quote s1.servername.eu a:1:{s:42:"<html> ____<head> ________<meta_http-equiv";s:1094:""Content-Type" content="text/html; charset=utf-8;"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>DirectAdmin Login</title> <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" /> <meta name="robots" content="noindex,nofollow" /> <script> var tokens = { LOST_PASSWORD: "no" === "yes", TIME: { current: 1520711641 * 1000, offset: 172800 * 1000, }, }; </script> </head> <body> <!-- Vue root --> <div id="login"></div> <div id="foot" style="display:none;"> <script type="text/javascript" src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default-3.4"></script> <script type="text/javascript" src="/assets/vendors.js?ver=|SKIN_VERSION|"></script> <script type="text/javascript" src="/assets/login.js?ver=|SKIN_VERSION|"></script> </div> </body> </html> Any suggestion? I use the default Directadmin Theme... Got this issue on multiple server.. on multiple company.
timnboys Posted March 13, 2018 Report Posted March 13, 2018 On 3/10/2018 at 3:57 PM, Doctrine said: Hello Got this error: An internal error occurred, or the server did not respond to the request. Latest directadmin, latest Blesta, packages created without any problem, i could check the user package, server IP. But i cannot suspend users for example. Seems everything is configured correctly. Input: Here is the output from the module: Any suggestion? I use the default Directadmin Theme... Got this issue on multiple server.. on multiple company. looks like a api issue, possibly just needs to be patched to support any newer api directadmin is using maybe? since usually api's aren't supposed to output html like that. I can try patching it for you and post it here for you, though do note I don't use directadmin and therefore won't be able to test it for you, since at best would be following directadmin's api guides and hope it works. after further investigation it looks like it isn't logging into directadmin api as seen by this header? <title>DirectAdmin Login</title>
Blesta Addons Posted March 13, 2018 Report Posted March 13, 2018 normally the API should not return a html page contents, it should return only response in json or xml format .
timnboys Posted March 14, 2018 Report Posted March 14, 2018 1 hour ago, Blesta Addons said: normally the API should not return a html page contents, it should return only response in json or xml format . that is what I was getting at.
Tyson Posted March 14, 2018 Report Posted March 14, 2018 If you haven't resolved this issue yet, you may want to contact DirectAdmin support for help. The module POSTs a suspension via the API command CMD_API_SELECT_USERS, with a location set to CMD_SELECT_USERS. Normally, this would suspend the user in DirectAdmin and respond back to Blesta that there was no error performing this action, however, the DirectAdmin API returned an invalid HTML response that is not expected for that end point, which leads me to believe that the DirectAdmin API or or its configuration has gone awry. Michael 1
timnboys Posted March 14, 2018 Report Posted March 14, 2018 On 3/14/2018 at 2:28 PM, Tyson said: If you haven't resolved this issue yet, you may want to contact DirectAdmin support for help. The module POSTs a suspension via the API command CMD_API_SELECT_USERS, with a location set to CMD_SELECT_USERS. Normally, this would suspend the user in DirectAdmin and respond back to Blesta that there was no error performing this action, however, the DirectAdmin API returned an invalid HTML response that is not expected for that end point, which leads me to believe that the DirectAdmin API or or its configuration has gone awry. read the below, it shows why that isn't the correct command.
Doctrine Posted March 17, 2018 Author Report Posted March 17, 2018 On 2018. 03. 14. at 7:28 PM, Tyson said: If you haven't resolved this issue yet, you may want to contact DirectAdmin support for help. The module POSTs a suspension via the API command CMD_API_SELECT_USERS, with a location set to CMD_SELECT_USERS. Normally, this would suspend the user in DirectAdmin and respond back to Blesta that there was no error performing this action, however, the DirectAdmin API returned an invalid HTML response that is not expected for that end point, which leads me to believe that the DirectAdmin API or or its configuration has gone awry. User creation is working without any problem. Strange thing
timnboys Posted March 17, 2018 Report Posted March 17, 2018 6 hours ago, Doctrine said: User creation is working without any problem. Strange thing I fixed the bug by doing this in direct_admin_api.php: 'suspendUser' => array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Suspend','location'=>'CMD_API_SELECT_USERS')), 'unsuspendUser' => array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Unsuspend','location'=>'CMD_API_SELECT_USERS')), from: 'suspendUser' => array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Suspend','location'=>'CMD_SELECT_USERS')), 'unsuspendUser' => array('POST','','CMD_API_SELECT_USERS',array('suspend'=>'Unsuspend','location'=>'CMD_SELECT_USERS')), that was likely a oversight on the blesta dev's part but is actually easily to fix as shown above, since directadmin's api information here: http://www.directadmin.com/features.php?id=807 states the default CMD_SELECT_USERS will not return the standard json api response like the module is expecting, CMD_API_SELECT_USERS does return the standard json api response and therefore it works finally, tried to find the module on github to submit a pull request to apply this patch to module but didn't find it so thought would just post it here instead. thanks to @Doctrine for providing the directadmin panel to patch the issue and make sure it works. information redacted for security reasons. Tyson and Blesta Addons 1 1
Tyson Posted June 22, 2018 Report Posted June 22, 2018 This is updated in v4.3.0 as apart of CORE-2637.
Recommended Posts