Restic dump does NOT print file out

My os is FreeBSD 11.3-RELEASE with restic-0.9.5_1 and I cannot restic dump my file. command is as following:

$ restic dump 900a28f2 /usr/home/cpfong/tmp/trash/foo.txt -r rclone:koofr:mars_restic_inc_bk/ -p ~/tmp/trash/pwd.real

– reply
repository 7ab0a0ae opened successfully, password is correct
cannot dump file: “/” should be a dir, but s a “file”

However, I can ls this file
$ restic ls 900a28f2 -r rclone:koofr:mars_restic_inc_bk/ -p ~/tmp/trash/pwd.real | grep ‘/usr/home/cpfong/tmp/trash/foo.txt’
/usr/home/cpfong/tmp/trash/foo.txt

never mind, I find older version (0.9.4) which is working ok and you can download 0.9.4 freebsd version here
https://github.com/restic/restic/releases/download/v0.9.4/restic_0.9.4_freebsd_amd64.bz2

Hi @cpfong and welcome to the restic community :slight_smile:

I initially had posted a reply but retracted it as I misread your initial query.
I’m glad you were able to solve your problem, but going back to an older version means that there is a potential that the version you were trying is having an issue.

A couple things I want to check:

  1. Can you try to reproduce it with the latest binary from here: GitHub latest release
  2. If that still doesn’t work, please try the latest beta build from here https://beta.restic.net/

Also I would like to see a full 1:1 output of the command you are running.
Ideally you should use the forum text formatting functions which make this output more readable.

When you run your command, can you please prepend it like so $ ruby -e 'puts ARGV.inspect' restic backup ~ and include all lines here?

This will give us a better understanding of what’s going wrong.

Hi All!

I came across this thread after I encountered this problem myself. I’m running on linux, amd64.

Here’s some more detail, each command preceded by the ruby snippet suggested earlier:

["./restic_0.9.6_linux_amd64", "ls", "8a145e3e", "/home/msharp/foo"]
repository b4cf71e8 opened successfully, password is correct
snapshot 8a145e3e of [/] filtered by [/home/msharp/foo] at 2020-05-05 20:32:23.771454007 +1000 AEST):
/home/msharp/foo

["./restic_0.9.6_linux_amd64", "dump", "8a145e3e", "/home/msharp/foo"]
repository b4cf71e8 opened successfully, password is correct
cannot dump file: "/" should be a dir, but is a "file"

I don’t know if it’s relevant, but this is using an S3-backed repo, and the details are all in the environment.

Interestingly enough, I can actually dump / as if it were a file. It has the same contents as the only normal file in /, called @System.solv.

Accessing the file via restore works as expected:

["./restic_0.9.6_linux_amd64", "restore", "8a145e3e", "--include", "/home/msharp/foo", "--target", "restored/"]
repository b4cf71e8 opened successfully, password is correct
restoring <Snapshot 8a145e3e of [/] at 2020-05-05 20:32:23.771454007 +1000 AEST by root@enif.entropyonwheels.com> to restored/

Behaviour is identical using the latest beta release, 0.9.6-98-g616f9499.

Same here with 0.14.0:

root@perbackup1-2022:/etc/zabbix/zabbix_agentd.conf.d# restic -r rest:http://user:passhidden@10.0.20.45:8002/ --password-file=/etc/ltr/perbackup1-2022.restic_01.pwd snapshots latest --tag ltr-config
repository 58b651fa opened (repository version 2) successfully, password is correct
ID        Time                 Host           Tags        Paths
--------------------------------------------------------------------------------
900303d3  2022-12-04 11:10:53  permain2-2020  ltr-config  /etc/ltr/test-err.yaml
--------------------------------------------------------------------------------
1 snapshots
root@perbackup1-2022:/etc/zabbix/zabbix_agentd.conf.d# restic -r rest:http://user:passhidden@10.0.20.45:8002/ --password-file=/etc/ltr/perbackup1-2022.restic_01.pwd dump 900303d3 /etc/ltr/test-err.yaml
repository 58b651fa opened (repository version 2) successfully, password is correct
cannot dump file: path "/etc" not found in snapshot
root@perbackup1-2022:/etc/zabbix/zabbix_agentd.conf.d# restic version
restic 0.14.0 compiled with go1.19 on linux/amd64

why ls lists this file without path?

restic -r rest:http://user:passhidden@10.0.20.45:8002/ --password-file=/etc/ltr/perbackup1-2022.restic_01.pwd ls 900303d3
repository 58b651fa opened (repository version 2) successfully, password is correct
snapshot 900303d3 of [/etc/ltr/test-err.yaml] filtered by [] at 2022-12-04 11:10:53.196234524 +0100 CET):
/test-err.yaml

dump without full path works:

restic -r rest:http://user:passhidden@10.0.20.45:8002/ --password-file=/etc/ltr/perbackup1-2022.restic_01.pwd dump 900303d3 /test-err.yaml

i dont understand that behavior.

How did you create that snapshot? With an absolute or a relative path?

Which directory structure does restic ls or restic mount show for that snapshot?

Error is gone at repo1. Dont know why.

Same on another client/server: here i could save my upload-command:

restic -r rest:http://user:passhidden@ltr.rz.zz:8001/xp8/ --password-file=/etc/ltr/xp8rz_repo.pwd backup --tag ltr-config /etc/ltr/xp8rz.yaml

restic -r rest:http://user:passhidden@ltr.rz.zz:8001/xp8/ --password-file=/etc/ltr/xp8rz_repo.pwd snapshots latest --tag ltr-config
repository 18c78085 opened (repository version 2) successfully, password is correct
ID        Time                 Host           Tags        Paths
-----------------------------------------------------------------------------
cfb10b7d  2022-12-10 19:38:21  xp8main1-2021  ltr-config  /etc/ltr/xp8rz.yaml
-----------------------------------------------------------------------------
1 snapshots

Error is even gone here: maybe after backing up one file without a --tag

I try to get this error again on the next server i have to configure with restic the same way (there are some left :slight_smile: )