cancel
Showing results for 
Search instead for 
Did you mean: 

1.4 to 2.1 Migration failing

curious_george
Champ in-the-making
Champ in-the-making
Hi,

I am upgrading our existing Alfresco 1.4 environment to Alfresco 2.1. The system environment is JBoss 4.2.2 with JDK 1.5, Linux (Red Hat Enterprise Linux 4), and Oracle 10.2

In theory, all we need to do is place the updated alfresco.war in the deploy directory and Alfresco will perform the necessary upgrade steps automatically. Unfortunately, we receive errors during the initial startup, when Alfresco applies the update patches.

After turning up debugging, the logs show the error is coming from the InvalidNameEnding patch. From the source code (see: http://jsourcery.com/api/sourceforge/alfresco/2.0.0/org/alfresco/repo/admin/patch/impl/InvalidNameEn... ), we can see Alfresco is trying to create a file "./InvalidNameEndingPatch.log". It fails to create the file, throws an Exception, and the whole transaction fails. Please see the end of this post for the stacktraces.

In which directory is Alfresco attempting to create this file? I gave my /tmp and /opt/jboss directories 777 permissions, but this did not remedy the situation.

Most importantly, how do I properly fix this issue so that the Invalid Name Ending patch and other patches get applied?

I did find another user with a similar issue (see: http://forums.alfresco.com/viewtopic.php?p=28112& ). Unfortunately his workaround does not work since I'm not directly calling Tomcat.

I did find a potential workaround - but I am not sure if it will create problems later. If I run JBoss as 'root' immediately after the upgrade, Alfresco will not throw any errors during the application of the patches.

Any help or insight is appreciated. This is a most frustrating issue!

Here are a few of the stacktraces from JBoss server.log:
A portion of the very first exception:

2008-03-22 08:29:36,715(GMT-7) INFO  [STDOUT] 08:29:36,715 INFO  [admin.patch.Pa
tchExecuter] Checking for patches to apply …
2008-03-22 08:29:36,854(GMT-7) INFO  [STDOUT] 08:29:36,852 ERROR [admin.patch.Pa
tchServiceImpl] org.alfresco.error.AlfrescoRuntimeException: Unknown Exception i
n Transaction.
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:292)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:155)
        at org.alfresco.repo.admin.patch.AbstractPatch$1.doWork(AbstractPatch.ja
va:355)
        at org.alfresco.repo.admin.patch.AbstractPatch$1.doWork(AbstractPatch.ja
va:340)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(Au
thenticationUtil.java:260)
        at org.alfresco.repo.admin.patch.AbstractPatch.apply(AbstractPatch.java:
358)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatch(PatchServic
eImpl.java:232)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatchAndDependenc
ies(PatchServiceImpl.java:186)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyPatchAndDependenc
ies(PatchServiceImpl.java:178)
        at org.alfresco.repo.admin.patch.PatchServiceImpl.applyOutstandingPatche
s(PatchServiceImpl.java:127)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
on(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
inpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:154)
        at org.springframework.transaction.interceptor.TransactionInterceptor.in
voke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:210)
        at $Proxy101.applyOutstandingPatches(Unknown Source)
        at org.alfresco.repo.admin.patch.PatchExecuter.applyOutstandingPatches(P
atchExecuter.java:89)
        at org.alfresco.repo.admin.patch.PatchExecuter.onBootstrap(PatchExecuter
.java:132)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLi
fecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1
.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecut
or.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.m
ulticastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:241)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:349)
        at org.springframework.web.context.support.AbstractRefreshableWebApplica
tionContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
        at org.springframework.web.context.ContextLoader.createWebApplicationCon
text(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:49)


The InvalidNamEndingPatch.log error:

Caused by: java.io.FileNotFoundException: ./InvalidNameEndingPatch.log (Permissi
on denied)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
        at org.alfresco.repo.admin.patch.impl.InvalidNameEndingPatch$HibernateHe
lper.<init>(InvalidNameEndingPatch.java:132)
        at org.alfresco.repo.admin.patch.impl.InvalidNameEndingPatch$HibernateHe
lper.<init>(InvalidNameEndingPatch.java:123)
        at org.alfresco.repo.admin.patch.impl.InvalidNameEndingPatch.applyIntern
al(InvalidNameEndingPatch.java:108)
        at org.alfresco.repo.admin.patch.AbstractPatch$1$1.execute(AbstractPatch
.java:350)
        at org.alfresco.repo.admin.patch.AbstractPatch$1$1.execute(AbstractPatch
.java:344)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:225)
        … 167 more
4 REPLIES 4

pmonks
Star Contributor
Star Contributor
As described at http://wiki.alfresco.com/wiki/General_Upgrade_Process, it's not recommended to do an in-place upgrade of the Alfresco binaries, since this results in a newer version of Alfresco that's configured with old configuration files (Spring application contexts).  As described on that page, a better approach is to install the new version of Alfresco from scratch, then configure it to use the original repository (or better yet a copy of it, to facilitate rollback in the event of problems during the upgrade process).

Now as to the specific symptoms you're seeing, they do look like file permission issues, probably somewhere within the /opt/jboss tree (although the exact location depends on how the JBoss startup scripts set the current working directory before starting the JVM - something I don't recall off the top of my head).  Did you recursively apply 777 permissions to everything underneath /opt/jboss?  Is the user that owns /opt/jboss being used to start JBoss as well? Also, can you print out the current working directory in the JBoss startup scripts, immediately prior to the JVM being started?  That may give some better ideas about where that log file is attempting to be created.

Cheers,
Peter

curious_george
Champ in-the-making
Champ in-the-making
I did apply 777 permissions recursively to the /opt/jboss directory. The 'jboss' user is also the owner, and I did ensure that it was also the owner of the alf_data directory and the /tmp/Alfresco directory.

I launched JBoss as the jboss user. The current working directory is /opt/jboss/bin.

I was also able to get Alf 2.1 working only if I wiped out the alf_data directory AND the database schemas (meaning it worked with the configuration files).

Sorry for the delay in responding - I accidentally wiped out my system and only recently got it working!

curious_george
Champ in-the-making
Champ in-the-making
I believe I may have resolved the issue. The key to the problem was indeed the current working directory. I now noticed I was not in /opt/jboss/bin, I was in a different directory. Once I switched to /opt/jboss/bin (or any directory where 'jboss' had write permissions), then the upgrade would work fantastically.

Thanks for your time. I hope this helps other Alfresco users in the future!

pmonks
Star Contributor
Star Contributor
Good find!  And thanks for replying with the solution - it's great to share this stuff with everyone!

Cheers,
Peter