I developed a Ning application on my network, that worked nicely until yesterday.

Unfortunately, today I received a couple of times the following error message, from a simple call to the Ning API:

{"success":false,"reason":"An unexpected ClientException (ning.xauth.client.exceptions.ClientException) occurred: Unknown IO exception occurred","status":500,"code":1,"subcode":0,"trace":"7f356a60-8ff4-47c2-8cf8-a82e93e4384e"}

Anyone knows what exactly is a ning.xauth.client.exceptions.ClientException and what may be the cause of it?

What is particularly puzzling is the mention to an "IO exception".

On the online documentation, here on Build, I found the following information for status: 500, code: 1 and subcode: 0:

Authorization Internal error 500 Internal Server Error 1 0

but its meaning is not very clear to me.

The error was caused by the following call:

$risultato = ningapi_get('User?'.$utenti.'fields=fullName,url,iconUrl');

where ningapi_get is defined as follows

function ningapi_get($resource, $obj_fmt = true,
    $TOKEN = TOKEN_NC, $TOKEN_SECRET = TOKEN_SECRET_NC,
    $NING_NETWORK = NING_NETWORK, $CONSUMER_KEY = CONSUMER_KEY, $CONSUMER_SECRET = CONSUMER_SECRET) {

    $curl = curl_init("https://external.ningapis.com/xn/rest/" . $NING_NETWORK . "/1.0/$resource" . ($obj_fmt ? '' : '&xn_pretty=true'));
    $header = 'Authorization: OAuth ';
    $header .= 'oauth_consumer_key="' . $CONSUMER_KEY . '",';
    $header .= 'oauth_token="' . $TOKEN . '",';
    $header .= 'oauth_signature="' . $CONSUMER_SECRET . '%26' . $TOKEN_SECRET . '",';
    $header .= 'oauth_signature_method="PLAINTEXT",oauth_version="1.0"';
    curl_setopt($curl, CURLOPT_HTTPHEADER, array($header));
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $r = curl_exec($curl);
    curl_close($curl);
    return $obj_fmt ? json_decode($r) : '<pre>' . ($r) . '</pre>';
}

In the end, it's just a simple CURL call to the "User" resource, with a number of "author=" params.

Thanks in advance to anyone that can help!

 

 

Views: 748

Reply to This

Replies to This Discussion

That's an internal error on our side (our API code talking to our OAuth code).  If you're still seeing this error, please reply here with an updated error message.  I've checked in our logs and don't see any of these in the last 30 days, so hopefully this has gone away.

Hi Phil,

I checked my logs: last occurence was on Dec 6th, 2012.

Thank you for asking.

Franco



Phillip Pearson said:

That's an internal error on our side (our API code talking to our OAuth code).  If you're still seeing this error, please reply here with an updated error message.  I've checked in our logs and don't see any of these in the last 30 days, so hopefully this has gone away.

Hmm.  Looking at the logs from December, we had a ton of these errors on Dec 2-3, and a few more from Dec 4-6.  I remember hearing mention of an internal outage of the authentication server a while back; that's probably the culprit here.  The good news is that this doesn't appear to be an ongoing thing.  Sorry for the trouble!

BTW I see you've written your own PHP code to call the API.  You might find it easier to use our own PHP wrapper, which uses the HMAC_SHA1 signature method and has a slightly easier interface to most functions: https://github.com/ning/ning-api-php

Reply to Discussion

RSS

Blog Posts

Getting Started

Posted by Kyle Ford on October 13, 2010 at 8:00am 3 Comments

A Note on API Pricing

Posted by Phil McCluskey on October 1, 2010 at 8:55am 0 Comments

Welcome to Build!

Posted by Kyle Ford on September 30, 2010 at 8:30pm 1 Comment

Ning Status

© 2024   Created by Build Team.   Powered by

Badges  |  Report an Issue  |  Terms of Service