Edgewall Software

Ticket #5222 (reopened defect)

Opened 19 months ago

Last modified 4 weeks ago

trac-admin hotcopy database corruption

Reported by: paul_homer@… Owned by: cmlenz
Priority: high Milestone:
Component: admin/console Version:
Severity: critical Keywords: needinfo
Cc:

Description

When using trac-admin hotcopy in a script run by backup software, after the copy the original Sqlite database trac gets a "database disk image is malformed" error. This problem doesn't happen when running interactively or when running from an interactive shell. It is likely caused from being run as a daemon (and not being attached to a terminal?).

The workaround seems to be to run the command in a bourne shell with all output piped to a file, as in: "trac-admin /trac/repository hotcopy /dst > /tmp/file 2>&1".

Attachments

Change History

Changed 19 months ago by eblot

Which version of Trac are you using?

I wonder whether it could be related to the charset settings.
Could you try to define

export LC_CTYPE=UTF-8

in your backup script, before the trac-admin command ?

Changed 19 months ago by anonymous

The Trac Version is 0.10.3.1. The OS is a vanilla Fedora, generally kept up-to-date with livna. From trac.conf for Apache, TracLocale is set to "en_CA.UTF-8". Running under the backup in the shell, there are several LC variables all set to en_US (LANG is set to en_US.UTF-8.

I've added another test script with your shell variable, it will run tonight. I don't want to mess up the existing backups and I'm not sure how to reproduce the error outside of the backup scripts (cron perhaps?). I'll post another comment tommorrow with the results.

My sense is that trac-admin is trying to write its status message "into" the database, is that true?

Changed 19 months ago by paul_homer@…

I added the export just before the call to trac-admin (and removed the redirects). It continued to fail, but the message in the database file was missing the 'done' part of the string. It turns out that the directory that I was copying to in the hotcopy doesn't exist, so the hotcopy failed with some error. What is really interesting is that the stdout message gets written to the database, while the stderr message goes somewhere else. I havn't found the err message yet, so it may have been sent to /dev/null or the stream may have been closed. Not sure. Doesn't seem like a Locale problem.

Changed 16 months ago by anonymous

  • status changed from new to closed
  • resolution set to fixed

Changed 16 months ago by eblot

  • status changed from closed to reopened
  • resolution fixed deleted

who's anonymous?

Changed 4 weeks ago by rblank

  • keywords needinfo added

Does this still happen with current 0.11.1?

Add/Change #5222 (trac-admin hotcopy database corruption)

Author



Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change from cmlenz. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.