Bug #106

avatar

Datastream.save is causing a 500 error in Fedora

Added by Matt Zumwalt 633 days ago. Updated 602 days ago.

Status:Closed Start:12/13/2008
Priority:Urgent Due date:12/14/2008
Assigned to:avatarMcClain Looney % Done:

0%

Category:Consuming Fedora APIs Spent time: -
Target version:1.0 Beta Release
Sponsor:


Description

When you try to save a plain old ActiveFedora::Datastream object and save it, Fedora throws a 500 error.

My specs are still passing. This error happens when I try to save a datastream from irb. I don't know why the specs aren't failing.

Here's how to recreate the error:

>> ds = ActiveFedora::Datastream.new(:dsid => "foo")
>> ds.pid = "changeme:1294" 
>> ds.save
Fedora::ServerError: Failed with 500 Internal Server Error
    from ./lib/fedora/connection.rb:173:in `handle_response'
    from ./lib/fedora/connection.rb:146:in `request'
    from ./lib/fedora/connection.rb:124:in `post'
    from ./lib/fedora/repository.rb:136:in `create'
    from ./lib/fedora/repository.rb:111:in `save'
    from ./lib/active_fedora/datastream.rb:41:in `save'
    from (irb):10
    from :0

Here's the full error that Fedora is returning:

javax.ws.rs.WebApplicationException: fedora.server.errors.StreamWriteException
    at fedora.server.rest.BaseRestResource.handleException(BaseRestResource.java:98)
    at fedora.server.rest.DatastreamResource.addOrUpdateDatastream(DatastreamResource.java:417)
    at fedora.server.rest.DatastreamResource.addDatastream(DatastreamResource.java:310)
    at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.ws.rest.impl.model.method.dispatch.EntityParamDispatchProvider$ResponseOutInvoker._dispatch(EntityParamDispatchProvider.java:128)
    at com.sun.ws.rest.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:65)
    at com.sun.ws.rest.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:118)
    at com.sun.ws.rest.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:96)
    at com.sun.ws.rest.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:56)
    at com.sun.ws.rest.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:96)
    at com.sun.ws.rest.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:49)
    at com.sun.ws.rest.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:416)
    at com.sun.ws.rest.spi.container.servlet.ServletContainer.service(ServletContainer.java:151)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at fedora.server.security.servletfilters.FilterSetup.doFilter(FilterSetup.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at fedora.server.security.servletfilters.FilterSetup.doFilter(FilterSetup.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at fedora.server.security.servletfilters.FilterSetup.doFilter(FilterSetup.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at fedora.server.security.servletfilters.FilterSetup.doFilter(FilterSetup.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:613)
Caused by: fedora.server.errors.StreamWriteException
    at fedora.server.management.DefaultManagement.putTempStream(DefaultManagement.java:1245)
    at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at fedora.server.messaging.NotificationInvocationHandler.invoke(NotificationInvocationHandler.java:70)
    at $Proxy0.putTempStream(Unknown Source)
    at fedora.server.management.ManagementModule.putTempStream(ManagementModule.java:475)
    at fedora.server.rest.DatastreamResource.addOrUpdateDatastream(DatastreamResource.java:382)
    ... 41 more

History

Updated by McClain Looney 633 days ago

avatar

seems it's purely based on the lack of a blob (saving to a blob passes). will work out what the issue is shortly.

Updated by McClain Looney 633 days ago

avatar

reverted to r 143 (prior to my hacking), datastreams could not be creatd w/o blobs at that point either.

Updated by McClain Looney 633 days ago

avatar

are you sure about this? what is a datastream w/o a blob?

Updated by McClain Looney 633 days ago

avatar
  • Status changed from New to Assigned

Updated by Matt Zumwalt 633 days ago

avatar

You've got a point about a Datastream being kinda pointless without a blob, but what about when I just want to tinker around with datastreams to test the API. Do I have to dig out a blob every time?

Updated by McClain Looney 633 days ago

avatar

yeah, looks like you do, seems to be a limitation of fedora more than a limitation of af:

Updated by McClain Looney 633 days ago

avatar

i t might be possible to change the internals to accept a stringio though...

Updated by McClain Looney 602 days ago

avatar
  • Status changed from Assigned to Closed

reopen if valid

Also available in: Atom PDF