HTTPD 500 error on PUT to existing dataset

51 views
Skip to first unread message

Anders Conrad

unread,
Apr 6, 2017, 9:30:56 AM4/6/17
to Dataverse Users Community
Sorry to bring such a boring question...

But we seem to be stuck with 500 internal server error when trying to PUT a new json metadatafile for an existing dataset, using Native API.

We GET the existing data as json, modify something, and try put. Always 500... I wonder what we do wrong - or if my server could be too minimal, even if creating and populating datasets haven't casused any problems?

Apache ssl_access_log says:

130.225.178.2 - - [06/Apr/2017:14:57:21 +0200] "GET /api/datasets/20/ HTTP/1.1" 200 6191
130.225.178.2 - - [06/Apr/2017:15:03:25 +0200] "PUT /api/datasets/20/versions/:draft?key=xxxx HTTP/1.1" 500 19038

Glassfish server.log beginning of error stack, notice that in this case, the error-level is actually only indicated as WARNING:

[2017-04-06T15:03:26.061+0200] [glassfish 4.1] [WARNING] [] [edu.harvard.iq.dataverse.api.ApiBlockingFilter] [tid: _ThreadID=48 _ThreadName=jk-connector(3)] [timeMillis: 1491483806061] [levelValue: 900] [[
  Error processing /api/v1/datasets/20/versions/:draft: javax.json.stream.JsonParsingException: Unexpected char 100 at (line no=1, column no=1, offset=0)
javax.servlet.ServletException: javax.json.stream.JsonParsingException: Unexpected char 100 at (line no=1, column no=1, offset=0)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:391)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)

In other cases, we have seen null-pointer exceptions, or other "unexpected" chars reported, e.g. 75.

The command line is
curl -k -H "Content-Type: application/json" -X PUT https://<our-server-address>/api/datasets/20/versions/:draft?key=xxxx --data "dvn_id_20.json"

Any suggestions would be very highly appreciated!
Thanks!
Anders

Philip Durbin

unread,
Apr 6, 2017, 9:43:10 AM4/6/17
to dataverse...@googlegroups.com
Not a boring question! You found a bug. :)

A few things:

1. If there's nothing secret in your dvn_id_20.json file, can you please attach it?

2. Is your dvn_id_20.json file valid JSON? You can check by doing this:

cat dvn_id_20.json | python -m json.tool

(There are probably online JSON validators out there too.)

3. What version of Dataverse are you running. This is important for matching the line number you posted with the version of the code you're running.

4. Please feel free to go ahead and create a GitHub issue for this. Using the API should never produce a 500 error and a stack trace. It should return a more reasonable code such as 400 (bad request).

Thanks,

Phil

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/a422d298-0271-4c0b-8339-e5cd3c2d820e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Anders Conrad

unread,
May 8, 2017, 8:34:42 AM5/8/17
to Dataverse Users Community, philip...@harvard.edu
Thanks for the reply, and sorry for the long silence where other stuff took up my time.

Meanwhile the same issue was raised in https://groups.google.com/forum/#!msg/dataverse-community/k6_Pddw6xAU/2hcO6RAoAQAJ;context-place=forum/dataverse-community and in #3777 on Github.

I tried the suggested workaround removing the "files" section of the JSON file. I can confirm that this works in my case as well. So I consider this resolved.

By the way we are running Dataverse 4.6, but I didn't get the feeling that mattered after all.

Thanks,
Anders
To post to this group, send email to dataverse...@googlegroups.com.

Philip Durbin

unread,
May 15, 2017, 1:41:01 PM5/15/17
to dataverse...@googlegroups.com
Yes, https://github.com/IQSS/dataverse/issues/3777 is newer than this thread. Thanks for noticing it! I'm glad the workaround is helping.

To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages