0

Server Hangup

Hi, guys,

I'm trying to make the python-yql library work with YQL INSERT operation, but the server is returning me the following data:

CODE
{'status': '502', 'content-length': '198', 'content-language': 'en', 'server': 'YTS/1.17.21', 'connection': 'keep-alive', 'cache-control': 'no-store', 'date': 'Tue, 23 Mar 2010 03:15:47 GMT', 'content-type': 'text/html'}, '<HE
AD><TITLE>Server Hangup</TITLE></HEAD>\n<BODY BGCOLOR="white" FGCOLOR="black">\n<FONT FACE="Helvetica,Arial"><B>\n Server Hangup</B></FONT>\n\n<!-- default "Server Hangup" response (502) -->\n</BODY>\n\x00'


Can anybody help me? Why a "Server Hangup" and a HTTP STATUS 502 as a response? I think YQL applications could be easier to debug if there was more information on these error responses... :-(

Thanks!

by
3 Replies
  • QUOTE (Diogo @ Mar 22 2010, 07:33 PM) <{POST_SNAPBACK}>
    Hi, guys,

    I'm trying to make the python-yql library work with YQL INSERT operation, but the server is returning me the following data:

    CODE
    {'status': '502', 'content-length': '198', 'content-language': 'en', 'server': 'YTS/1.17.21', 'connection': 'keep-alive', 'cache-control': 'no-store', 'date': 'Tue, 23 Mar 2010 03:15:47 GMT', 'content-type': 'text/html'}, '<HE
    AD><TITLE>Server Hangup</TITLE></HEAD>\n<BODY BGCOLOR="white" FGCOLOR="black">\n<FONT FACE="Helvetica,Arial"><B>\n Server Hangup</B></FONT>\n\n<!-- default "Server Hangup" response (502) -->\n</BODY>\n\x00'


    Can anybody help me? Why a "Server Hangup" and a HTTP STATUS 502 as a response? I think YQL applications could be easier to debug if there was more information on these error responses... :-(

    Thanks!


    That's not an error thrown by YQL but something in our infrastructure (and Ive never seen it before). Can you get this error consistently? If so it would be great to see the raw request you are making from the python lib to enable us to dig into it some more.

    Thanks
    Jonathan
    0
  • QUOTE (Jonathan @ Mar 23 2010, 07:32 AM) <{POST_SNAPBACK}>
    That's not an error thrown by YQL but something in our infrastructure (and Ive never seen it before). Can you get this error consistently? If so it would be great to see the raw request you are making from the python lib to enable us to dig into it some more.

    Thanks
    Jonathan


    Hi there, Jonathan! Sorry I didn't see your reply before, it's strange because I subscribed to this thread... :-(

    Well, here are two examples of scripts using two different libraries, but both getting the same error ("Server Hangup").

    First, using my fork of python-yql (I had to give POST method support):

    CODE
    #!/usr/bin/env python

    import yql

    SECRET = '9b3274b2308c6f060bdfdb56c20499e9accafcb9'
    API_KEY = 'dj0yJmk9c0FpSVQ0U0RwMlRUJmQ9WVdrOVRGbGpVMk5QTmpRbWNHbzlPREEwTWpNMU5qSS0mcz1j
    b25zdW1lcnNlY3JldCZ4PTky'

    y3 = yql.ThreeLegged(API_KEY, SECRET)

    query = 'insert into meme.user.posts (type, content) values ("text", "teste com #pythonyql")'
    request_token, auth_url = y3.get_token_and_auth_url()

    verifier = raw_input("Code for %s :" % auth_url)

    access_token = y3.get_access_token(request_token, verifier)
    y3.execute(query, token=access_token)


    Now, using yos-social-python:

    CODE
    #!/usr/bin/env python

    import yahoo.application
    import yahoo.yql
    import pprint

    CONSUMER_KEY = 'dj0yJmk9ZGhRZUlieFlhVUVjJmQ9WVdrOVUyWmFhMUZwTm0wbWNHbzlNVEkwTVRNeE56WXkmcz1j
    b25zdW1lcnNlY3JldCZ4PWY2'
    CONSUMER_SECRET = 'cae45c49de9e9185a77010c2f379934dd88811ec'
    APPLICATION_ID = 'SfZkQi6m'
    CALLBACK_URL = None

    query = 'INSERT INTO meme.user.posts (type, content) VALUES ("text", "teste com #yos-social-python")'
    yql = yahoo.yql.YQLQuery()

    oauthapp = yahoo.application.OAuthApplication(CONSUMER_KEY, CONSUMER_SECRET, APPLICATION_ID, CALLBACK_URL)

    request_token = oauthapp.get_request_token(CALLBACK_URL)

    redirect_url = oauthapp.get_authorization_url(request_token)

    print "Please follow this url to get the verification code:"
    print redirect_url

    verifier = raw_input("Please enter the verification code:")

    access_token = oauthapp.get_access_token(request_token, verifier.strip())

    oauthapp.token = access_token

    pprint.PrettyPrinter(indent=4).pprint(yql.execute(query, token=access_token))


    Thanks a lot for the help! :-)

    Cheers,

    Diogo
    0
  • QUOTE (Diogo @ Apr 30 2010, 08:48 PM) <{POST_SNAPBACK}>
    Hi there, Jonathan! Sorry I didn't see your reply before, it's strange because I subscribed to this thread... :-(

    Well, here are two examples of scripts using two different libraries, but both getting the same error ("Server Hangup").

    First, using my fork of python-yql (I had to give POST method support):

    CODE
    #!/usr/bin/env python

    import yql

    SECRET = '9b3274b2308c6f060bdfdb56c20499e9accafcb9'
    API_KEY = 'dj0yJmk9c0FpSVQ0U0RwMlRUJmQ9WVdrOVRGbGpVMk5QTmpRbWNHbzlPREEwTWpNMU5qSS0mcz1j
    b25zdW1lcnNlY3JldCZ4PTky'

    y3 = yql.ThreeLegged(API_KEY, SECRET)

    query = 'insert into meme.user.posts (type, content) values ("text", "teste com #pythonyql")'
    request_token, auth_url = y3.get_token_and_auth_url()

    verifier = raw_input("Code for %s :" % auth_url)

    access_token = y3.get_access_token(request_token, verifier)
    y3.execute(query, token=access_token)


    Now, using yos-social-python:

    CODE
    #!/usr/bin/env python

    import yahoo.application
    import yahoo.yql
    import pprint

    CONSUMER_KEY = 'dj0yJmk9ZGhRZUlieFlhVUVjJmQ9WVdrOVUyWmFhMUZwTm0wbWNHbzlNVEkwTVRNeE56WXkmcz1j
    b25zdW1lcnNlY3JldCZ4PWY2'
    CONSUMER_SECRET = 'cae45c49de9e9185a77010c2f379934dd88811ec'
    APPLICATION_ID = 'SfZkQi6m'
    CALLBACK_URL = None

    query = 'INSERT INTO meme.user.posts (type, content) VALUES ("text", "teste com #yos-social-python")'
    yql = yahoo.yql.YQLQuery()

    oauthapp = yahoo.application.OAuthApplication(CONSUMER_KEY, CONSUMER_SECRET, APPLICATION_ID, CALLBACK_URL)

    request_token = oauthapp.get_request_token(CALLBACK_URL)

    redirect_url = oauthapp.get_authorization_url(request_token)

    print "Please follow this url to get the verification code:"
    print redirect_url

    verifier = raw_input("Please enter the verification code:")

    access_token = oauthapp.get_access_token(request_token, verifier.strip())

    oauthapp.token = access_token

    pprint.PrettyPrinter(indent=4).pprint(yql.execute(query, token=access_token))


    Thanks a lot for the help! :-)

    Cheers,

    Diogo


    Bounce (still same problem. Can't post anything to the Meme table, yet.)
    0

Recent Posts

in YQL