astrometry / usermanual

Help for Astrometry.net: Issue tracking and the Missing Manual
http://astrometry.net/doc2
Other
3 stars 0 forks source link

HTTP error 500 when getting submission status #4

Closed kevinalle closed 11 years ago

kevinalle commented 11 years ago

Hi, I am getting an Internal Server Error (500) when checking for a submission status right after submitting it.

As the API documentation is incomplete, I figured out my own workflow. It goes:

  1. /api/login (send apikey, get sessionid)
  2. /api/upload (send data, get submissionid)
  3. /api/submissions/submissionid (get jobid)
  4. /api/jobs/jobid (get job status)
  5. /api/jobs/jobid/calibration (when job successful, get ra/dec/radius)

This works fine except in step 3, where I get HTTP500 a couple of times before I get a valid answer (I retry until i get HTTP 200). So I'm guessing I have to wait a bit after uploading and before checking the submission status, but, how long? Is there a way to check if the submission is "ready"?

Anyway, the service is REALLY useful. Thanks a lot!!!

dstndstn commented 11 years ago

Sorry about the lack of documentation -- have you seen the "client.py" code? It gives a teeny bit of documentation on the API.

I tracked down this bug -- the problem was basically that when jobs just start getting processed, they don't get a job id yet, so the job was None and I was asking for its id, hence the server thread would crash in that case.

I fixed this. One thing to note: when you request the submission status, you may get JSON "null" in the list of job ids; I did this so that the "user_images" and "jobs" arrays are parallel. Just a possible gotcha to watch out for.

Sending to URL: http://supernova.astrometry.net/api/submissions/230
Got json: {"user_images": [221], "processing_started": "2013-03-07 10:21:00.681172", "jobs": [null], "user": 8, "processing_finished": "2013-03-07 10:21:00.728538"}
Got result: {'user_images': [221], 'processing_finished': '2013-03-07 10:21:00.728538', 'jobs': [None], 'user': 8, 'processing_started': '2013-03-07 10:21:00.681172'}

This fix is in http://supernova.astrometry.net and I'll update nova when I get a chance.

kevinalle commented 11 years ago

cool cool cool, I'll try this out, but looks exactly right. Thanks!!

dstndstn commented 11 years ago

Nova updated with this fix