Unexpected Token Error when Creating an XML Backup
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Crowd throws a stack trace when you try to create an XML site export.
The following appears in the atlassian-crowd.log
:
1
2
3
4
5
6
7
8
9
2012-02-23 19:50:14,983 http-8095-1 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: -11, SQLState: 37000
2012-02-23 19:50:14,983 http-8095-1 ERROR [org.hibernate.util.JDBCExceptionReporter] Unexpected token: ) in statement [select this_.id as id24_0_, this_.parent_id as parent2_24_0_, this_.child_id as child3_24_0_, this_.membership_type as membership4_24_0_, this_.group_type as group5_24_0_, this_.parent_name as parent6_24_0_, this_.lower_parent_name as lower7_24_0_, this_.child_name as child8_24_0_, this_.lower_child_name as lower9_24_0_, this_.directory_id as directory10_24_0_ from cwd_membership this_ where this_.directory_id in ()]
2012-02-23 19:50:14,983 http-8095-1 INFO [atlassian.xwork.interceptors.TransactionalInvocation] Invoking rollback for transaction on action '/console/secure/admin/backup.action (Backup.default())' due to throwable: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)
at com.atlassian.crowd.dao.membership.MembershipDAOHibernate.findAll(MembershipDAOHibernate.java:292)
Cause
You do not have at least one INTERNAL or DELEGATING directory type in your Crowd instance. WIthout this, the nested query in the failing SQL statement becomes an empty set. Crowd will create an INTERNAL directory by default when you first set it up, so the directory was removed.
Resolution
Create an internal directory and attempt the export again.
ℹ️ If you continue to have issues creating an export, contact Atlassian Support.
Was this helpful?