cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrading 1.2.1 to 1.3.0 (Store does not have a root node)

rgauss
Champ in-the-making
Champ in-the-making
Yes, yet another upgrade problem post, hope I didn't miss an already posted solution to this.

After fixing the case errors in the upgrade script (and adding those notes to the wiki) and successfully completing the MySQL changes, replacing the alfresco.war with the 1.3.0, then starting up Tomcat I get:


INFO: Deploying web application archive alfresco.war
Jul 31, 2006 2:37:24 PM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Jul 31, 2006 2:37:25 PM net.sf.joott.uno.UnoConnection connect
INFO: connected
Jul 31, 2006 2:37:25 PM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Jul 31, 2006 2:37:25 PM net.sf.joott.uno.UnoConnection connect
INFO: connected
14:37:25,644 ERROR [web.context.ContextLoader] Context initialization failed
org.alfresco.service.cmr.repository.InvalidStoreRefException: Store does not have a root node
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getRootNode(DbNodeServiceImpl.java:206)
        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:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:165)
        at $Proxy2.getRootNode(Unknown Source)
        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:585)
        at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:212)
        at $Proxy3.getRootNode(Unknown Source)
        at org.alfresco.repo.descriptor.DescriptorServiceImpl.getDescriptorNodeRef(DescriptorServiceImpl.java:291)
        at org.alfresco.repo.descriptor.DescriptorServiceImpl.updateCurrentRepositoryDescriptor(DescriptorServiceImpl.java:254)
        at org.alfresco.repo.descriptor.DescriptorServiceImpl.access$300(DescriptorServiceImpl.java:61)
        at org.alfresco.repo.descriptor.DescriptorServiceImpl$1.doWork(DescriptorServiceImpl.java:185)
        at org.alfresco.repo.descriptor.DescriptorServiceImpl$1.doWork(DescriptorServiceImpl.java:176)
        at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:168)
        at org.alfresco.repo.transaction.TransactionUtil.executeInUserTransaction(TransactionUtil.java:74)
        at org.alfresco.repo.descriptor.DescriptorServiceImpl.onApplicationEvent(DescriptorServiceImpl.java:191)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:45)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:225)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:323)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

I've tried this several times on freshly restored backups of the entire Tomcat directory and a fresh restore then migration of the database with no migration errors.

Another thing I do see the first time I try to startup with the new war is this error:

INFO: Deploying web application archive alfresco.war
14:25:21,103 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF32A0F28D72 (child_protocol, child_identifier, child_guid), add constraint FKC6EFFF32A0F28D72 foreign key (child_protocol, child_identifier, child_guid) references node (protocol, identifier, guid)
14:25:21,129 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table './alfresco/#sql-6b7_23b.frm' (errno: 150)
14:25:21,157 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF3294135688 (parent_protocol, parent_identifier, parent_guid), add constraint FKC6EFFF3294135688 foreign key (parent_protocol, parent_identifier, parent_guid) references node (protocol, identifier, guid)
14:25:21,186 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table './alfresco/#sql-6b7_23b.frm' (errno: 150)
So I applied those manually in MySQL with no problem, still no help though.

Here's what my store table looks like:

mysql> select * from store;
+———–+————————-+————–+—————+—————–+———–+
| protocol  | identifier              | root_node_id | root_protocol | root_identifier | root_guid |
+———–+————————-+————–+—————+—————–+———–+
| system    | system                  |            7 | NULL          | NULL            | NULL      |
| user      | alfrescoUserStore       |            2 | NULL          | NULL            | NULL      |
| workspace | lightWeightVersionStore |            1 | NULL          | NULL            | NULL      |
| workspace | SpacesStore             |           10 | NULL          | NULL            | NULL      |
+———–+————————-+————–+—————+—————–+———–+
And looking for those nodes:

mysql> select * from node where id=7 or id=2 or id=1 or id=10;
+—-+———–+————————-+————————————–+——————————————————+——–+——+
| id | protocol  | identifier              | uuid                                 | type_qname                                           | acl_id | guid |
+—-+———–+————————-+————————————–+——————————————————+——–+——+
|  1 | workspace | lightWeightVersionStore | 7ca18576-e01b-11da-aa9a-350f095ca7f2 | {http://www.alfresco.org/model/system/1.0}store_root |      1 | NULL |
|  2 | user      | alfrescoUserStore       | 7dc481a9-e01b-11da-aa9a-350f095ca7f2 | {http://www.alfresco.org/model/system/1.0}store_root |   NULL | NULL |
|  7 | system    | system                  | 7e6ca890-e01b-11da-aa9a-350f095ca7f2 | {http://www.alfresco.org/model/system/1.0}store_root |   NULL | NULL |
| 10 | workspace | SpacesStore             | 7e990fc5-e01b-11da-aa9a-350f095ca7f2 | {http://www.alfresco.org/model/system/1.0}store_root |      5 | NULL |
+—-+———–+————————-+————————————–+——————————————————+——–+——+
Very frustrating.  Any thoughts?

Thanks.
6 REPLIES 6

derek
Star Contributor
Star Contributor
Hi,

14:25:21,103 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF32A0F28D72 (child_protocol, child_identifier, child_guid), add constraint FKC6EFFF32A0F28D72 foreign key (child_protocol, child_identifier, child_guid) references node (protocol, identifier, guid)
After the upgrade using the script, the child_assoc table will look as follows:

+—————-+————–+——+—–+———+—————-+
| Field          | Type         | Null | Key | Default | Extra          |
+—————-+————–+——+—–+———+—————-+
| id             | bigint(20)   | NO   | PRI |         | auto_increment |
| parent_node_id | bigint(20)   | YES  | MUL |         |                |
| child_node_id  | bigint(20)   | YES  | MUL |         |                |
| type_qname     | varchar(255) | NO   |     |         |                |
| qname          | varchar(255) | NO   |     |         |                |
| is_primary     | bit(1)       | YES  |     |         |                |
| assoc_index    | int(11)      | YES  |     |         |                |
+—————-+————–+——+—–+———+—————-+

Which WIKI page have you put the changes on?
Please check the version of the WAR file you are using, and confirm post-upgrade script execution structure of the child_assoc table.

Regards

rgauss
Champ in-the-making
Champ in-the-making
Thanks for the response.

Here's my child_assoc immediately after the SQL script:
mysql> describe child_assoc;
+—————-+————–+——+—–+———+—————-+
| Field          | Type         | Null | Key | Default | Extra          |
+—————-+————–+——+—–+———+—————-+
| id             | bigint(20)   |      | PRI | NULL    | auto_increment |
| parent_node_id | bigint(20)   | YES  | MUL | NULL    |                |
| child_node_id  | bigint(20)   | YES  | MUL | NULL    |                |
| type_qname     | varchar(255) |      |     |         |                |
| qname          | varchar(255) |      |     |         |                |
| is_primary     | tinyint(1)   | YES  |     | NULL    |                |
| assoc_index    | int(11)      | YES  |     | NULL    |                |
+—————-+————–+——+—–+———+—————-+
But after trying to startup with the new WAR I get:
mysql> describe child_assoc;
+——————-+————–+——+—–+———+—————-+
| Field             | Type         | Null | Key | Default | Extra          |
+——————-+————–+——+—–+———+—————-+
| id                | bigint(20)   |      | PRI | NULL    | auto_increment |
| parent_node_id    | bigint(20)   | YES  | MUL | NULL    |                |
| child_node_id     | bigint(20)   | YES  | MUL | NULL    |                |
| type_qname        | varchar(255) |      |     |         |                |
| qname             | varchar(255) |      |     |         |                |
| is_primary        | tinyint(1)   | YES  |     | NULL    |                |
| assoc_index       | int(11)      | YES  |     | NULL    |                |
| isPrimary         | tinyint(1)   | YES  |     | NULL    |                |
| parent_protocol   | varchar(50)  | YES  | MUL | NULL    |                |
| parent_identifier | varchar(100) | YES  |     | NULL    |                |
| parent_guid       | varchar(36)  | YES  |     | NULL    |                |
| child_protocol    | varchar(50)  | YES  | MUL | NULL    |                |
| child_identifier  | varchar(100) | YES  |     | NULL    |                |
| child_guid        | varchar(36)  | YES  |     | NULL    |                |
+——————-+————–+——+—–+———+—————-+
Which WIKI page have you put the changes on?
The changes I made were to this section:
http://wiki.alfresco.com/wiki/Upgrading_to_1.3.0#Installing_from_1.2.1_to_1.3.0
I just included what was relavent from upgrade.txt in the dist and the case changes.

Please check the version of the WAR file you are using
I'm using the WAR from alfresco-community-war-1.3.0.tar.gz

Thanks again.

trying2alfresco
Champ in-the-making
Champ in-the-making
I am having the same same problem. Any ideas how to solve it?

egabbud
Champ in-the-making
Champ in-the-making
Same problem here!

We did an upgrade from 1.2 (Enterprise) to 1.2.1 (Community). Everything ok.

But the 1.3 upgrade is a nightmare!

In the 1.2.1 we have, for child_assoc:

+——————-+————–+——+—–+———+——-+
| Field             | Type         | Null | Key | Default | Extra |
+——————-+————–+——+—–+———+——-+
| id                | bigint(20)   | NO   | PRI | 0       |       |
| type_qname        | varchar(255) | NO   |     | NULL    |       |
| qname             | varchar(255) | NO   |     | NULL    |       |
| isPrimary         | tinyint(1)   | YES  |     | NULL    |       |
| assoc_index       | int(11)      | YES  |     | NULL    |       |
| parent_protocol   | varchar(50)  | YES  | MUL | NULL    |       |
| parent_identifier | varchar(100) | YES  |     | NULL    |       |
| parent_guid       | varchar(36)  | YES  |     | NULL    |       |
| child_protocol    | varchar(50)  | YES  | MUL | NULL    |       |
| child_identifier  | varchar(100) | YES  |     | NULL    |       |
| child_guid        | varchar(36)  | YES  |     | NULL    |       |
+——————-+————–+——+—–+———+——-+

After running successfully  the db upgrade script to 1.3 (with case corrected, refer to: http://forums.alfresco.com/viewtopic.php?t=2892), we have:

+—————-+————–+——+—–+———+—————-+
| Field          | Type         | Null | Key | Default | Extra          |
+—————-+————–+——+—–+———+—————-+
| id             | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| parent_node_id | bigint(20)   | YES  | MUL | NULL    |                |
| child_node_id  | bigint(20)   | YES  | MUL | NULL    |                |
| type_qname     | varchar(255) | NO   |     | NULL    |                |
| qname          | varchar(255) | NO   |     | NULL    |                |
| is_primary     | bit(1)       | YES  |     | NULL    |                |
| assoc_index    | int(11)      | YES  |     | NULL    |                |
+—————-+————–+——+—–+———+—————-+

So obviously some columns are deleted from the table.

We then replace the alfresco.war with the one from     alfresco-community-tomcat-1.3.0.tar.gz. It starts and throws:
14:31:07,810 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF32A0F28D72 (child_protocol, child_identifier, child_guid), add constraint FKC6EFFF32A0F28D72 foreign key (child_protocol, child_identifier, child_guid) references node (protocol, identifier, guid)
14:31:07,830 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table './alfresco/#sql-3950_89.frm' (errno: 150)
14:31:07,843 ERROR [tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table child_assoc add index FKC6EFFF3294135688 (parent_protocol,
parent_identifier, parent_guid), add constraint FKC6EFFF3294135688 foreign key (parent_protocol, parent_identifier, parent_guid) references node (protocol, identifier, guid)
14:31:07,843 ERROR [tool.hbm2ddl.SchemaUpdate] Can't create table './alfresco/#sql-3950_89.frm' (errno: 150)

followed by
14:31:25,594 ERROR [web.context.ContextLoader] Context initialization failed
org.alfresco.service.cmr.repository.InvalidStoreRefException: Store does not have a root node
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getRootNode(DbNodeServiceImpl.java:206)

and many other errors.

The question is:
Why is it trying to alter child_assoc and add an index on UNEXISTING FIELDS at this moment??

As hibernate.hbm2ddl.auto=update is set in classes/alfresco/domain/hibernate-cfg.properties, the tables are then updated, to the following:

+——————-+————–+——+—–+———+—————-+
| Field             | Type         | Null | Key | Default | Extra          |
+——————-+————–+——+—–+———+—————-+
| id                | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| parent_node_id    | bigint(20)   | YES  | MUL | NULL    |                |
| child_node_id     | bigint(20)   | YES  | MUL | NULL    |                |
| type_qname        | varchar(255) | NO   |     | NULL    |                |
| qname             | varchar(255) | NO   |     | NULL    |                |
| is_primary        | bit(1)       | YES  |     | NULL    |                |
| assoc_index       | int(11)      | YES  |     | NULL    |                |
| isPrimary         | bit(1)       | YES  |     | NULL    |                |
| parent_protocol   | varchar(50)  | YES  |     | NULL    |                |
| parent_identifier | varchar(100) | YES  |     | NULL    |                |
| parent_guid       | varchar(36)  | YES  |     | NULL    |                |
| child_protocol    | varchar(50)  | YES  |     | NULL    |                |
| child_identifier  | varchar(100) | YES  |     | NULL    |                |
| child_guid        | varchar(36)  | YES  |     | NULL    |                |
+——————-+————–+——+—–+———+—————-+

I guess there are errors in Node.hbm.xml or somewhere around this point… Have you identied the issues yet?
Why do we now have is_primary and isPrimary fields???
How can we eventualy update to the 1.3?

Thanks,
Emmanuel

derek
Star Contributor
Star Contributor
Hi,

They're the scripts for the 1.3 line, which is currently at 1.3.1.  If you have the enterprise release of 1.3.1, then it'll work.  If you are using the Open Source version, then you'll need the latest code off HEAD in order to be compatible with the scripts.

Otherwise you are running scripts that are designed for later code.  The war node.hbm.xml is too old for the scripts.  Build a war from HEAD and then do the upgrade again and you should be fine.

Regards

egabbud
Champ in-the-making
Champ in-the-making
Derek, thanks for your help!
But I still get exactly the same errors…

I checked the latest version from SVN.
- HEAD/root/projects/installer/upgrade/scripts/AlfrescoSchemaMigrate-1.3-mysql.sql is still containing case errors (which I corrected manually). DB migration is fine.
- HEAD/root/projects/repository/source/java/org/alfresco/repo/domain/hibernate/Node.hbm.xml has not changed since many revisions, in countrary of what I understood from your latest post.

So clearly, upgrading from 1.2.1 to 1.3 latest code off HEAD still doesn't work!  Quite weird…