Unexpected Token Error when Creating an XML Backup

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. Crowd throws a stack trace when you try to create an XML site export.

The following appears in the atlassian-crowd.log:

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

  1. Create an internal directory and attempt the export again.
    (info) If you continue to have issues creating an export, contact Atlassian Support.

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.