Issue Details (XML | Word | Printable)

Key: MBS-4976
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Andy Hawkins
Reporter: Andy Hawkins
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MusicBrainz Server

slave.sh fails to run

Created: 06/Jul/12 06:38 PM   Updated: 09/Jul/12 01:24 PM   Resolved: 09/Jul/12 01:24 PM
Component/s: Scripts
Affects Version/s: Bug fixes, 2012-06-25
Fix Version/s: Bug fixes, 2012-07-23


 Description  « Hide

Since updating to the latest tag, slave.sh has failed to run:

Can't locate Carton/CLI.pm in @INC (@INC contains:
+local/lib/perl5/i486-linux-gnu-thread-multi local/lib/perl5 .
+/usr/share/perl/5.10 /usr/lib/perl/5.10) at /usr/local/bin/carton line 7.
BEGIN failed--compilation aborted at /usr/local/bin/carton line 7.
Can't locate Carton/CLI.pm in @INC (@INC contains:
+local/lib/perl5/i486-linux-gnu-thread-multi local/lib/perl5 .
+/usr/share/perl/5.10 /usr/lib/perl/5.10) at /usr/local/bin/carton line 7.
BEGIN failed--compilation aborted at /usr/local/bin/carton line 7.
/home/mbserver/musicbrainz-server/admin/cron/slave.sh: line 12: /slave.log:
+Permission denied
Fri Jul 6 19:22:02 BST 2012 : LoadReplicationChanges failed (rc=1) - see
+/slave.log
error: error creating state file /.logrotate-state: Permission denied
error: stat of /slave.log failed: No such file or directory
error: could not read state file, will not attempt to write into it

Discussed it with ianmcorvidae on IRC, and he suggested the following patch:

diff --git a/admin/cron/slave.sh b/admin/cron/slave.sh
index 0a4ce35..35495e3 100755
— a/admin/cron/slave.sh
+++ b/admin/cron/slave.sh
@@ -9,7 +9,7 @@ carton exec – ./admin/config.sh
X=${SLAVE_LOG:=$MB_SERVER_ROOT/slave.log}
X=${LOGROTATE:=/usr/sbin/logrotate --state $MB_SERVER_ROOT/.logrotate-state}

-./admin/replication/LoadReplicationChanges >> $SLAVE_LOG 2>&1 || { +carton exec -- ./admin/replication/LoadReplicationChanges >> $SLAVE_LOG 2>&1 || RC=$? echo `date`" : LoadReplicationChanges failed (rc=$RC) - see $SLAVE_LOG" }

This appears to have fixed the issue.