"unable to open config file" via crontab on rest server

Hi everyone, I’m struggling with a strange behavior with restic and rest server as repository on a CentOS 6 vm.
I usually schedule restic with cron using a syntax like that in /etc/crontab

00 01 * * * root . /root/.restic.conf ; /bin/restic backup --quiet --exclude-caches --exclude=proc --exclude=dev --exclude=sys /

In /root/.restic.conf file I export RESTIC_PASSWORD and RESTIC_REPOSITORY environment variables.

Recently I moved my restic repository from an nfs export to a rest server so my RESTIC_REPOSITORY changed from something like /mnt/backup/restic-host to something like
rest:https://username:password@restic-rest-server.local:8000/host/
On the server I wat to backup I added the CA certificate in the OS trust store and if I run from the bash some restic backup or snapshot command it works perfectly

My problem starts when restic runs as a cronjob, on every other server working in the same way works perfectly, on this one cron always return me errors like this:

Fatal: unable to open config file: client.Head: Head "https://username:***@restic-rest-server.local:8000/host/config": Tunnel or SSL Forbidden
Is there a repository at the following location?
rest:https://username:***@restic-rest-server.local:8000/host/

I thought that maybe it was some problem with my restic version, so I updated to the latest 0.12.1, but the problem persists.

Please note that if I mount via NFS the very same directory used by the rest server, the restic cron works perfectly with no errors at all.
I also tried to create a brand new repository (restic init) using the rest server, everything I launch from bash (as root) works perfectly, everything running via cron (as root) return this error.

Do you have any idea why returns this error?

Thanks

Tas

1 Like

That sounds like some proxy is blocking the connection from restic to the rest server. Are any of the following environment variables set: HTTP_PROXY, HTTPS_PROXY or NO_PROXY?

2 Likes

You absolutely got the point!
I added unset https_proxy on the restic cron and It worked perfectly!

Thank you very much! :+1:

1 Like