Restic init hangs if running in a freenas jail and targeting b2 bucket

Hi!

I use restic for quite some time to backup some linux boxs to a sftp share. Now I tried to backup my FreeNAS (FreeBSD based NAS) to a B2 bucket. To do this, I create a iocage jail and install restic via pkg install restic.

After setting the required B2 env variables i try to restic -r b2:$BUCKET_ID init, but the command just hangs. For a long time. No error or any response. :face_with_raised_eyebrow: Bucket stays empty. :frowning_face:

Notes

  • restic is able to init a local folder
  • restic fails and prints an error if I get my B2 credetials wrong
  • if I copy and paste the environment and the init command to a linux box, the init works
  • There’s also no output if I pass one or more -v

:thinking: Anybody knows what’s going on?

Hi and welcome to the forum :slight_smile:

Just to make sure that all your B2 credentials are working correctly, can you try to backup some example data on your computer to Backblaze? Like not the iocage etc but just from any random computer you have around. It’s always good to simplify and remove all complexity to see where the problem occurs.

I have a couple boxes backing up to B2 on a daily basis just fine.

Maybe it also has something to do with outbound connections not being allowed?!
I don’t know if FreeNAS has some iptables running to prevent outgoing connections.

Hi moritzdietz!

As I wrote, everything works fine from my linux box (same credentials/config, same network).

I haven’t much experience with jails, so I’m looking forward to talk to someone that got it working. Jails are resticted in various ways, but I don’t know what I’ve to change, as restic remains silent about what’s not working.

Gotcha! So unfortunately I don’t have any experience with that software. :confused:

I still don’t know what’s going on. I patebined the output of truss -fad -o restic.truss -s 512 restic -r b2:bisChcA2KHVJN8MfoEA9Q init (20 sec, then i killed it) - in case anybody knows how to find my problem in there.

https://pastebin.com/6Fhe574V

From the truss output I get, that restic connects to api.backblaze.com and then times out?

I just setup a clean FreeBSD 11 (and 12) and face the same issue. ATM i think restic with B2 doesn’t work from FreeBSD at all.

I tryed it with the Master Key and with an Application Key.

Filed a bug report: issue:2355

Solved this by installing ca_root_nss (see issue:2355 )

1 Like

Glad you were able to find the cause for the problem! So from what it sounds like, the underlying linux was trying to check the validity of the cert of B2 and couldn’t so restic failed.

As mentioned in the commends in the GH issue I would hope that we could somehow add some informational error text for this kind of failure.

1 Like

Yes, that sounds right. From the trace I created, I saw that restic cotinously connected to the B2 API and pulled (at least) the certificate.

1 Like