LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > 503 Error when using 3scale PHP Libraries

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2012, 07:47 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default 503 Error when using 3scale PHP Libraries

Using the libraries for 3scale here: https://github.com/3scale/3scale_ws_api_for_php

On Litespeed Web Server Standard v4.1.13, I'm getting a 503 Error when I try to use the libraries. Specifically when I run:

$response = $client->authorize($app_id_one, $app_key_one);

Here is the definition:

/**
* Authorize an application.
*
* @param $appId application id.
* @param $appKey secret application key.
* @param $serviceId service id, only required in the case of multiple services
*
* @return ThreeScaleResponse object containing additional authorization information.
* If both provider key and application id are valid, the returned object is actually
* @see ThreeScaleAuthorizeResponse (which is derived from ThreeScaleResponse) and
* contains additional information about the usage status.
*
* @see ThreeScaleResponse
* @see ThreeScaleAuthorizeResponse
*
* @throws ThreeScaleServerError in case of unexpected internal server error
*
* Example:
*
* <code>
* <?php
* $response = $client->authorize('app-id', 'app-key');
* // or $response = $client->authorize('app-id', 'app-key', 'service_id');
*
* if ($response->isSuccess()) {
* // ok.
* } else {
* // something is wrong.
* }
* ?>
* </code>
*/
public function authorize($appId, $appKey = null, $serviceId = null) {
$url = "http://" . $this->getHost() . "/transactions/authorize.xml";
$params = array('provider_key' => $this->getProviderKey(), 'app_id' => $appId);

if ($appKey) {
$params['app_key'] = $appKey;
}

if ($serviceId) {
$params['service_id'] = $serviceId;
}

$httpResponse = $this->httpClient->get($url, $params);

if (self::isHttpSuccess($httpResponse)) {
return $this->buildAuthorizeResponse($httpResponse->body);
} else {
return $this->processError($httpResponse);
}
}


Log export in next post! Please help! Thanks in advance!

m3dia
Reply With Quote
  #2  
Old 08-15-2012, 07:48 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Log Export 1

Here is my log export:

2012-08-16 01:09:07.537 [NOTICE] [10.122.205.242:53275-0#Example] Content len: 0, Request line: 'GET /api/v1/data/index.php?c=get.customer.distinct.contentprovider& cmcustlocid=1446&appid=4579e681&appkey=c83e559ee2b 2c4a8acb48eae0db5e744 HTTP/1.1'
[ec2-user@ip-10-90-129-117 logs]$ tail error.log -n 100
2012-08-16 00:35:55.347 [INFO] [10.122.205.242:58905-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
.....
2012-08-16 00:40:10.919 [INFO] [10.122.205.242:41914-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!

Last edited by NiteWave; 08-15-2012 at 09:36 PM..
Reply With Quote
  #3  
Old 08-15-2012, 07:49 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Log Export 2

2012-08-16 00:40:11.661 [INFO] [10.122.205.242:42003-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
...
2012-08-16 00:53:19.305 [INFO] [10.122.205.242:48406-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!

Last edited by NiteWave; 08-15-2012 at 09:37 PM..
Reply With Quote
  #4  
Old 08-15-2012, 07:50 PM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Log Export 3

2012-08-16 00:53:25.594 [INFO] [10.122.205.242:49006-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
...
2012-08-16 01:06:22.104 [INFO] [10.122.205.242:24096-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.531 [INFO] [10.122.205.242:53275-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #84, confirmed, 1, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.534 [INFO] [10.122.205.242:53275-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #272, confirmed, 1, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.537 [INFO] [10.122.205.242:53275-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #163, confirmed, 1, associated process: 11498, running: 1, error: Connection reset by peer!
2012-08-16 01:09:07.537 [NOTICE] [10.122.205.242:53275-0#Example] Max retries has been reached, 503!
2012-08-16 01:09:07.537 [NOTICE] [10.122.205.242:53275-0#Example] oops! 503 Service Unavailable

Last edited by NiteWave; 08-15-2012 at 09:38 PM..
Reply With Quote
  #5  
Old 08-15-2012, 09:46 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,293
I removed many lines of error logs, they are same pattern like:
Code:
2012-08-16 01:06:22.104 [INFO] [10.122.205.242:24096-0#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #500, confirmed, 0, associated process: 11498, running: 1, error: Connection reset by peer!
it's [INFO], not error.

please refer:
https://store.litespeedtech.com/stor...yarticle&id=31

to check if your 503 can be fixed by this guide.
Reply With Quote
  #6  
Old 08-16-2012, 07:05 AM
m3dia m3dia is offline
Member
 
Join Date: Aug 2012
Posts: 13
Default Checking the guide now

I'm checking the guide link provided now. One more thing to notice, while it fails on the PHP I've compiled specifically for Litespeed:

PHP 5.4.5
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysqli' '--with-mysql' '--with-zlib' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-mcrypt' '--with-litespeed' '--enable-memcache' '--with-curl' '--with-libdir=/lib64' '--with-soap' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'

It works on the PHP version I have locally installed on my machine, when called from the command line:

[ec2-user@ip-10-90-129-117 ~]$ php -v
PHP Warning: PHP Startup: apc.shm_segments setting ignored in MMAP mode in Unknown on line 0
PHP 5.3.15 (cli) (built: Jul 20 2012 23:10:20)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Reply With Quote
Reply

Tags
503, bug, error, http 503

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:41 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.