On 26/09/2017 15:13, Bastian Blank wrote:
Hi Mitja
On Tue, Sep 26, 2017 at 01:40:08PM +0200, Mitja Mihelič wrote:
I am having trouble with ftpsync. I am using the ftpsync-cron script. I ran
it manually from the commandline and got the folowing error:
Sep 26 13:29:37 poprovec ftpsync-cron[12403]: Failed to parse archive serial
from http://debian.ethz.ch/debian/project/trace/debian.ethz.ch
Could you please show me the output of "bash -x ftpsync-cron"? For me
this works fine.
But I'll change the script to output the complete content of the trace
file in this condition.
Regards,
Bastian
I took a look at the "bash -x" output. I pasted the relevant lines into
a separate script.
When the double quotes were omitted the extract_trace_serial simply got
an empty set of arguments.
It all led me to make the following change to the ftpsync-cron script:
[ftpsync@poprovec bin]$ diff ftpsync-cron ftpsync-cron_original
423c423
< if ! serial_remote=$(extract_trace_serial <<< "$trace"); then
---
> if ! serial_remote=$(extract_trace_serial <<< $trace); then
426c426
< elif ! serial_local=$(extract_trace_serial "$trace_local"); then
---
> elif ! serial_local=$(extract_trace_serial $trace_local); then
As requested, here is the trace from "bash -x ftpsync-cron". I don't
know if attachments are okay, so here is a direct paste.
I see that the LOGDIR variable at the top of the output is set to
"/home/ftpsync/log". Which is not what I set it to in the config file.
Further down it is seen as LOGDIR=/var/log/mirror/debian. This is what I
set in the config file. Is difference OK?
[ftpsync@poprovec bin]$ bash -x ftpsync-cron
+ set -euE
+ VERSION=20170920
+++ readlink -f ftpsync-cron
++ dirname /home/ftpsync/bin/ftpsync-cron
+ BINDIR=/home/ftpsync/bin
+++ dirname ftpsync-cron
++ readlink -f ./..
+ BASEDIR=/home/ftpsync
+ CONFDIR=/home/ftpsync/etc
+ LOCKDIR=/home/ftpsync/locks
+ LOGDIR=/home/ftpsync/log
+ export BASEDIR
+ ARCHIVE=
+ CONFIG=ftpsync.conf
+ NAME=ftpsync-cron
+ PROGRAM=ftpsync-cron
+ read_config ftpsync.conf
++ echo ftpsync.conf
++ sed -e 's/[^A-Za-z0-9._-]/_/g'
+ local name=ftpsync.conf
++ search_config ftpsync.conf
++ local file
++ '[' /home/ftpsync/etc ']'
++ file=/home/ftpsync/etc/ftpsync.conf
++ '[' -f /home/ftpsync/etc/ftpsync.conf ']'
++ echo /home/ftpsync/etc/ftpsync.conf
++ return
+ local config=/home/ftpsync/etc/ftpsync.conf
+ '[' /home/ftpsync/etc/ftpsync.conf ']'
+ . /home/ftpsync/etc/ftpsync.conf
++ MIRRORNAME=ftp.arnes.si
++ TO=/big/ftp-data/mirrors/debian
++ RSYNC_PATH=debian
++ RSYNC_HOST=debian.ethz.ch
++ INFO_MAINTAINER=ftp-ad...@arnes.si
++ INFO_SPONSOR='ARNES <https://www.arnes.si>'
++ INFO_COUNTRY=SI
++ INFO_THROUGHPUT=1Gb
++ LOGDIR=/var/log/mirror/debian
++ LOG=/var/log/mirror/debian/ftpsync-cron.log
++ MAILTO=root
++ ERRORSONLY=true
++ FULLLOGS=false
++ ARCH_EXCLUDE='alpha amd64 arm arm64 armel armhf hppa ia64 m68k mipsel
mips powerpc ppc64el s390 s390x sparc'
++ HUB=false
++ LOGROTATE=14
++ LOCK=/big/ftp-data/mirrors/debian/Archive-Update-in-Progress-ftp.arnes.si
++
UPDATEREQUIRED=/big/ftp-data/mirrors/debian/Archive-Update-Required-ftp.arnes.si
++ UIPSLEEP=1200
++ UIPRETRIES=3
++ TRACE=project/trace/ftp.arnes.si
+++ hostname -f
++ TRACEHOST=poprovec.arnes.si
++ RSYNC=rsync
++ RSYNC_EXTRA=-a
++ RSYNC_OPTIONS='-prltvHSB8192 --chmod=D755,F644 --timeout 3600 --stats'
++ RSYNC_OPTIONS1='--exclude=Packages* --exclude=Sources*
--exclude=Release* --exclude=InRelease --include=i18n/by-hash/**
--exclude=i18n/* --exclude=ls-lR*'
++ RSYNC_OPTIONS2='--max-delete=40000 --delay-updates --delete
--delete-excluded'
+ CURRENT_CONFIG=/home/ftpsync/etc/ftpsync.conf
+ return 0
+ MAILTO=root
+ MIRRORNAME=ftp.arnes.si
+ LOCK=/big/ftp-data/mirrors/debian/Archive-Update-in-Progress-ftp.arnes.si
+ RSYNC_PATH=debian
+ TRACE_UPSTREAM=project/trace/debian.ethz.ch
+ cmp_trace
+ local trace_uri=http://debian.ethz.ch/debian/project/trace/debian.ethz.ch
+ local
trace_local=/big/ftp-data/mirrors/debian/project/trace/debian.ethz.ch
+ local trace ret
+ [[ -e
/big/ftp-data/mirrors/debian/Archive-Update-in-Progress-ftp.arnes.si ]]
++ curl --silent --fail --show-error --location
http://debian.ethz.ch/debian/project/trace/debian.ethz.ch
+ trace='Thu Sep 28 03:13:07 UTC 2017
Date: Thu, 28 Sep 2017 03:13:07 +0000
Date-Started: Thu, 28 Sep 2017 03:07:43 +0000
Archive serial: 2017092801
Used ftpsync version: 20170204
Running on host: plattenberg.ethz.ch
Architectures: all amd64 arm64 armel armhf hurd-i386 i386 ia64
kfreebsd-amd64 kfreebsd-i386 mips mips64el mipsel powerpc ppc64el s390
s390x source sparc
Architectures-Configuration: ALL
Upstream-mirror: syncproxy2.eu.debian.org
SSL: false
Total bytes received in rsync: 2483023385
Total time spent in stage1 rsync: 250
Total time spent in stage2 rsync: 74
Total time spent in rsync: 324
Average rate: 7663652 B/s'
+ ret=0
+ [[ 0 != 0 ]]
++ extract_trace_serial
+++ awk '-F: ' ' $1=="Archive serial" {print $2}'
++ local serial=
++ [[ -n '' ]]
++ return 1
+ serial_remote=
+ error 'Failed to parse archive serial from
http://debian.ethz.ch/debian/project/trace/debian.ethz.ch'
+ log 'Failed to parse archive serial from
http://debian.ethz.ch/debian/project/trace/debian.ethz.ch'
+ [[ -z ftpsync-cron ]]
++ date '+%b %d %H:%M:%S'
++ hostname -s
+ echo 'Sep 28 09:32:21 poprovec ftpsync-cron[29806]: Failed to parse
archive serial from
http://debian.ethz.ch/debian/project/trace/debian.ethz.ch'
Sep 28 09:32:21 poprovec ftpsync-cron[29806]: Failed to parse archive
serial from http://debian.ethz.ch/debian/project/trace/debian.ethz.ch
+ [[ -n root ]]
+ echo 'Failed to parse archive serial from
http://debian.ethz.ch/debian/project/trace/debian.ethz.ch'
++ hostname -s
+ mailx -e -s '[ftpsync-cron@poprovec] ERROR [29806]' root
+ exit 1
Regards,
Mitja