BUG: restore from xml.zip failed
Asked by Jack Wu:

When I try to restore the confluence site it gives me the error: null index column for collection: com.atlassian.crowd.model.application.ApplicationImpl.directoryMappings

I checked the contents of entities.xml and found that listIndex was handled incorrectly, which eventually led to an exception.

xml content:

\<object class="DirectoryMapping" package="com.atlassian.crowd.model.application"\>  
\<id name="id"\>163841\</id\>  
\<property name="allowAllToAuthenticate"\>true\</property\>  
\<property name="listIndex" column="list_index"\>0\</property\>

After restoration, list_Index is set to null.

```
mysql> select * from cwd_app_dir_mapping;+--------+----------------+--------------+-------- ---+----------------+| id | application_id | directory_id | allow_all | list_index |+--------+----------------+--------------+-------- ---+----------------+| 163841 | 98305 | 131073 | T | NULL |+--------+----------------+--------------+-------- ---+----------------+
```

Before restore, the value of list_index is 0, if I set it to 0 manually, confluence will work fine.

```
mysql> select * from cwd_app_dir_mapping;+--------+----------------+--------------+-------- ---+----------------+| id | application_id | directory_id | allow_all | list_index |+--------+----------------+--------------+-------- ---+----------------+| 163841 | 98305 | 131073 | T | 0 |+--------+----------------+--------------+-------- ---+----------------+1 row in set (0.01 sec)
```

I checked the hibernate configuration and found that it seems that the correct cloumn is not configured for listIndex?

```
<class name="com.atlassian.crowd.model.application.DirectoryMapping" table="cwd_app_dir_mapping">        <cache usage="read-write"/>        <id name="id" column="id" unsaved-value="null">            <generator class="com.atlassian.confluence.impl.hibernate.ResettableTableHiLoGeneratorV5"/>        </id>        <many-to-one name="application" class="com.atlassian.crowd.model.application.ApplicationImpl"                     update="false" insert="true" column="application_id" index="idx_app_dir_app"/>        <many-to-one name="directory" class="com.atlassian.crowd.model.directory.DirectoryImpl"                     column="directory_id" foreign-key="fk_app_dir_dir" index="idx_app_dir_dir" not-null="true"/>        <property name="allowAllToAuthenticate" type="true_false" not-null="true" column="allow_all"/>        <set name="authorisedGroups" inverse="true" cascade="all-delete-orphan" optimistic-lock="false">            <cache usage="read-write"/>            <key column="app_dir_mapping_id"/>            <one-to-many class="com.atlassian.crowd.model.application.GroupMapping"/>        </set>        <set name="allowedOperations" table="cwd_app_dir_operation" cascade="all" optimistic-lock="false">            <cache usage="read-write"/>            <key column="app_dir_mapping_id" foreign-key="fk_app_dir_mapping"/>            <element column="operation_type" length="32" not-null="true" type="com.atlassian.crowd.embedded.hibernate2.types.OperationPersistentType"/>        </set>    </class>
```


Answers:
author: Dan Breyen
body: Hi [@Jack Wu](/t5/user/viewprofilepage/user-id/5335418) welcome to the community. I took at quick look at Atlassian's Jira site (jira.atlassian.com) and didn't find anything that resembles this issue, but I could have missed it.

If the exporting isn't creating indexes correctly, you may want to contact support (support.atlassian.com/contact) and get some feedback from them.


Tags: confluence-server

server