We're updating the issue view to help you get more done. 

Add dataset from IMGAPI Server failed with 500 Error

Description

If I add one dataset from one of my IMGAPI servers the API return 500 Internal Server Error. The IMGAPI Server is the official server developed by Joyent.

Using curl with the following command:

1 curl -v -X POST -d '{"url": "https://imgapi.smartos.skylime.net/images/a4103f7d-118e-4830-ba69-66ab6a040de3"}' https://example.com/api/0.1.0/datasets -H 'X-Snarl-Token:XXXX' -H 'Content-Type: application/json' -H 'Accept: application/json'

Header / Return:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 > POST /api/0.1.0/datasets HTTP/1.1 > User-Agent: curl/7.41.0 > Host: example.com > X-Snarl-Token:XXXX > Content-Type: application/json > Accept: application/json > Content-Length: 89 > * upload completely sent off: 89 out of 89 bytes * SSLv2, Unknown (23): < HTTP/1.1 500 Internal Server Error < Server: nginx/1.6.0 < Date: Tue, 30 Jun 2015 06:17:27 GMT < Content-Type: application/json < Content-Length: 0 < Connection: keep-alive < x-snarl-token: XXXX < access-control-allow-origin: * < access-control-allow-headers: Authorization, content-type, x-snarl-token, x-full-list, x-full-list-fields < access-control-expose-headers: x-snarl-token, x-full-list, x-full-list-fields < access-control-allow-credentials: true < vary: accept

The following information shows the crash.log from wiggle:

1 2 3 4 5 2015-06-30 07:29:20 =ERROR REPORT==== Error in process <0.23983.3> on node 'wiggle@10.0.42.253' with exit value: {[{reason,{badmatch,{error,{{badmatch,undefined},[{sniffle_dataset_download_fsm,get_manifest,2,[{file,"src/sniffle_dataset_download_fsm.erl"},{line,117}]},{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},{proc_lib... 2015-06-30 07:29:20 =ERROR REPORT==== Ranch listener http had connection process started with cowboy_protocol:start_link/4 at <0.23983.3> exit with reason: {[{reason,{badmatch,{error,{{badmatch,undefined},[{sniffle_dataset_download_fsm,get_manifest,2,[{file,"src/sniffle_dataset_download_fsm.erl"},{line,117}]},{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}}},{mfa,{wiggle_rest_handler,write,2}},{stacktrace,[{wiggle_dataset_handler,create,3,[{file,"src/wiggle_dataset_handler.erl"},{line,197}]},{wiggle_rest_handler,write,2,[{file,"src/wiggle_rest_handler.erl"},{line,233}]},{cowboy_rest,call,3,[{file,"src/cowboy_rest.erl"},{line,972}]},{cowboy_rest,process_content_type,3,[{file,"src/cowboy_rest.erl"},{line,773}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]},{req,[{socket,#Port<0.27520>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.23983.3>},{method,<<"POST">>},{version,'HTTP/1.1'},{peer,{{127,0,0,1},47650}},{host,<<"api">>},{host_info,undefined},{port,80},{path,<<"/api/0.1.0/datasets">>},{path_info,[]},{qs,<<>>},{qs_vals,undefined},{bindings,[{version,<<"0.1.0">>}]},{headers,[{<<"host">>,<<"api">>},{<<"content-length">>,<<"89">>},{<<"user-agent">>,<<"curl/7.41.0">>},{<<"x-snarl-token">>,<<"XXXXX">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"application/json">>}]},{p_headers,[{<<"content-type">>,{<<"application">>,<<"json">>,[]}},{<<"if-modified-since">>,undefined},{<<"if-none-match">>,undefined},{<<"if-unmodified-since">>,undefined},{<<"if-match">>,undefined},{<<"accept">>,[{{<<"application">>,<<"json">>,[]},1000,[]}]}]},{cookies,undefined},{meta,[{media_type,{<<"application">>,<<"json">>,[]}},{charset,undefined}]},{body_state,waiting},{buffer,<<"{\"url\": \"https://imgapi.smartos.skylime.net/images/a4103f7d-118e-4830-ba69-66ab6a040de3\"}">>},{multipart,undefined},{resp_compress,true},{resp_state,waiting},{resp_headers,[{<<"vary">>,[<<"accept">>]},{<<"content-type">>,[<<"application">>,<<"/">>,<<"json">>,<<>>]},{<<"access-control-allow-credentials">>,<<"true">>},{<<"access-control-expose-headers">>,<<"x-snarl-token, x-full-list, x-full-list-fields">>},{<<"access-control-allow-headers">>,<<"Authorization, content-type, x-snarl-token, x-full-list, x-full-list-fields">>},{<<"access-control-allow-origin">>,<<"*">>},{<<"x-snarl-token">>,<<"XXXXX">>}]},{resp_body,<<>>},{onresponse,undefined}]},{state,{state,wiggle_dataset_handler,[],<<"POST">>,<<"0.1.0">>,{token,<<"XXXXX">>},undefined,undefined,undefined,undefined,{1435,649360,61916},<<"/api/0.1.0/datasets">>,undefined,false,[]}}],[{cowboy_rest,process_content_type,3,[{file,"src/cowboy_rest.erl"},{line,773}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,435}]}]}

Environment

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { "warnings": [], "metrics": { "total-memory": 49143, "storage": "s3", "reserved-memory": 0, "provisioned-memory": 38960, "l2size": 0, "disk-size": 3801088, "disk-used": 363801, "free-memory": 10183, "l1hits": 1330303006, "l1miss": 20046855, "l1size": 24004, "l2hits": 0, "l2miss": 0 }, "versions": { "snarl": "0.6.1p5-2-g0101237", "howl": "0.6.1p1", "sniffle": "0.6.1p11", "wiggle": "0.6.1p7" } }

Status

Assignee

Heinz N. Gies

Reporter

Thomas

Labels

Fix versions

Affects versions

0.6.1

Priority

Medium