-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Normal
-
None
-
None
I have been running a replica MusicBrainz-Docker instance and database for 4-5 weeks. Replication worked fine for a few weeks. However, I do not see any rotated copies of the replication log file, mirror.log.
How to reproduce
- Create a MusicBrainz-server docker instance per instructions at Readme.
- Allow instance to run for a few days, with replication job running at 03Z daily.
- In the musicbrainz-1 container, in directory `/musicbrainz-server/`, examine the files named `mirror.*`
Observed behaviour
There is only one such file:
# ls mirror.*
mirror.log
Expected behaviour
There are up to 31 such files, with numbered filename extensions:
# ls mirror.*
mirror.log
mirror.log.1
...
mirror.log.30
Dicussion
It appears that the script /musicbrainz-server/admin/cron/mirror.sh seeks to rotate the mirror.log file. The relevant lines seem to be:
X=${LOGROTATE:=/usr/sbin/logrotate --state $MB_SERVER_ROOT/.logrotate-state}
… and …
$LOGROTATE /dev/stdin <<EOF
$MIRROR_LOG {
daily
rotate 30
}
EOF
According to the logrotate(8) man page, as I read it, this should accumulate each day’s mirror.log as files with numbered extensions. However, when I run that command manually from the container's shell, using the -v option for verbose output, I see an error message:
X=${LOGROTATE:=/usr/sbin/logrotate --state $MB_SERVER_ROOT/.logrotate-state}
# #
# echo $MIRROR_LOG $LOGROTATE
/mirror.log /usr/sbin/logrotate --state /.logrotate-state
# $LOGROTATE -v /dev/stdin <<EOF
$MIRROR_LOG {
daily
rotate 30
}
EOF> > > > >
Ignoring /dev/stdin because it's not a regular file.
Creating stub state file: /.logrotate-state
Reading state from file: /.logrotate-state
Allocating hash table for state file, size 64 entries
Handling 0 logs
# ls mirror.*
mirror.log
What I take from the diagnostic, "Ignoring /dev/stdin because it's not a regular file", is that the admin/cron/mirror.sh script should set up the logrotate configuration in some conventional file, and refer to that file, instead of trying to deliver the configuration on the fly using stdin.
Related Metabrainz community discussion: https://community.metabrainz.org/t/replication-error-current-row-contains-a-different-value-than-the-replication-packet-suggests-it-should-have/813698?u=jim_delahunt .