Skip to content

Instantly share code, notes, and snippets.

@quintessence
Last active August 29, 2015 14:16
Show Gist options
  • Save quintessence/42bde5fabd2df3a2d816 to your computer and use it in GitHub Desktop.
Save quintessence/42bde5fabd2df3a2d816 to your computer and use it in GitHub Desktop.
Docker error
#UPDATE 23:33
#I had it output the struct and it looks like only two elements are MIA, "ServiceId" and "Host":
echo -e "ServiceId: \n"
+ echo -e 'ServiceId: \n'
echo -e "Archive: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200.zfs.xz\n"
+ echo -e 'Archive: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200.zfs.xz\n'
echo -e "Volume: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old\n"
+ echo -e 'Volume: 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old\n'
echo -e "Filesystem: zfs\n"
+ echo -e 'Filesystem: zfs\n'
echo -e "ArchiveFormat: xz\n"
+ echo -e 'ArchiveFormat: xz\n'
echo -e "Tag: 1425700200\n"
+ echo -e 'Tag: 1425700200\n'
echo -e "Host: \n"
+ echo -e 'Host: \n'
---
#From 23:02
$ ssh root@${service1Host} less /root/docker-snapshots.log
Fri Mar 6 16:35:01 PST 2015 Restore 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425686791.zfs.xz
Error: No such image or container: CONTAINER
Error response from daemon: No such container: CONTAINER
2015/03/06 16:35:02 Error: failed to stop one or more containers
Error response from daemon: No such container: CONTAINER
2015/03/06 16:35:02 Error: failed to start one or more containers
Fri Mar 6 19:06:23 PST 2015 Restore 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425698029.zfs.xz
+ set -v
dockerId=$(docker ps | awk '//{print $1}');
docker ps | awk '//{print $1}')
docker ps | awk '//{print $1}'
++ awk '//{print $1}'
++ docker ps
+ dockerId='CONTAINER
13a6ce214b03'
[[ ${dockerId} != "" ]] || fail "Container not found.";
+ [[ CONTAINER
13a6ce214b03 != '' ]]
volumeMount=$(docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}');
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}')
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}'
++ awk '-F"' '/data\/db": "/{print $(NF-1)}'
++ docker inspect CONTAINER 13a6ce214b03
Error: No such image or container: CONTAINER
+ volumeMount=/flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
volumeId=$(echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///');
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///')
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///'
++ sed -e 's/\..*$//' -e 's/^.*\///'
++ echo /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ volumeId=7039938f-5acc-46f1-aa11-cd2d8174e65a
fsType=$(df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}'
++ awk '{print $2}'
++ tail -1
++ df -T /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ fsType=zfs
# TODO: Test for (and fail if) mismatch between archive fs and running fs.
case ${fsType} in
(zfs)
volume=$(/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##");
[[ -n ${volume} ]] || fail "ERROR: No Volume Found";
command -v xz &>/dev/null || fail "xz command was not found, please install xz and retry.";
docker stop ${dockerId} # should this be stop/start instead?
/sbin/zfs rollback -r "${pool}/${volume}@${tag}" ||
xz -d -c "${snapshotFile}" | /sbin/zfs recv -F "${pool}/${volume}@${tag}"
docker start ${dockerId}
;;
(xfs)
fail "xfs is not yet supported"
xz -d /snapshots/${volume}@${tag}.xfs.xz
docker stop ${dockerId}
xfsrestore -f /snapshots/${volume}@${tag}.xfs.xz ${volumeMount}
docker start ${dockerId}
;;
(*)
fail "Unsupported filesystem type '${fsType}'."
;;
esac
+ case ${fsType} in
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##")
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##"
++ sed -e 's#^flocker/##'
++ awk '/7039938f-5acc-46f1-aa11-cd2d8174e65a/{print $1}'
++ /sbin/zfs list -r flocker
+ volume=7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ [[ -n 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old ]]
+ command -v xz
+ docker stop CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:06:23 Error: failed to stop one or more containers
+ /sbin/zfs rollback -r flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425698029
+ docker start CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:06:23 Error: failed to start one or more containers
exit 0;
+ exit 0
Fri Mar 6 19:10:41 PST 2015 Restore 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425698290.zfs.xz
+ set -v
dockerId=$(docker ps | awk '//{print $1}');
docker ps | awk '//{print $1}')
docker ps | awk '//{print $1}'
++ awk '//{print $1}'
++ docker ps
+ dockerId='CONTAINER
13a6ce214b03'
[[ ${dockerId} != "" ]] || fail "Container not found.";
+ [[ CONTAINER
13a6ce214b03 != '' ]]
volumeMount=$(docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}');
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}')
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}'
++ awk '-F"' '/data\/db": "/{print $(NF-1)}'
++ docker inspect CONTAINER 13a6ce214b03
Error: No such image or container: CONTAINER
+ volumeMount=/flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
volumeId=$(echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///');
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///')
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///'
++ sed -e 's/\..*$//' -e 's/^.*\///'
++ echo /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ volumeId=7039938f-5acc-46f1-aa11-cd2d8174e65a
fsType=$(df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}'
++ awk '{print $2}'
++ tail -1
++ df -T /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ fsType=zfs
# TODO: Test for (and fail if) mismatch between archive fs and running fs.
case ${fsType} in
(zfs)
volume=$(/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##");
[[ -n ${volume} ]] || fail "ERROR: No Volume Found";
command -v xz &>/dev/null || fail "xz command was not found, please install xz and retry.";
docker stop ${dockerId} # should this be stop/start instead?
/sbin/zfs rollback -r "${pool}/${volume}@${tag}" ||
xz -d -c "${snapshotFile}" | /sbin/zfs recv -F "${pool}/${volume}@${tag}"
docker start ${dockerId}
;;
(xfs)
fail "xfs is not yet supported"
xz -d /snapshots/${volume}@${tag}.xfs.xz
docker stop ${dockerId}
xfsrestore -f /snapshots/${volume}@${tag}.xfs.xz ${volumeMount}
docker start ${dockerId}
;;
(*)
fail "Unsupported filesystem type '${fsType}'."
;;
esac
+ case ${fsType} in
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##")
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##"
++ sed -e 's#^flocker/##'
++ awk '/7039938f-5acc-46f1-aa11-cd2d8174e65a/{print $1}'
++ /sbin/zfs list -r flocker
+ volume=7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ [[ -n 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old ]]
+ command -v xz
+ docker stop CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:10:41 Error: failed to stop one or more containers
+ /sbin/zfs rollback -r flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425698290
+ docker start CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:10:41 Error: failed to start one or more containers
exit 0;
+ exit 0
Fri Mar 6 19:42:35 PST 2015 Restore 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200.zfs.xz
+ set -v
dockerId=$(docker ps | awk '//{print $1}');
docker ps | awk '//{print $1}')
docker ps | awk '//{print $1}'
++ awk '//{print $1}'
++ docker ps
+ dockerId='CONTAINER
13a6ce214b03'
[[ ${dockerId} != "" ]] || fail "Container not found.";
+ [[ CONTAINER
13a6ce214b03 != '' ]]
volumeMount=$(docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}');
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}')
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}'
++ awk '-F"' '/data\/db": "/{print $(NF-1)}'
++ docker inspect CONTAINER 13a6ce214b03
Error: No such image or container: CONTAINER
+ volumeMount=/flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
volumeId=$(echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///');
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///')
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///'
++ sed -e 's/\..*$//' -e 's/^.*\///'
++ echo /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ volumeId=7039938f-5acc-46f1-aa11-cd2d8174e65a
fsType=$(df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}'
++ awk '{print $2}'
++ tail -1
++ df -T /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ fsType=zfs
# TODO: Test for (and fail if) mismatch between archive fs and running fs.
case ${fsType} in
(zfs)
volume=$(/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##");
[[ -n ${volume} ]] || fail "ERROR: No Volume Found";
command -v xz &>/dev/null || fail "xz command was not found, please install xz and retry.";
docker stop ${dockerId} # should this be stop/start instead?
/sbin/zfs rollback -r "${pool}/${volume}@${tag}" ||
xz -d -c "${snapshotFile}" | /sbin/zfs recv -F "${pool}/${volume}@${tag}"
docker start ${dockerId}
;;
(xfs)
fail "xfs is not yet supported"
xz -d /snapshots/${volume}@${tag}.xfs.xz
docker stop ${dockerId}
xfsrestore -f /snapshots/${volume}@${tag}.xfs.xz ${volumeMount}
docker start ${dockerId}
;;
(*)
fail "Unsupported filesystem type '${fsType}'."
;;
esac
+ case ${fsType} in
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##")
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##"
++ sed -e 's#^flocker/##'
++ awk '/7039938f-5acc-46f1-aa11-cd2d8174e65a/{print $1}'
++ /sbin/zfs list -r flocker
+ volume=7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ [[ -n 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old ]]
+ command -v xz
+ docker stop CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:42:35 Error: failed to stop one or more containers
+ /sbin/zfs rollback -r flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200
+ docker start CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:42:35 Error: failed to start one or more containers
exit 0;
+ exit 0
Fri Mar 6 19:49:50 PST 2015 Restore 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200.zfs.xz
+ set -v
dockerId=$(docker ps | awk '//{print $1}');
docker ps | awk '//{print $1}')
docker ps | awk '//{print $1}'
++ awk '//{print $1}'
++ docker ps
+ dockerId='CONTAINER
13a6ce214b03'
[[ ${dockerId} != "" ]] || fail "Container not found.";
+ [[ CONTAINER
13a6ce214b03 != '' ]]
volumeMount=$(docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}');
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}')
docker inspect ${dockerId} | awk -F\" '/data\/db": "/{print $(NF-1)}'
++ docker inspect CONTAINER 13a6ce214b03
++ awk '-F"' '/data\/db": "/{print $(NF-1)}'
Error: No such image or container: CONTAINER
+ volumeMount=/flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
volumeId=$(echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///');
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///')
echo "${volumeMount}" | sed -e 's/\..*$//' -e 's/^.*\///'
++ sed -e 's/\..*$//' -e 's/^.*\///'
++ echo /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ volumeId=7039938f-5acc-46f1-aa11-cd2d8174e65a
fsType=$(df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}')
df -T ${volumeMount} | tail -1 | awk '{print $2}'
++ awk '{print $2}'
++ tail -1
++ df -T /flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ fsType=zfs
# TODO: Test for (and fail if) mismatch between archive fs and running fs.
case ${fsType} in
(zfs)
volume=$(/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##");
[[ -n ${volume} ]] || fail "ERROR: No Volume Found";
command -v xz &>/dev/null || fail "xz command was not found, please install xz and retry.";
docker stop ${dockerId} # should this be stop/start instead?
/sbin/zfs rollback -r "${pool}/${volume}@${tag}" ||
xz -d -c "${snapshotFile}" | /sbin/zfs recv -F "${pool}/${volume}@${tag}"
docker start ${dockerId}
;;
(xfs)
fail "xfs is not yet supported"
xz -d /snapshots/${volume}@${tag}.xfs.xz
docker stop ${dockerId}
xfsrestore -f /snapshots/${volume}@${tag}.xfs.xz ${volumeMount}
docker start ${dockerId}
;;
(*)
fail "Unsupported filesystem type '${fsType}'."
;;
esac
+ case ${fsType} in
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##")
/sbin/zfs list -r ${pool} | awk "/${volumeId}/{print \$1}" | sed -e "s#^${pool}/##"
++ /sbin/zfs list -r flocker
++ awk '/7039938f-5acc-46f1-aa11-cd2d8174e65a/{print $1}'
++ sed -e 's#^flocker/##'
+ volume=7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old
+ [[ -n 7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old ]]
+ command -v xz
+ docker stop CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:49:50 Error: failed to stop one or more containers
+ /sbin/zfs rollback -r flocker/7039938f-5acc-46f1-aa11-cd2d8174e65a.default.mongo-old@1425700200
+ docker start CONTAINER 13a6ce214b03
Error response from daemon: No such container: CONTAINER
2015/03/06 19:49:50 Error: failed to start one or more containers
exit 0;
+ exit 0
$ ssh root@172.16.255.250 docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13a6ce214b03 johnlonganecker/mongodb:2.6.6 "/entrypoint.sh mong 3 hours ago Up 2 minutes 0.0.0.0:27017->27017/tcp flocker--mongo-old
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment