Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

cannot import into an RM site #39

Open
boneill opened this issue Jul 17, 2015 · 11 comments
Open

cannot import into an RM site #39

boneill opened this issue Jul 17, 2015 · 11 comments
Labels

Comments

@boneill
Copy link

boneill commented Jul 17, 2015

When I try to import into an RM site I get access denied exception.

2015-07-17 15:25:51,448 INFO [org.alfresco.extension.bulkimport.impl.Scanner] [BulkImport-Scanner] BULKIMPORT: Import (streaming) started from Default.
2015-07-17 15:25:51,550 DEBUG [org.alfresco.extension.bulkimport.impl.BatchImporterImpl] [BulkImport-Scanner] BULKIMPORT: Importing Batch #1, 1 items, 0 bytes.
2015-07-17 15:25:51,566 DEBUG [org.alfresco.extension.bulkimport.impl.BatchImporterImpl] [BulkImport-Scanner] BULKIMPORT: Finding parent folder ''.
2015-07-17 15:25:51,806 ERROR [org.alfresco.extension.bulkimport.impl.Scanner] [BulkImport-Scanner] BULKIMPORT: Bulk import from 'Default' failed.
org.alfresco.extension.bulkimport.impl.ItemImportException: Unexpected exception:
class org.alfresco.repo.security.permissions.AccessDeniedException: 06170051 Access Denied. You do not have the appropriate permissions to perform this operation.
While importing item: Military Assignment Documents (1 version):
HEAD:
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl.importItem(BatchImporterImpl.java:230)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl.importBatchImpl(BatchImporterImpl.java:193)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl.access$200(BatchImporterImpl.java:67)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl$2.execute(BatchImporterImpl.java:161)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl.importBatchInTxn(BatchImporterImpl.java:152)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl.access$000(BatchImporterImpl.java:67)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl$1.doWork(BatchImporterImpl.java:128)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
at org.alfresco.extension.bulkimport.impl.BatchImporterImpl.importBatch(BatchImporterImpl.java:122)
at org.alfresco.extension.bulkimport.impl.Scanner.submitCurrentBatch(Scanner.java:336)
at org.alfresco.extension.bulkimport.impl.Scanner.run(Scanner.java:199)
at java.lang.Thread.run(Thread.java:745)
2015-07-17 15:25:51,810 INFO [org.alfresco.extension.bulkimport.impl.LoggingBulkImportCompletionHandler] [BulkImport-Scanner] BULKIMPORT: Streaming bulk import completed (Failed) in 00s 352.001ms.
Batches: 0 imported of 1 submitted (0.000 / sec)
Nodes: 0 (0.000 / sec)
Bytes: 0 (0.000 / sec)
Versions: 0
Metadata properties: 0
Files: 0 in-place, 0 streamed, 0 skipped
Out-of-order batches: 0
Regards

Brian

@roywetherall
Copy link

A couple of questions to try and gather some more information on this problem ..

  • What version of RM are you using?
  • What type of RM artifact are you trying to import "Military Assignment Documents" into? File Plan root? Record category? Record folder?
  • What type of RM artifact is "Military Assignment Documents"? Record category? Record folder?
  • Are you specifying the type of "Military Assignment Documents" in the import meta-data information?

@boneill
Copy link
Author

boneill commented Jul 19, 2015

Hi Guys,

Thanks for looking at this. I did an export of the military assignment
folder from the sample site using the Alfresco-bulk export tool (version
5.1) and then tried to import it (to a fresh blank version) using the bulk
import tool. So it is being imported the root documentLibrary folder of
the rm site. It just fails. (Note I have confirmed I can do the same
thing if importing from a standard site to a standard site.

Since raising the issue but, I have noted that one of the fields in my
export is the record identifier (which is system set). I took it out and
it still fails with the latest bulk importer.

Also I tried using the built in alfresco bulk importer (ie old version of
hte importer) and it works as long as I take the identifier out. I will be
working on this progressively today.

One question I have that would really help with what I am doing. I have
the export tool downloaded and intend to customise it to ensure I can map
metadata values correctly to the shadow metadata files. However, I
potentially need to hook into the import for a node as well to clean up any
of the imported values for the node. Probably best to do this before the
node commits so I was thinking of hooking into the beforeCreate policy. So
simply my question is, is this a valid approach? If not, can you recommend
another approach.

Regards and thanks for any help.

Brian

Brian

On Mon, Jul 20, 2015 at 9:27 AM, Roy Wetherall notifications@github.com
wrote:

A couple of questions to try and gather some more information on this
problem ..

  • What version of RM are you using?
  • What type of RM artifact are you trying to import "Military
    Assignment Documents" into? File Plan root? Record category? Record folder?
  • What type of RM artifact is "Military Assignment Documents"? Record
    category? Record folder?
  • Are you specifying the type of "Military Assignment Documents" in
    the import meta-data information?


Reply to this email directly or view it on GitHub
#39 (comment)
.[image: Web Bug from
https://github.com/notifications/beacon/AD65WK4NQVTG1KB5sCaoY3wl6YKcUPwOks5ofCn3gaJpZM4Fac3a.gif]

Brian O'Neill | Principal
Seed Information Management
Mobile: 0401166254
Email: brian.oneill@seedim.com.au
Factory 59, The Docklands Cotton Mills, Victoria 3011

@pmonks
Copy link
Owner

pmonks commented Jul 20, 2015

@boneill would you mind answering Roy's questions? That will help nail down what's happening.

@pmonks
Copy link
Owner

pmonks commented Jul 20, 2015

FWIW I just noticed that the stack trace above is incomplete (the code was losing important exception information), so I've just fixed that (in rev 1e5ee07). I'll try to cut a new RC later this week, and if you're able to reproduce the issue and post the improved stack trace we may have a better chance of identifying the root cause.

@boneill
Copy link
Author

boneill commented Jul 20, 2015

Hi Roy,

Answers below:

  • What version of RM are you using? (BON) Version 2.3
  • What type of RM artifact are you trying to import "Military Assignment
    Documents" into? File Plan root? Record category? Record folder? (BON)
    File Plan Root.
  • What type of RM artifact is "Military Assignment Documents"? Record
    category? Record folder? (BON) Record Category.
  • Are you specifying the type of "Military Assignment Documents" in the
    import meta-data information? (BON) Yes.

Regards

Brian

On Mon, Jul 20, 2015 at 9:27 AM, Roy Wetherall notifications@github.com
wrote:

A couple of questions to try and gather some more information on this
problem ..

  • What version of RM are you using?
  • What type of RM artifact are you trying to import "Military
    Assignment Documents" into? File Plan root? Record category? Record folder?
  • What type of RM artifact is "Military Assignment Documents"? Record
    category? Record folder?
  • Are you specifying the type of "Military Assignment Documents" in
    the import meta-data information?


Reply to this email directly or view it on GitHub
#39 (comment)
.[image: Web Bug from
https://github.com/notifications/beacon/AD65WK4NQVTG1KB5sCaoY3wl6YKcUPwOks5ofCn3gaJpZM4Fac3a.gif]

Brian O'Neill | Principal
Seed Information Management
Mobile: 0401166254
Email: brian.oneill@seedim.com.au
Factory 59, The Docklands Cotton Mills, Victoria 3011

@pmonks
Copy link
Owner

pmonks commented Jul 21, 2015

I just pushed RC2 - if you could give that a whirl and paste in the full exception stack we might get a bit more information about what's going on.

@pmonks
Copy link
Owner

pmonks commented Aug 3, 2015

@roywetherall any insights based on the information @boneill provided above?

@boneill
Copy link
Author

boneill commented Aug 3, 2015

Hi Guys,

I will do my best to testing this again towards the end of this week. I
reverted to using the older version which I can get to work and project
pressures meant I needed to keep going. But I will cycle back around to
this and retest with the new release and let you know. Thanks for your
responsiveness.

Brian

On Tue, Aug 4, 2015 at 4:56 AM, Peter Monks notifications@github.com
wrote:

@roywetherall https://github.com/roywetherall any insights based on the
information @boneill https://github.com/boneill provided above?


Reply to this email directly or view it on GitHub
#39 (comment)
.[image: Web Bug from
https://github.com/notifications/beacon/AD65WLEQ0lnbfmTsZid38d4WHjVmoo8cks5oj7DUgaJpZM4Fac3a.gif]

Brian O'Neill | Principal
Seed Information Management
Mobile: 0401166254
Email: brian.oneill@seedim.com.au
Factory 59, The Docklands Cotton Mills, Victoria 3011

@pmonks pmonks added the bug label Aug 24, 2015
@pmonks
Copy link
Owner

pmonks commented Aug 24, 2015

Any updates? I'd like to dig a bit deeper into this before pushing the v2.0 GA, but don't have access to an RM environment to test against.

@taradic
Copy link

taradic commented Nov 24, 2016

Hi pmonks,

I was trying to import files to RM and ran into this issue.
After looking into your code I found that setting type is causing the problem.

To be exact, line 511 in BatchImporterImpl.java
nodeService.setType(nodeRef, createQName(serviceRegistry, type));

RM doesn't allow type change so we get AccessDeniedException.

Is there any specific reason why you are setting the type again after createNode?
Maybe update scenario?

@pmonks pmonks removed the need-info label Nov 26, 2016
@pmonks
Copy link
Owner

pmonks commented Nov 26, 2016

@taradic the setType call is required for imports where replacement is enabled. The precise scenario is where an existing node (i.e. one that was not created by the tool) needs to be updated to match whatever is on disk (including type).

That said, for the creation case the call is redundant, and given RM's apparent intolerance of setType, shouldn't be made.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants