Getting App Authentication errors today, wasn't yesterday
AnsweredHi guys,
I am using PHP API with App Authentication. I have linked to several apps and all has been working great the last few weeks. Now suddenly today I get errors about 40-50% of the time I try to authenticate:
object(PodioError)#6 (11) { ["body"]=> NULL ["status"]=> int(0) ["url"]=> string(12) "/oauth/token" ["message":protected]=> string(0) "" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(43) "/var/www/html/v1/podio/api/lib/PodioAPI.php" ["line":protected]=> int(251) ["trace":"Exception":private]=> array(4) { [0]=> array(6) { ["file"]=> string(43) "/var/www/html/v1/podio/api/lib/PodioAPI.php" ["line"]=> int(72) ["function"]=> string(7) "request" ["class"]=> string(5) "Podio" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> string(4) "POST" [1]=> string(12) "/oauth/token" [2]=> array(5) { ["client_id"]=> string(13) "MYSUPERSERCRETUSER" ["client_secret"]=> string(64) "MYSUPERSECRETSECRET" ["grant_type"]=> string(3) "app" ["app_id"]=> string(7) "4080656" ["app_token"]=> string(32) "THISISMYACTUALAPPTOKEN" } [3]=> array(1) { ["oauth_request"]=> bool(true) } } } [1]=> array(6) { ["file"]=> string(47) "/var/www/html/v1/classes/podiowrapper.class.php" ["line"]=> int(51) ["function"]=> string(12) "authenticate" ["class"]=> string(5) "Podio" ["type"]=> string(2) "::" ["args"]=> array(2) { [0]=> string(3) "app" [1]=> array(2) { ["app_id"]=> string(7) "4080656" ["app_token"]=> string(32) "THISISMYACTUALAPPTOKEN" } } } [2]=> array(6) { ["file"]=> string(31) "/var/www/html/v1/_functions.php" ["line"]=> int(772) ["function"]=> string(11) "auth_as_app" ["class"]=> string(12) "PodioWrapper" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> &string(4) "News" } } [3]=> array(4) { ["file"]=> string(35) "/var/www/html/v1/telephones-etc.php" ["line"]=> int(37) ["function"]=> string(9) "get_posts" ["args"]=> array(0) { } } } ["previous":"Exception":private]=> NULL ["request"]=> NULL }
I don't see any other mention of system status being flaky or any other complaints. Is it just me? Why would App Auth fail? I can't be over rate limit at this point, so I'm clueless as to what might cause it.
-
Hi Andreas, thanks for taking a peek. I don't find the stack trace perticularly useful but maybe you will:
#0 /var/www/html/v1/podio/api/lib/PodioAPI.php(72): Podio::request('POST', '/oauth/token', Array, Array)\n#1 /var/www/html/v1/classes/podiowrapper.class.php(19): Podio::authenticate('app', Array)\n#2 /var/www/html/v1/_functions.php(721): PodioWrapper->auth_as_app('4013491', '85aef78ead9047d...')\n#3 /var/www/html/v1/_functions.php(709): get_employees()\n#4 /var/www/html/v1/contact.php(39): contact_us()\n#5 {main}
The weird thing is if I test locally on my laptop when I code, it works 99% of the time. But on the beta server since yesterday I'm getting failures at least 50% of the time. The auth simply fails without an error message. I thought at first it might be related to some UI changes to Podio that seemed to coincide but I wouldn't be the only one having the problem...
-
Ok well I think I've tracked down the issue...
This is the curl object just after the request in lib/PodioAPI.php :
array(21) { ["url"]=> string(37) "https://api.podio.com:443/oauth/token" ["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0) ["request_size"]=> int(0) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(0) ["namelookup_time"]=> float(0) ["connect_time"]=> float(0) ["pretransfer_time"]=> float(0) ["size_upload"]=> float(0) ["size_download"]=> float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(-1) ["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["certinfo"]=> array(0) { } }
So it's not getting a reply. I tried to ping api.podio.com and it works, but when I tried wget https://api.podio.com:443/oauth/token, then I get this:
wget https://api.podio.com:443/oauth/token
--2013-04-25 14:32:53-- https://api.podio.com/oauth/token
Resolving api.podio.com... failed: Name or service not known.
wget: unable to resolve host address `api.podio.com'I will fix that and post back but I'm sure it's on my side now :)
Thanks,
-
Happy you found the cause. :)
I've added an issue here to see if I can't get some more informative error messages to show up when the requests fail in spectacular ways: https://github.com/podio/podio-php/issues/18
/Andreas
-
I'm not sure about it, but maybe my issue (https://github.com/podio/podio-php/issues/24) is related to this one?
Please sign in to leave a comment.
Comments
6 comments