org.dspace.authorize.AuthorizeException: Authorization denied for action WRITE on ITEM:12782 by user 0

Sakai JIRA | Robert Faling | 2 years ago
  1. 0
  2. 0
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    How to reproduce: 1) Create an Item where the license.txt file is not accessible to anonymous users (READ access limited to a group that is not "Anonymous"). This can be done one of two ways: a) Create the Item, then tweak the license.txt access rights b) Create a Collection where DEFAULT_READ is limited to a non-Anon Group. 2) Run "./dspace oai import" In the DSpace logs you will receive errors like: 2014-01-08 02:09:17,930 WARN org.dspace.xoai.util.ItemUtils @ Authorization denied for action READ on BITSTREAM:10149 by user 0 org.dspace.authorize.AuthorizeException: Authorization denied for action READ on BITSTREAM:10149 by user 0 at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:181) at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:100) at org.dspace.content.Bitstream.retrieve(Bitstream.java:601) at org.dspace.xoai.util.ItemUtils.retrieveMetadata(ItemUtils.java:273) at org.dspace.xoai.app.XOAI.index(XOAI.java:306) at org.dspace.xoai.app.XOAI.index(XOAI.java:229) at org.dspace.xoai.app.XOAI.index(XOAI.java:189) at org.dspace.xoai.app.XOAI.index(XOAI.java:141) at org.dspace.xoai.app.XOAI.main(XOAI.java:439) 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.main(ScriptLauncher.java:183) -------- Essentially, OAI-PMH is indexing as an "Anonymous" user (user: 0). It is also attempting to index the contents of the "license.txt" file, which then cause this error to appear in the logs. https://github.com/DSpace/DSpace/blob/master/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java#L257 OAI-PMH should find a better way to catch such AuthorizationExceptions as they are not truly errors. All that is happened is that the OAI-PMH indexer has discovered that it cannot provide the license for public access. IMHO, this need not be reported in the dspace.log, or if it is reported, it should be a one-line warning. This error has been verified in DSpace 3.2. I suspect it also exists in 4.0 as the affected code seems unchanged between those versions.

    Sakai JIRA | 3 years ago | Tim Donohue
    org.dspace.authorize.AuthorizeException: Authorization denied for action READ on BITSTREAM:10149 by user 0

    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 ITEM:12782 by user 0

      at org.dspace.authorize.AuthorizeManager.authorizeAction()
    2. DSpace Kernel :: API and Implementation
      AuthorityIndexClient.main
      1. org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:181)
      2. org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:100)
      3. org.dspace.content.Item.update(Item.java:1655)
      4. org.dspace.authority.indexer.DSpaceAuthorityIndexer.prepareNextValue(DSpaceAuthorityIndexer.java:178)
      5. org.dspace.authority.indexer.DSpaceAuthorityIndexer.hasMore(DSpaceAuthorityIndexer.java:112)
      6. org.dspace.authority.indexer.AuthorityIndexClient.main(AuthorityIndexClient.java:52)
      6 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    4. DSpace Kernel :: API and Implementation
      ScriptLauncher.main
      1. org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225)
      2. org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77)
      2 frames