org.dspace.authorize.AuthorizeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Tim Donohue,
  • 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.
    via by Tim Donohue,
  • When you reindex (index-discovery -b) and have missing files in assetstore of your bitstreams from the TEXT bundle (produced by filter-media), you'll get an error message that suggests it's an authorization problem. In fact, this is a missing file problem. The error message should be corrected. 2014-10-28 19:08:44,429 INFO org.dspace.discovery.SolrServiceImpl @ Wrote Item: 123456789/3129 to Index 2014-10-28 19:08:44,458 ERROR org.dspace.discovery.BitstreamContentStream @ Authorization denied for action READ on BITSTREAM:3216 by user 0 org.dspace.authorize.AuthorizeException: Authorization denied for action READ on BITSTREAM:3216 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:581) at org.dspace.discovery.BitstreamContentStream.getStream(BitstreamContentStream.java:66) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:274) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180) at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117) at org.dspace.discovery.SolrServiceImpl.writeDocument(SolrServiceImpl.java:726) at org.dspace.discovery.SolrServiceImpl.buildDocument(SolrServiceImpl.java:1407) at org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:224) at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:396) at org.dspace.storage.rdbms.DatabaseUtils$ReindexerThread.run(DatabaseUtils.java:754)
    via by Ivan Masár,
  • I noticed many instances of this error in our dspace.log file while watching the re-index for our upgrade to DSpace 5.3 today: 2015-08-20 14:03:30,421 ERROR org.dspace.discovery.BitstreamContentStream @ Authorization denied for action READ on BITSTREAM:38256 by user 0 org.dspace.authorize.AuthorizeException: Authorization denied for action READ on BITSTREAM:38256 by user 0 at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:182) at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:101) at org.dspace.content.Bitstream.retrieve(Bitstream.java:586) at org.dspace.discovery.BitstreamContentStream.getStream(BitstreamContentStream.java:66) at org.apache.solr.client.solrj.impl.HttpSolrServer.createMethod(HttpSolrServer.java:356) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:210) at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:206) at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:124) at org.dspace.discovery.SolrServiceImpl.writeDocument(SolrServiceImpl.java:738) at org.dspace.discovery.SolrServiceImpl.buildDocument(SolrServiceImpl.java:1419) at org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:225) at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:405) at org.dspace.discovery.SolrServiceImpl.createIndex(SolrServiceImpl.java:365) I think we can probably catch this error and present a streamlined INFO line for the dspace.log file, something like: "SKIPPED Item 10355/123456789, not public, against policy to Index" This should be a simple thing to catch, and will help tame log file bloat. I am assigning this to me, but if you want to tackle it, I won't argue.
    via by Hardy Pottinger,
  • DELETE is dangerous
    via by Evgeni Dimitrov,
    • org.dspace.authorize.AuthorizeException: Authorization denied for action READ on BITSTREAM:9134 by user 0 at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:182) at org.dspace.authorize.AuthorizeManager.authorizeAction(AuthorizeManager.java:101) at org.dspace.content.Bitstream.retrieve(Bitstream.java:586) at org.dspace.app.xmlui.cocoon.BitstreamReader.setup(BitstreamReader.java:372) at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
    No Bugmate found.