Open szepeviktor opened 9 years ago
@puzzle1536 I get this once in two weeks from a daily backup.
Hi, I have the same error every week. I don't know the origin ? But when I have this error, hubic.py return no error code, $? = 0
So it is not possible to test the result to retry.
@puzzle1536 Could you help?
This is how it can be detected in Bash: error code and stderr output.
HUBIC="/usr/local/bin/hubic.py --config=/home/bck/database/.hubic.cfg"
SWIFT_STDERR="$(mktemp)"
trap "rm -f '$SWIFT_STDERR' &> /dev/null" EXIT
# Communicate with object storage
Swift() {
local -i RET="-1"
local -i TRIES="3"
local -i TRY="0"
while [ "$((TRY++))" -lt "$TRIES" ]; do
# Empty error message
echo -n "" > "$SWIFT_STDERR"
# Be verbose on console and on "swift stat"
if tty --quiet || [ "stat" == "$1" ]; then
${HUBIC} -v --swift -- -v "$@" 2> "$SWIFT_STDERR"
RET="$?"
else
${HUBIC} --swift -- -q "$@" > /dev/null 2> "$SWIFT_STDERR"
RET="$?"
fi
# OK
if [ "$RET" -eq 0 ] && ! grep -qv "^[A-Z_]\+=\S\+$" "$SWIFT_STDERR"; then
break
fi
echo -n "Swift ERROR ${RET} during ($*), error message: " >&2
cat "$SWIFT_STDERR" >&2
RET="255"
# Wait for object storage
sleep 60
done
return "$RET"
}
Swift download --output "${ID}-00000.zpaq" "$CONTAINER" "${ID}/${ID}-00000.zpaq"
@szepeviktor : Thanks I will test that
Is it hubic-wrapper-to-swift missing authorization or a hubiC failure?