cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to copy authorities during upgrade to 3.2

tim-erwin
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to upgrade from 2.9 to 3.2 (2.9 > 3.0 is not an option due to reasons mentioned here) but fail with the following error:


11:34:04,059 User:System INFO  [admin.patch.PatchExecuter]      Applying patch 'patch.authorityMigration' (Copies any old authorities from the us
er store to the spaces store.).
11:34:04,121 User:System ERROR [admin.patch.PatchExecuter] 08280001 org.alfresco.repo.security.authority.AuthorityException: 08280000 The person
admin does not exist and can not be added to a group
        at org.alfresco.repo.security.authority.AuthorityServiceImpl.addAuthority(AuthorityServiceImpl.java:263)
        at org.alfresco.repo.admin.patch.impl.AuthorityMigrationPatch.migrateAuthorities(AuthorityMigrationPatch.java:139)
        at org.alfresco.repo.admin.patch.impl.AuthorityMigrationPatch.applyInternal(AuthorityMigrationPatch.java:193)
        at org.alfresco.repo.admin.patch.AbstractPatch$1$1.execute(AbstractPatch.java:388)
        at org.alfresco.repo.admin.patch.AbstractPatch$1$1.execute(AbstractPatch.java:382)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:233)
        at org.alfresco.repo.admin.patch.AbstractPatch$1.doWork(AbstractPatch.java:414)
        at org.alfresco.repo.admin.patch.AbstractPatch$1.doWork(AbstractPatch.java:378)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:489)
        at org.alfresco.repo.admin.patch.AbstractPatch.apply(AbstractPatch.java:418)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatch(PatchServiceImpl.java:294)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.access$200(PatchServiceImpl.java:56)
        at org.alfresco.repo.admin.patch.PatchServiceImpl$2.execute(PatchServiceImpl.java:231)
        at org.alfresco.repo.admin.patch.PatchServiceImpl$2.execute(PatchServiceImpl.java:229)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatchAndDependencies(PatchServiceImpl.java:234)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyOutstandingPatches(PatchServiceImpl.java:168)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy69.applyOutstandingPatches(Unknown Source)
        at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(PatchExecuter.java:89)
        at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter.java:132)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:617)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

11:34:04,168 User:System ERROR [admin.patch.PatchExecuter]
=== Failed to apply patch         ===

What could be the problem here? Any idea?

Thanks,
Tim
9 REPLIES 9

dbachem
Champ in-the-making
Champ in-the-making
Hi Tim,

last days i tried a migration from Alfresco 3.0 to 3.2r. Unfortunally a ran into the same problem and don't understand in detail what happens here.
Could you solve the problem in between?

dward
Champ on-the-rise
Champ on-the-rise
It looks like some of your 3.0 groups have 'dangling' references to a non-existent user called "admin". The new 3.2 schema will not allow such dangling references as all group memeberships are now recorded using node child associations.

Anyway, to work around the problem, before upgrading 3.0, please create a user called "admin". You can delete him after the upgrade.

Please log this issue in JIRA so that we can improve the robustness of the upgrade.

Thanks.

dbachem
Champ in-the-making
Champ in-the-making
I hope i have a solution for you, i commented the following text to https://issues.alfresco.com/jira/browse/ALFCOM-3442, which is a ticket referencing to this problem.

In our case, the reason for the failure was, that we have a subtype of "cmSmiley Tongueerson" in our model, the instances of this persons are placed in various workspace folders. Those persons can't be migrated due to implementation of PersonDaoImpl.getPersonOrNull(..). There is a callback containing a SQL statement which uses the concret type (without subtypes of "cmSmiley Tongueerson"!):


        HibernateCallback callback = new HibernateCallback()
        {
            public Object doInHibernate(Session session)
            {
                SQLQuery query = (SQLQuery) session.getNamedQuery(QUERY_PERSON_GET_PERSON_IGNORE_CASE);
                query.setParameter("qnamePropId", qNamePropId);
                query.setParameter("qnameTypeId", qNameTypeId);
                query.setParameter("userNameLowerCase", searchUserName.toLowerCase());      // Lowercase: ETHREEOH-1431
                query.setParameter("False", Boolean.FALSE);
                query.setParameter("storeProtocol", personStoreRef.getProtocol());
                query.setParameter("storeIdentifier", personStoreRef.getIdentifier());
                return query.list();
            }
        };

AFAIK this is the reason for the migration failure.

I could solve the problem deleting these users before migration. Hope this helps!

Kind regards, Dirk

dward
Champ on-the-rise
Champ on-the-rise
This is fixed in HEAD.

tim-erwin
Champ in-the-making
Champ in-the-making
Hi Dirk,

thanks for posting your solution. We don't have any special content types, however. Just a plain Alfresco with a lot of data in there. So, unfortunately, this doesn't help here. I'll try migration again as soon as the next update of Alfresco is out there.

Thanks anyways,
Tim

dbachem
Champ in-the-making
Champ in-the-making
Hello Tim,

just some questions:

  • did you have a user named "admin" in your repository before migration? if not, try what dward recommended and create the user before you start to migrate.

  • do you use LDAP or any other authentication subsystem?

  • if you have the "admin" user in your system, maybe it is not what the PersonDaoImpl expected. It could be located on a different place for instance. so, did you create persons programmatically in your application?
To understand what happens, you should know, that the group objects hold a simple array of user-names, which are belonging to the group. So it seams that there is at least one group referencing to an "admin" user, which doesn't exist. You can easily check this if you use the node-browser and inspect all existing groups.

And finally: if you are going to migrate to community 3.2r (i think you used 3.2 in your tests), possibly you will get another exception: "There is no statement named select.AVMNodeEntitiesCountWhereNewInStore in this SqlMap". You can fix this in only 30 seconds and save a lot of time searching if you follow the patch i posted in the comments section of this jira ticket: https://issues.alfresco.com/jira/browse/ALFCOM-3611?page=com.atlassian.jira.plugin.system.issuetabpa...  :wink:

Dirk


Alfresco Community 3.2rhttp://wiki.alfresco.com/wiki/Alfresco_Community_Edition_3.2r

tim-erwin
Champ in-the-making
Champ in-the-making
Hi Dirk,

thanks a lot for taking time to help me. To answer your questions:

  • we always have and had the admin user that is there by default, we never changed it (except password)

  • we don't have any special authentication system

  • in general, we create users programmatically, however, for testing I used a "naked" system, only the admin user
Regards,
Tim

mudassirshahabu
Champ in-the-making
Champ in-the-making
Tim,

Did you get solution to this problem. If yes, can you share your experience.

Let me share my experience. I ran to this problem and did not performed any migration. I am using 3.1.1 SP 1 and I think problem is with database rather than codebase.

I have same code base working fine with one machine DB. One I switch over to another db problem occurs ….

Thanks.

tim-erwin
Champ in-the-making
Champ in-the-making
mudassirshahabuddin,

so, sorry, no solution so far. We're focusing on other things right now avoiding to even think about that issue… Smiley Sad

Good luck
Tim