MG-RAST/Shock

auth check done after upload

Closed this issue · 2 comments

Trying an upload of a large file and got this:

olson@maple:/scratch/DataForKmers/Data.2014-05-03$ time curl -X POST --data-binary @kmer.table.mem_map http://kbase.us/services/shock-api/node
{"status":401,"data":null,"error":["No Authorization"]}
real 9m27.975s
user 0m18.317s
sys 1m5.413s

Seems like that check should be done before committing to the large upload.

The server does look for Auth first. I think this has to do with how the data is being sent. When sending a curl POST with a multi-part form to the MG-RAST Shock server, we get back the Auth error right away. But, the binary data stream seems to upload the file before returning an error. I have to see if there's a solution to this. In the case of the KBase Shock server, it appears that both requests take a long time, but only the binary data stream hogs the memory usage on the client. Perhaps in the case of the multi-part form request type on the KBase Shock server the issue results from the request going thru a proxy.

Fixed or unable to duplicate. The code for both data and multipart form POST checks auth before streaming the data. Testing this against the lastest code using curl throws me the the auth error immediately when POSTing a gigabyte size file.