Restic restore latest gives "no snapshot ID specified"

For the life of me, based on the output of restic restore help, I cannot see what I did wrong.

sudo B2_ACCOUNT_ID=“xxxxx” B2_ACCOUNT_KEY=“xxxxxxxxx” RESTIC_REPOSITORY=“b2:xxxxxx” RESTIC_PASSWORD_FILE="/home/ubuntu/restic/root/restic-pw.txt" TMPDIR="/media/vgcloud/lvcloud/tmp" restic restore latest –-target /home/ubuntu –-include /home/ubuntu/crontab/overnight --cache-dir /media/vgcloud/lvcloud/restic/ovharchiveroot
Fatal: no snapshot ID specified

Version 0.8.0 running on Ubuntu 17.10

This is the syntax for the restore command: restic restore [flags] snapshotID

You should probably put the flags for the restore command before the snapshot. As it is right now, you don’t have a snapshot at the very end of the command line.

You might also need to move the global flags (e.g. --cache-dir) to before the restore command, but I don’t know if that’s a requirement. It would be more proper though, so it’s restic [global flags] <command> [command flags] [command data/options].

Thanks for the response. I tried moving the global flags to before the command but still get the error.

Specifying “latest” should eliminate the specification of the snapshot ID, as I read the documentation. There is even an example on http://restic.readthedocs.io/en/latest/050_restore.html
restic -r /tmp/backup restore latest --target /tmp/restore-art --path "/home/art" --host luigi

I also tried moving “latest” to the end of the line, where snapshot ID should be, but same error.

Do you get a good list of snapshots if you run the snapshots command?

FWIW this works fine for me: restic -r sftp://HOST/restic restore latest --target mnt

Yes, I get a list of snapshots when I replace “restore” and all the non-global flags with “list snapshots”.

Sounds like time to submit it as a possible bug.

Again, thank you so much for your help!

I don’t think this is a bug. Can you please paste the output of restic snapshots (not restic list snapshots)?

What are you trying to achieve with the the parameter --path /home/art? This filters which snapshots restic will consider when using latest as the snapshot ID, and it must match exactly:

--path path         only consider snapshots which include this (absolute) path for snapshot ID "latest"

Do you have a snapshot which includes /home/art exactly?

Try running restic snapshots --path /home/art, does that print any snapshots?

If that’s the case the message should probably be improved :slight_smile:

Oops, things are getting a little confusing here.
restic -r /tmp/backup restore latest --target /tmp/restore-art --path "/home/art" --host luigi
is the example on http://restic.readthedocs.io/en/latest/050_restore.html

I’m doing
restic --cache-dir /media/vgcloud/lvcloud/restic/ovharchiveroot restore latest –-target /home/ubuntu –-include /home/ubuntu/crontab/overnight

Here are the results of
restic --cache-dir /media/vgcloud/lvcloud/restic/ovharchiveroot snapshots

password is correct
ID        Date                 Host                      Tags        Directory
----------------------------------------------------------------------
8a60b5ae  2017-12-31 00:05:22  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
c354a829  2018-01-01 00:05:25  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
f3d79c78  2018-01-02 00:05:23  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
3ab37970  2018-01-03 00:05:13  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
77d0d69e  2018-01-04 00:05:12  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
2942ce4d  2018-01-05 00:05:19  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
f9ad0b09  2018-01-06 00:05:12  archive.joncomputing.com          ┌── /
                                                                 └── /media/vgcloud/lvcloud
----------------------------------------------------------------------
7 snapshots

Have you tried ditching the --include, just to see if it makes a difference (you can cancel the restore once you see if it does)?

restic --cache-dir /media/vgcloud/lvcloud/restic/ovharchiveroot restore latest –-target /home/ubuntu
Fatal: no snapshot ID specified

Interesting. There’s nothing else to remove, except the --cache-dir option :smiley: Which I suppose you already tried, thinking it could be some hiccup with the cache.

I will need to put together a test case to try that, as the current backup is 2.1GB, and removing the Cache Directory would probably mean a large download from B2 (object storage).

I’ll be back after I’ve done that.

Sorry for the inconvenience, and much thanks for your patience in figuring this out.

It’s very possible the @fd0 has a better idea, mine was just a long shot. So if you want you can always wait and see what he says before you start testing without the cache option.

You could also try with the latest release or even master, instead of 0.8.0. The latest release is 0.8.1 and is available on GitHub at https://github.com/restic/restic/releases, and the latest master you can get from https://beta.restic.net or by cloning the repository and running go run build.go in it to build the restic binary.

ubuntu@archive:~$ sudo B2_ACCOUNT_ID="xxxxxxxxxx" B2_ACCOUNT_KEY="xxxxxxxxxx" RESTIC_REPOSITORY="b2:ovhrestic" RESTIC_PASSWORD_FILE="/home/ubuntu/restic/root/restic-pw.txt" TMPDIR="/media/vgcloud/lvcloud/tmp" restic init -o b2.connections=7
created restic backend 8475cf2ddb at b2:ovhrestic

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
ubuntu@archive:~$ sudo B2_ACCOUNT_ID="xxxxxxxxxx" B2_ACCOUNT_KEY="xxxxxxxxxx" RESTIC_REPOSITORY="b2:ovhrestic" RESTIC_PASSWORD_FILE="/home/ubuntu/restic/root/restic-pw.txt" TMPDIR="/media/vgcloud/lvcloud/tmp" restic backup /home/ubuntu
password is correct
scan [/home/ubuntu]
scanned 30 directories, 58 files in 0:00
[0:08] 100.00%  2.431 MiB/s  19.448 MiB / 19.448 MiB  88 / 88 items  0 errors  ETA 0:00 
duration: 0:08, 2.19MiB/s
snapshot c9eb981e saved
ubuntu@archive:~$ sudo B2_ACCOUNT_ID="xxxxxxxxxx" B2_ACCOUNT_KEY="xxxxxxxxxx" RESTIC_REPOSITORY="b2:ovhrestic" RESTIC_PASSWORD_FILE="/home/ubuntu/restic/root/restic-pw.txt" TMPDIR="/media/vgcloud/lvcloud/tmp" restic restore latest –-target /tmp –-include /home/ubuntu/crontab/overnight
Fatal: no snapshot ID specified
ubuntu@archive:~$ sudo B2_ACCOUNT_ID="xxxxxxxxxx" B2_ACCOUNT_KEY="xxxxxxxxxx" RESTIC_REPOSITORY="b2:ovhrestic" RESTIC_PASSWORD_FILE="/home/ubuntu/restic/root/restic-pw.txt" TMPDIR="/media/vgcloud/lvcloud/tmp" restic restore latest –-target /tmp
Fatal: no snapshot ID specified
ubuntu@archive:~$ sudo B2_ACCOUNT_ID="xxxxxxxxxx" B2_ACCOUNT_KEY="xxxxxxxxxx" RESTIC_REPOSITORY="b2:ovhrestic" RESTIC_PASSWORD_FILE="/home/ubuntu/restic/root/restic-pw.txt" TMPDIR="/media/vgcloud/lvcloud/tmp" restic snapshots
password is correct
ID        Date                 Host                      Tags        Directory
----------------------------------------------------------------------
c9eb981e  2018-01-06 13:18:35  archive.joncomputing.com              /home/ubuntu
----------------------------------------------------------------------
1 snapshots

As you can see, my test cases ran into the same problems. I think I better wait for fd0 before attempting the newer versions of restic, as I am doing this on a Production environment, and would want to try new versions on a Test environment.

Thanks again.

I misspoke. Had not realized that 0.8.1 was out, so I’ll upgrade and report back on the results of the same tests.

Got it: Your first dash character (-) for --target is not an ASCII dash (called “hyphen-minus” in Unicode) but a “en-dash”, a punctuation character. You can check with echo and xxd that the character is three byte wide in utf-8 (copy&pasted from your message):

$ echo restic restore latest –-target /tmp | xxd
00000000: 7265 7374 6963 2072 6573 746f 7265 206c  restic restore l
00000010: 6174 6573 7420 e280 932d 7461 7267 6574  atest ...-target
00000020: 202f 746d 700a                            /tmp.

This somehow makes restic assume you haven’t specified a snapshot ID at all.

Incidentally I’ve seen the strange dash when I first read your post, but then disregarded it as if some input auto completion replaced it when typing the message.

That makes perfect sense. Though I thought I’d fixed that with a text editor where I’d done a replace all.

I’m coming off a Word document where I have a complete System Management reference for myself. I am very sorry about this! I’ll report back as soon as possible.

1 Like

Plain text for the win. Why would you use Word, out of all the things in this world, to manage your system documentation :wink: