Migrating attachments from database to file system fails with transaction log full exception

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

When migrating attachments from database to file system, the migration fails.

The following appears in the atlassian-confluence.log

2015-10-01 17:37:19,939 ERROR [Long running task: Attachment data migration] [confluence.util.longrunning.AttachmentMigrationLongRunningTask] runInternal There was a problem removing all records in the AttachmentData table, while performing a migration task.
 -- url: /admin/doattachmentmigration.action | userName: admin | referer: http://<confluence-base-url>/admin/doeditattachmentstorage.action | action: doattachmentmigration
java.lang.RuntimeException: There was a problem removing all records in the AttachmentData table, while performing a migration task.
  at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernateAttachmentDataDao.clearAttachmentDataTable(HibernateAttachmentDataDao.java:366)

...
Caused by: org.springframework.dao.TransientDataAccessResourceException: StatementCallback; SQL [DELETE FROM ATTACHMENTDATA]; The transaction log for database '<database-name>' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases; nested exception is java.sql.SQLException: The transaction log for database 'confluencedb' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
  at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:106)
  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
...
Caused by: java.sql.SQLException: The transaction log for database '<database-name>' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
  at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
  at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
  at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)

Cause

The transaction log is set at a specific size and is unable to expand as needed.

Resolution

Setting the transaction log to have an auto-growth option instead of 'NONE' should resolve the issue. You may also need to set a larger initial size. 

Please see this support article from Microsoft for more information on tweaking this setting. Also see Troubleshoot a Full Transaction Log from Microsoft for more information on troubleshooting.

Last modified on Mar 30, 2016

Was this helpful?

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