jmathai / twitter-async

Twitter-async is a high performance wrapper for Twitter's OAuth API which provides parallel/asynchronous calls. Follow @apiclient for commit updates.
http://wiki.github.com/jmathai/twitter-async
Other
531 stars 124 forks source link

Issues getting auth URL in centos 5.5 #119

Open JohnnyGoods opened 13 years ago

JohnnyGoods commented 13 years ago

I just deployed a new project that I had running successfully on OS X to a Centos 5.5 server. Read connections to twitter work just fine, but I am getting an error I can't figure out when I try to get the authentication URL.

I am running the latest version, checked-out from git.

I tried to extend the timeouts with setTimeout(60,60), but that made the attempt apparently hang indefinitely.

This is output of the manager object and exception:

EpiCurlManager Object ( [key:EpiCurlManager:private] => Resource id #52 [epiCurl:EpiCurlManager:private] => EpiCurl Object ( [mc:EpiCurl:private] => Resource id #51 [msgs:EpiCurl:private] => [running:EpiCurl:private] => [execStatus:EpiCurl:private] => [selectStatus:EpiCurl:private] => [sleepIncrement:EpiCurl:private] => 1.1 [requests:EpiCurl:private] => Array ( [Resource id #52] => Resource id #52 )

        [responses:EpiCurl:private] => Array
            (
                [Resource id #52] => Array
                    (
                        [data] => 
                        [code] => 0
                        [time] => 0
                        [length] => 0
                        [type] => 
                        [url] => https://api.twitter.com/oauth/request_token
                    )

            )

        [properties:EpiCurl:private] => Array
            (
                [code] => 2097154
                [time] => 3145731
                [length] => 3145743
                [type] => 1048594
                [url] => 1048577
            )

    )

)

Fatal error: Uncaught exception 'EpiOAuthException' in /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php:435 Stack trace:

0 /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php(404): EpiOAuthException::raise(Object(EpiCurlManager), false)

1 /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php(45): EpiOAuthResponse->__get('oauth_token')

2 /ceylon/prod/app/controllers/TwitterController.php(31): EpiOAuth->getAuthenticateUrl()

3 /ceylon/prod/libraries/lithium/core/Object.php(167): app\controllers\TwitterController->login()

4 /ceylon/prod/libraries/lithium/action/Controller.php(181): lithium\core\Object->invokeMethod('login', Array)

5 /ceylon/prod/libraries/lithium/util/collection/Filters.php(202): lithium\action{closure}(Object(app\controllers\TwitterController), Array, Object(lithium\util\collection\Filters))

6 /ceylon/prod/app/controllers/BaseController.php(30): lithium\util\collection\Filters->next(Object(app\controllers\TwitterController), Array, Object(lithium\util\collection\Filters))

7 /ceylon/prod/libraries/lith in /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php on line 435

JohnnyGoods commented 13 years ago

Interestingly, I'm using the exact same EpiOAuth and EpiCurl with EpiFoursqaure on the same box, and it is able to get a request token without an issue.

jmathai commented 13 years ago

What version of PHP and curl are you running?

Also, try commenting out lines 171 and 172 in EpiOAuth.php. https://github.com/jmathai/twitter-async/blob/master/EpiOAuth.php#L171

On Wed, Jun 29, 2011 at 6:31 PM, JohnnyGoods < reply@reply.github.com>wrote:

I just deployed a new project that I had running successfully on OS X to a Centos 5.5 server. Read connections to twitter work just fine, but I am getting an error I can't figure out when I try to get the authentication URL.

I am running the latest version, checked-out from git.

I tried to extend the timeouts with setTimeout(60,60), but that made the attempt apparently hang indefinitely.

This is output of the manager object and exception:

EpiCurlManager Object ( [key:EpiCurlManager:private] => Resource id #52 [epiCurl:EpiCurlManager:private] => EpiCurl Object ( [mc:EpiCurl:private] => Resource id #51 [msgs:EpiCurl:private] => [running:EpiCurl:private] => [execStatus:EpiCurl:private] => [selectStatus:EpiCurl:private] => [sleepIncrement:EpiCurl:private] => 1.1 [requests:EpiCurl:private] => Array ( [Resource id #52] => Resource id #52 )

       [responses:EpiCurl:private] => Array
           (
               [Resource id #52] => Array
                   (
                       [data] =>
                       [code] => 0
                       [time] => 0
                       [length] => 0
                       [type] =>
                       [url] =>

https://api.twitter.com/oauth/request_token )

           )

       [properties:EpiCurl:private] => Array
           (
               [code] => 2097154
               [time] => 3145731
               [length] => 3145743
               [type] => 1048594
               [url] => 1048577
           )

   )

)

Fatal error: Uncaught exception 'EpiOAuthException' in /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php:435 Stack trace:

0 /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php(404):

EpiOAuthException::raise(Object(EpiCurlManager), false)

1 /ceylon/prod/app/libraries/epitwitter/EpiOAuth.php(45):

EpiOAuthResponse->__get('oauth_token')

2 /ceylon/prod/app/controllers/TwitterController.php(31):

EpiOAuth->getAuthenticateUrl()

3 /ceylon/prod/libraries/lithium/core/Object.php(167):

app\controllers\TwitterController->login()

4 /ceylon/prod/libraries/lithium/action/Controller.php(181):

lithium\core\Object->invokeMethod('login', Array)

5 /ceylon/prod/libraries/lithium/util/collection/Filters.php(202):

lithium\action{closure}(Object(app\controllers\TwitterController), Array, Object(lithium\util\collection\Filters))

6 /ceylon/prod/app/controllers/BaseController.php(30):

lithium\util\collection\Filters->next(Object(app\controllers\TwitterController), Array, Object(lithium\util\collection\Filters))

7 /ceylon/prod/libraries/lith in

/ceylon/prod/app/libraries/epitwitter/EpiOAuth.php on line 435

Reply to this email directly or view it on GitHub: https://github.com/jmathai/twitter-async/issues/119

immortalx commented 13 years ago

I was having the same problem and commenting those lines fixed the issue.

keogh commented 13 years ago

Thanks, I had the same issue, commeting the lines fix it.

When I used EpiOAuth in http://localhost/project there's no problem. But if I'm working in a local virtual host let's say http://project/ the issue appears, again it's solved commeting the lines 171 and 172 in EpiOAuth.php

Thanks again. Great library!

archer247 commented 12 years ago

is these lines 171 and 172? if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1') curl_setopt($ch, CURLOPT_INTERFACE, $_SERVER ['SERVER_ADDR']);