Open ALEX8642 opened 7 months ago
@ALEX8642 You have a command
configured, that is wrong. Resticker is completely configured via env variables.
@ALEX8642 You have a
command
configured, that is wrong. Resticker is completely configured via env variables.
@pelag0s Ok. Incidentally enough though, that was an attempt to solve the issue. I did not have commands previously and it had zero impact on the error. I have confirmed once again. Updating original issue post to remove command section. Am I missing any env variables?
Look at the line with minio
. There seems to be a incorrect indentation.
Look at the line with
minio
. There seems to be a incorrect indentation.
@escoand MinIO is working fine (GUI is fully accessible), so I don't think that's the issue.
You deployed it exactly like you copy-pasted? Hard to believe it is working with this config. So we could just guess what's the real problem.
I'm also quite sure this is also not working as intended:
- RESTIC_FORGET_ARGS= >-
...
I suppose it was copied/converted from something like this:
RESTIC_FORGET_ARGS: >=
...
Or use it like this:
- >-
RESTIC_FORGET_ARGS=
...
I'm also quite sure this is also not working as intended:
- RESTIC_FORGET_ARGS= >- ...
I suppose it was copied/converted from something like this:
RESTIC_FORGET_ARGS: >= ...
Or use it like this:
- >- RESTIC_FORGET_ARGS= ...
@escoand a friend of mine provided this yaml. There other syntax issues solved already but they didn't change the error. I will change the syntax as you have indicated when I am able tonight and let you know. Appreciate the feedback. As mentioned though, minIO and all my other containers seem to be working OK. It's only Restic backup that gives me that error and goes into a restart loop.
Also there is something missing at the beginning. I would expect something like this:
services:
restic-backup:
image: mazzolino/restic
# ...
Let's shorten this discussion, here is your config with (hopefully) all the indentation errors fixed:
services:
restic-backup:
image: mazzolino/restic
hostname: restic-backup
restart: unless-stopped
environment:
- RUN_ON_STARTUP=true
# Run once every month on the 30th day
- BACKUP_CRON=0 30 3 * * *
- RESTIC_REPOSITORY=s3:http://minio:9000/test-restic-backup
- RESTIC_PASSWORD=*********
- RESTIC_BACKUP_SOURCES=/mnt/backup
# RESTIC_BACKUP_ARGS: >-
# --tag backup-tag
# --exclude='folder/to/exclude'
# --exclude='somefile.txt'
# Keep docs: https://restic.readthedocs.io/en/stable/060_forget.html
- RESTIC_FORGET_ARGS= >-
--keep-daily 7
--keep-weekly 5
--keep-monthly 12
--keep-yearly 3
--keep-tag 'keep'
#AWS_ACCESS_KEY_ID:
#AWS_SECRET_ACCESS_KEY:
- TZ=Etc/UTC
volumes:
- ~/alex8642/ItbLab:/mnt/backup:ro
- ./restic:/mnt/backup:rw
restic-prune:
image: mazzolino/restic
hostname: restic-prune
restart: unless-stopped
environment:
- RUN_ON_STARTUP=true
# Run once every month on the 30th day
- PRUNE_CRON=0 30 3 * * *
- RESTIC_REPOSITORY=s3:http://minio:9000/test-restic-backup
- RESTIC_PASSWORD=*********
#AWS_ACCESS_KEY_ID:
#AWS_SECRET_ACCESS_KEY:
- TZ=Etc/UTC
restic-check:
image: mazzolino/restic
hostname: restic-check
restart: unless-stopped
environment:
- RUN_ON_STARTUP=true
# Run once every month on the 30th day
- PRUNE_CRON=0 30 3 * * *
- RESTIC_CHECK_ARGS= >-
--read-data-subset=10%
- RESTIC_REPOSITORY=s3:http://minio:9000/test-restic-backup
- RESTIC_PASSWORD=*********
#AWS_ACCESS_KEY_ID:
#AWS_SECRET_ACCESS_KEY:
- TZ=Etc/UTC
minio:
image: ghcr.io/imagegenius/minio
hostname: minio
restart: unless-stopped
ports:
- 9001:9001 # web ui
- 9000:9000 # api port
environment:
- MINIO_ROOT_USER=user
- MINIO_ROOT_PASSWORD=********* # must be longer than 8
- PUID=99
- PGID=100
- UMASK=022
volumes:
- ./minio:/config # bucket storage
Hi. The changes made per @djmaze and @escoand had no effect. Error persists.
We need the actual used yaml. Currently it's just guesswork.
As a side note, there are other containers running in this all working great. I only pasted the section related to restic. This is why the services title was not present in previous versions. That was always present in the docker compose yaml. usernames and passwords removed for obvious reasons. I tried what @escoand recommended with the >- syntax first on the args.
---
version: "2.1"
services:
restic-backup:
image: mazzolino/restic
hostname: restic-backup
restart: unless-stopped
environment:
- RUN_ON_STARTUP=true
# Run once every month on the 30th day
- BACKUP_CRON=0 30 3 * * *
- RESTIC_REPOSITORY=s3:http://minio:9000/test-restic-backup
- RESTIC_PASSWORD=
- RESTIC_BACKUP_SOURCES=/mnt/backup
# RESTIC_BACKUP_ARGS: >-
# --tag backup-tag
# --exclude='folder/to/exclude'
# --exclude='somefile.txt'
# Keep docs: https://restic.readthedocs.io/en/stable/060_forget.html
- >-
RESTIC_FORGET_ARGS=
--keep-daily 7
--keep-weekly 5
--keep-monthly 12
--keep-yearly 3
--keep-tag 'keep'
#AWS_ACCESS_KEY_ID:
#AWS_SECRET_ACCESS_KEY:
- TZ=Etc/UTC
volumes:
- ~/alex8642/ItbLab:/mnt/backup:ro
- ./restic:/mnt/backup:rw
restic-prune:
image: mazzolino/restic
hostname: restic-prune
restart: unless-stopped
environment:
- RUN_ON_STARTUP=true
# Run once every month on the 30th day
- PRUNE_CRON=0 30 3 * * *
- RESTIC_REPOSITORY=s3:http://minio:9000/test-restic-backup
- RESTIC_PASSWORD=
#AWS_ACCESS_KEY_ID:
#AWS_SECRET_ACCESS_KEY:
- TZ=Etc/UTC
restic-check:
image: mazzolino/restic
hostname: restic-check
restart: unless-stopped
environment:
- RUN_ON_STARTUP=true
# Run once every month on the 30th day
- PRUNE_CRON=0 30 3 * * *
- >-
RESTIC_CHECK_ARGS=
--read-data-subset=10%
- RESTIC_REPOSITORY=s3:http://minio:9000/test-restic-backup
- RESTIC_PASSWORD=
#AWS_ACCESS_KEY_ID:
#AWS_SECRET_ACCESS_KEY:
- TZ=Etc/UTC
minio:
image: ghcr.io/imagegenius/minio
hostname: minio
restart: unless-stopped
ports:
- 9001:9001 # web ui
- 9000:9000 # api port
environment:
- MINIO_ROOT_USER=
- MINIO_ROOT_PASSWORD= # must be longer than 8
- PUID=99
- PGID=100
- UMASK=022
volumes:
- ./minio:/config # bucket storage
And is it working now? By the way, you can do this also with only one container.
And is it working now? By the way, you can do this also with only one container.
Hi. The changes made per @djmaze and @escoand had no effect. Error persists.
^^^see my earlier comment where I said it did not work and then you asked for YAML. I have not changed the YAML since this comment.
re: one container - and? Feel free to elaborate. I'm looking for solutions here. :)
I'm using RESTIC_FORGET_ARGS=--prune ...
to avoid the special prune container.
To the initial problem: I'm out of glue.
I'm using
RESTIC_FORGET_ARGS=--prune ...
to avoid the special prune container.To the initial problem: I'm out of glue.
Gotcha. Thanks for your input. Hopefully @djmaze or @pelag0s has some ideas? Otherwise I'm pretty well out of ideas too. I was already at this for some time before starting the issue thread.
Your configuration also mounts 2 directories at /mnt/backup
. That does not make sense.
Also, I tried the restic-backup
part of your yaml locally (without the volumes) and it worked for me. Maybe you are still using an old version of the mazzolino/restic
image? Did you try docker pull mazzolino/restic
?
Your configuration also mounts 2 directories at
/mnt/backup
. That does not make sense.Also, I tried the
restic-backup
part of your yaml locally (without the volumes) and it worked for me. Maybe you are still using an old version of themazzolino/restic
image? Did you trydocker pull mazzolino/restic
?
I pulled latest image, then I tried it with all volumes deleted and the error persists. :(
Your configuration also mounts 2 directories at
/mnt/backup
. That does not make sense. Also, I tried therestic-backup
part of your yaml locally (without the volumes) and it worked for me. Maybe you are still using an old version of themazzolino/restic
image? Did you trydocker pull mazzolino/restic
?I pulled latest image, then I tried it with all volumes deleted and the error persists. :(
Alright so finally progress... Doing a complete update/upgrade of ubuntu server and docker, then restarting and running docker compose seems to have eliminated the initial error, though nothing is backing up it seems still... the log shows
restic-backup-1 | Checking configured repository 's3:http://minio:9000/test-restic-backup' ...
restic-backup-1 | Fatal: unable to open config file: Stat: Access Denied.
restic-backup-1 | Is there a repository at the following location?
restic-backup-1 | s3:http://minio:9000/test-restic-backup
restic-backup-1 | Could not access the configured repository. Trying to initialize (in case it has not been initialized yet) ...
restic-backup-1 | Fatal: create key in repository at s3:http://minio:9000/test-restic-backup failed: Stat: Access Denied.
restic-backup-1 |
restic-backup-1 | Initialization failed. Please see error messages above and check your configuration. Exiting.
restic-backup-1 | Checking configured repository 's3:http://minio:9000/test-restic-backup' ...```
Well I added user and key from Minio to (comment out pound removed)
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
Did not work either...
restic-backup-1 | Initialization failed. Please see error messages above and check your configuration. Exiting.
restic-backup-1 | Checking configured repository 's3:http://minio:9000/test-restic-backup' ...
restic-backup-1 | Fatal: unable to open config file: Stat: Access Denied.
restic-backup-1 | Is there a repository at the following location?
restic-backup-1 | s3:http://minio:9000/test-restic-backup
restic-backup-1 | Could not access the configured repository. Trying to initialize (in case it has not been initialized yet) ...
restic-backup-1 | Checking configured repository 's3:http://minio:9000/test-restic-backup' ...
restic-backup-1 | Fatal: unable to open config file: Stat: Access Denied.
restic-backup-1 | Is there a repository at the following location?
restic-backup-1 | s3:http://minio:9000/test-restic-backup
restic-backup-1 | Could not access the configured repository. Trying to initialize (in case it has not been initialized yet) ...
restic-backup-1 | Checking configured repository 's3:http://minio:9000/test-restic-backup' ...
The error is thrown at https://github.com/djmaze/resticker/blob/master/entrypoint#L85 when the BACKUP_CRON variable isn't set. I don't know if this check is even necessary because it would be perfectly fine to run the image once and never again (e.g. user scheduled backup after an important change or otherwise triggering e.g. with kubernetes cronjob), however I think at least the error message could be clearer
If there is not any _CRON
variable set, it is unclear what the image should do. I would rather not run the backup as a default, as this could be a configuration mistake as well.
I'd rather improve the error message.
When running this docker compose file, I get the following repeating over and over:
The docker events call - docker daemon shows fatal error code 1 (repeating):
Docker compose file: