Danieliazzz Posted June 26, 2019 Report Posted June 26, 2019 Hi, I had a problem with provisioning while on cwp. After Clicking Checkout on the blesta client portal, the page becomes unresponsive and returns error 500. Upon Reviewing Blesta Logs, this is what's it is pertaining to: Upon Checking line 70, this is what it contains: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $data = $this->parseResponse(curl_exec($ch)); curl_close($ch); Specifically Line 70 is: $data = $this->parseResponse(curl_exec($ch)); Note that this is a new installation of blesta and ioncube is properly working. Using PHP 7.2 with Ioncube. Quote
0 Amit Kumar Mishra Posted June 26, 2019 Report Posted June 26, 2019 is curl to url working properly also what about the firewall? not sure, but you may check czizou 1 Quote
0 Danieliazzz Posted June 26, 2019 Author Report Posted June 26, 2019 43 minutes ago, Amit Kumar Mishra said: is curl to url working properly also what about the firewall? not sure, but you may check Curl to URL scripts seems to be working in all of other scripts i am running with this machine. Firewall is open ports for 2304 which is required for the api. Thanks Quote
0 Tyson Posted June 26, 2019 Report Posted June 26, 2019 What's in the log that indicates it is a problem with executing cURL? Typically, a 500 or cURL error is due to a server misconfiguration, like a closed port. Are ports 2030 and 2031 open? Quote
0 Amit Kumar Mishra Posted June 26, 2019 Report Posted June 26, 2019 thats what i pointed out the firewall may be blocking the ports czizou 1 Quote
0 Danieliazzz Posted June 27, 2019 Author Report Posted June 27, 2019 9 hours ago, Tyson said: What's in the log that indicates it is a problem with executing cURL? Typically, a 500 or cURL error is due to a server misconfiguration, like a closed port. Are ports 2030 and 2031 open? Hi, 2031, and 2030 is open because without port 2031 i cannot access the admin panel. Also in a new update 2304 is the one used in API Commands. Maybe cwp itself is blocking the command due to that a different port is used? I'll try to modify the port in the cwp modules to check and see. Quote
0 Mr Genius Posted June 27, 2019 Report Posted June 27, 2019 did modifying the port work fine for you? Quote
0 Danieliazzz Posted June 30, 2019 Author Report Posted June 30, 2019 On 6/27/2019 at 11:59 AM, Mr Genius said: did modifying the port work fine for you? It did not, upon looking at the CWP Module for Blesta included with the latest version. It is clearly different to what is currently implemented. /home/webytely/public_html/dashboard/components/modules/centoswebpanel/apis/centoswebpanel_api.php public function apiRequest($function, array $params = []) { // Set api url $protocol = ($this->use_ssl ? 'https' : 'http'); $port = ($this->use_ssl ? '2031' : '2030'); $url = $protocol . '://' . $this->hostname . ':' . $port . '/api/?key=' . $this->key . '&api=' . $function . '&' . http_build_query($params); // Send request $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $data = $this->parseResponse(curl_exec($ch)); curl_close($ch); return $data; } And what CWP Provided as an Example: $data = array(“key” => “MYKEY”,”action”=>’add’, ”domain”=>’MY_DOMAIN’, ”user”=>’USER’, ”pass”=>’PASSWORD’, ”email”=>’email@account’, ”package”=>’PACKAGE_NAME’, ”inode”=>’0’,”limit_nproc”=>’40’,”limit_nofile”=>’0’,”server_ips”=>’MY_IP_SERVER’); $url = “https://IPSERVERAPI:2304/v1/account”; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt ($ch, CURLOPT_POST, 1); $response = curl_exec($ch); curl_close($ch); Based on the new revisions provided here: https://docs.control-webpanel.com/docs/developer-tools/api-manager/functions/function-api-account/add So Essentially, this made the Error 500 problem since the server isnt responding due to a wrong api method being used. Not even using port 2304 on the latest blesta update. Can we get this bumped to a developer at blesta to take a look. Thanks czizou 1 Quote
0 Amit Kumar Mishra Posted July 1, 2019 Report Posted July 1, 2019 @Tyson @Paul @Jono or other blesta devs/team Quote
0 Jono Posted July 1, 2019 Report Posted July 1, 2019 Yea this module was built a couple years ago. I believe at that time they were still in the process of developing their current API. You can see that the endpoint structure is completely different between the examples, so the module must be working off of an old API. I'll go ahead and create a task to look into updating the module to use the new API. CORE-3217 Amit Kumar Mishra 1 Quote
0 Mr Genius Posted July 19, 2019 Report Posted July 19, 2019 Hello, i had asked @Paul if blesta supported the new API version of CWP. he mentioned it does. Could you kindly fast track the process and see if its an up to date version. Quote
Question
Danieliazzz
Hi,
I had a problem with provisioning while on cwp. After Clicking Checkout on the blesta client portal, the page becomes unresponsive and returns error 500.
Upon Reviewing Blesta Logs, this is what's it is pertaining to:
Upon Checking line 70, this is what it contains:
Specifically Line 70 is: $data = $this->parseResponse(curl_exec($ch));
Note that this is a new installation of blesta and ioncube is properly working.
Using PHP 7.2 with Ioncube.
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.