javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.StreamWriteException: Error writing temp stream

Sakai JIRA | Jeff Minelli | 4 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have a version of fedora 3.5 running that errors with javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.StreamWriteException: Error writing temp stream at org.fcrepo.server.rest.BaseRestResource.handleException(BaseRestResource.java:172) at org.fcrepo.server.rest.DatastreamResource.addOrUpdateDatastream(DatastreamResource.java:583) … when I write a file 2GB in size (1024*1024*2048) via the API: curl -H "Content-type:application/octet-stream" -X POST -u "name:pass" --upload-file 3g.data \ http://host:8080/fedora/objects/scholarsphere:5425k9692/datastreams/blah?controlGroup=M But when I write a 2GB-1MB file (1024*1024*2047) via the API, it works without issue. Multipart uploads also do not work. Ben Armintor has been working with me on this and first identified https://jira.duraspace.org/browse/FCREPO-704 as a potential starting place. He has since followed up with: I've got a test verifying a bug in FCRepo 3.6 (and earlier) for content posted in the request body- I'll push a fix today (I think). There are two places in the REST library in which signed ints are being used got content-length in the kind of upload you have: https://github.com/fcrepo/fcrepo/blob/master/fcrepo-server/src/main/java/org/fcrepo/server/rest/RestUtil.java#L74 (where it's implicit in the j2ee interface, so we just have to ignore it and parse the header) and at https://github.com/fcrepo/fcrepo/blob/master/fcrepo-server/src/main/java/org/fcrepo/server/rest/RestUtil.java#L63 (our fault- that was clearly a place we missed when an earlier bug in this line was fixed 3 years ago).

    Sakai JIRA | 4 years ago | Jeff Minelli
    javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.StreamWriteException: Error writing temp stream
  2. 0

    I have a version of fedora 3.5 running that errors with javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.StreamWriteException: Error writing temp stream at org.fcrepo.server.rest.BaseRestResource.handleException(BaseRestResource.java:172) at org.fcrepo.server.rest.DatastreamResource.addOrUpdateDatastream(DatastreamResource.java:583) … when I write a file 2GB in size (1024*1024*2048) via the API: curl -H "Content-type:application/octet-stream" -X POST -u "name:pass" --upload-file 3g.data \ http://host:8080/fedora/objects/scholarsphere:5425k9692/datastreams/blah?controlGroup=M But when I write a 2GB-1MB file (1024*1024*2047) via the API, it works without issue. Multipart uploads also do not work. Ben Armintor has been working with me on this and first identified https://jira.duraspace.org/browse/FCREPO-704 as a potential starting place. He has since followed up with: I've got a test verifying a bug in FCRepo 3.6 (and earlier) for content posted in the request body- I'll push a fix today (I think). There are two places in the REST library in which signed ints are being used got content-length in the kind of upload you have: https://github.com/fcrepo/fcrepo/blob/master/fcrepo-server/src/main/java/org/fcrepo/server/rest/RestUtil.java#L74 (where it's implicit in the j2ee interface, so we just have to ignore it and parse the header) and at https://github.com/fcrepo/fcrepo/blob/master/fcrepo-server/src/main/java/org/fcrepo/server/rest/RestUtil.java#L63 (our fault- that was clearly a place we missed when an earlier bug in this line was fixed 3 years ago).

    Sakai JIRA | 4 years ago | Jeff Minelli
    javax.ws.rs.WebApplicationException: org.fcrepo.server.errors.StreamWriteException: Error writing temp stream

    Root Cause Analysis

    1. javax.ws.rs.WebApplicationException

      org.fcrepo.server.errors.StreamWriteException: Error writing temp stream

      at org.fcrepo.server.rest.BaseRestResource.handleException()
    2. org.fcrepo.server
      DatastreamResource.addOrUpdateDatastream
      1. org.fcrepo.server.rest.BaseRestResource.handleException(BaseRestResource.java:172)
      2. org.fcrepo.server.rest.DatastreamResource.addOrUpdateDatastream(DatastreamResource.java:583)
      2 frames