org.dspace.authorize.AuthorizeException: Authorization denied for action WRITE on BITSTREAM:1995e149-c7f6-4cd5-ac2f-553a050bdbdd by user 4d1b0e95-7e81-4d80-a3ac-2c25bdbde192

Sakai JIRA | Tom Desair (Atmire) | 1 week ago
  1. 0

    As reported here https://groups.google.com/forum/#!topic/dspace-tech/deXaHGm-09U a submitter who is not a member of the Administrator group cannot remove a bitstream in the submission from which he uploaded previously. The resulting error message is "Authorization denied for action WRITE on BITSTREAM:1995e149-c7f6-4cd5-ac2f-553a050bdbdd by user 4d1b0e95-7e81-4d80-a3ac-2c25bdbde192". The corresponding stack trace is: {code:java} org.dspace.authorize.AuthorizeException: Authorization denied for action WRITE on BITSTREAM:1995e149-c7f6-4cd5-ac2f-553a050bdbdd by user 4d1b0e95-7e81-4d80-a3ac-2c25bdbde192 at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:157) at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:95) at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:89) at org.dspace.content.BitstreamServiceImpl.update(BitstreamServiceImpl.java:219) at org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:262) at org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:41) at org.dspace.content.BundleServiceImpl.removeBitstream(BundleServiceImpl.java:199) at org.dspace.submit.step.UploadStep.processRemoveFile(UploadStep.java:452) at org.dspace.submit.step.UploadStep.doProcessing(UploadStep.java:237) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243) ... {code} I reproduced this issue locally since the submission process for the submitter account on DSpace Demo is blocked by another bug. The root cause is that the resource policies are removed from the bitstream before the bitstream is updated.

    Sakai JIRA | 1 week ago | Tom Desair (Atmire)
    org.dspace.authorize.AuthorizeException: Authorization denied for action WRITE on BITSTREAM:1995e149-c7f6-4cd5-ac2f-553a050bdbdd by user 4d1b0e95-7e81-4d80-a3ac-2c25bdbde192
  2. 0

    This was discovered when attempting to run an AIP replace (packager -r -f) command. If a Community has a logo, any attempts to replace or remove it result in an AuthorizeException. Here's the full stacktrace: org.dspace.authorize.AuthorizeException: Authorization attempted on null DSpace object OBSOLETE (DELETE) by user 350e1431-8f75-40d3-a2b0-72222a82860a at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:123) at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:94) at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:88) at org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:239) at org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:41) at org.dspace.content.CommunityServiceImpl.setLogo(CommunityServiceImpl.java:211) at org.dspace.content.packager.PackageUtils.removeAllBitstreams(PackageUtils.java:682) at org.dspace.content.packager.AbstractMETSIngester.replaceObject(AbstractMETSIngester.java:625) at org.dspace.content.packager.AbstractMETSIngester.replace(AbstractMETSIngester.java:1207) at org.dspace.content.packager.AbstractPackageIngester.replaceAll(AbstractPackageIngester.java:282) at org.dspace.content.packager.AbstractPackageIngester.replaceAll(AbstractPackageIngester.java:315) at org.dspace.app.packager.Packager.replace(Packager.java:737) at org.dspace.app.packager.Packager.main(Packager.java:377) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:227) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:79) org.dspace.authorize.AuthorizeException: Authorization attempted on null DSpace object OBSOLETE (DELETE) by user 350e1431-8f75-40d3-a2b0-72222a82860a The cause is an obvious bug in the CommunityServiceImpl.setLogo() code which proceeds to nullify the logo prior to actually removing its bitstream. See this line (and the line after it): https://github.com/DSpace/DSpace/blob/feebea46bcc77a98fd1bafc933c0b8c875e7b6f4/dspace-api/src/main/java/org/dspace/content/CommunityServiceImpl.java#L210 PR coming shortly.

    Sakai JIRA | 1 year ago | Tim Donohue
    org.dspace.authorize.AuthorizeException: Authorization attempted on null DSpace object OBSOLETE (DELETE) by user 350e1431-8f75-40d3-a2b0-72222a82860a
  3. 0

    This was discovered when attempting to run an AIP replace (packager -r -f) command. If a Community has a logo, any attempts to replace or remove it result in an AuthorizeException. Here's the full stacktrace: org.dspace.authorize.AuthorizeException: Authorization attempted on null DSpace object OBSOLETE (DELETE) by user 350e1431-8f75-40d3-a2b0-72222a82860a at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:123) at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:94) at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:88) at org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:239) at org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:41) at org.dspace.content.CommunityServiceImpl.setLogo(CommunityServiceImpl.java:211) at org.dspace.content.packager.PackageUtils.removeAllBitstreams(PackageUtils.java:682) at org.dspace.content.packager.AbstractMETSIngester.replaceObject(AbstractMETSIngester.java:625) at org.dspace.content.packager.AbstractMETSIngester.replace(AbstractMETSIngester.java:1207) at org.dspace.content.packager.AbstractPackageIngester.replaceAll(AbstractPackageIngester.java:282) at org.dspace.content.packager.AbstractPackageIngester.replaceAll(AbstractPackageIngester.java:315) at org.dspace.app.packager.Packager.replace(Packager.java:737) at org.dspace.app.packager.Packager.main(Packager.java:377) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:227) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:79) org.dspace.authorize.AuthorizeException: Authorization attempted on null DSpace object OBSOLETE (DELETE) by user 350e1431-8f75-40d3-a2b0-72222a82860a The cause is an obvious bug in the CommunityServiceImpl.setLogo() code which proceeds to nullify the logo prior to actually removing its bitstream. See this line (and the line after it): https://github.com/DSpace/DSpace/blob/feebea46bcc77a98fd1bafc933c0b8c875e7b6f4/dspace-api/src/main/java/org/dspace/content/CommunityServiceImpl.java#L210 PR coming shortly.

    Sakai JIRA | 1 year ago | Tim Donohue
    org.dspace.authorize.AuthorizeException: Authorization attempted on null DSpace object OBSOLETE (DELETE) by user 350e1431-8f75-40d3-a2b0-72222a82860a
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    DELETE is dangerous

    Google Groups | 7 months ago | Evgeni Dimitrov
    org.dspace.authorize.AuthorizeException: Authorization denied for action REMOVE on COMMUNITY:13 by user 5 at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:181) at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:100)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.dspace.authorize.AuthorizeException

      Authorization denied for action WRITE on BITSTREAM:1995e149-c7f6-4cd5-ac2f-553a050bdbdd by user 4d1b0e95-7e81-4d80-a3ac-2c25bdbde192

      at org.dspace.authorize.AuthorizeServiceImpl.authorizeAction()
    2. DSpace Kernel :: API and Implementation
      UploadStep.doProcessing
      1. org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:157)
      2. org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:95)
      3. org.dspace.authorize.AuthorizeServiceImpl.authorizeAction(AuthorizeServiceImpl.java:89)
      4. org.dspace.content.BitstreamServiceImpl.update(BitstreamServiceImpl.java:219)
      5. org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:262)
      6. org.dspace.content.BitstreamServiceImpl.delete(BitstreamServiceImpl.java:41)
      7. org.dspace.content.BundleServiceImpl.removeBitstream(BundleServiceImpl.java:199)
      8. org.dspace.submit.step.UploadStep.processRemoveFile(UploadStep.java:452)
      9. org.dspace.submit.step.UploadStep.doProcessing(UploadStep.java:237)
      9 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    4. Rhino
      NativeJavaMethod.call
      1. org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
      2. org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
      2 frames