Input/output error when run from Docker container

Hi there,

I’ve spend a whole day debugging my backups, but didn’t manage to and decided to ask for help at this forum :slight_smile:

What I do

docker run --rm \                                                      3 ↵  
--volume appsdata:/appsdata \
--env RESTIC_PASSWORD="password" \
--env AWS_ACCESS_KEY_ID="b2_keyid" \
--env AWS_SECRET_ACCESS_KEY="b2_access_key" \
--env RESTIC_REPOSITORY="s3:backblaze-bucket" \
restic/restic:0.16.3 \
-r s3:backblaze-bucket backup /appsdata

What I get

no parent snapshot found, will read all files

error: read file_1: input/output error
error: read file_n: input/output error

Files:           0 new,     0 changed,     0 unmodified
Dirs:           19 new,     0 changed,     0 unmodified
Added to the repository: 0 B   (0 B   stored)

processed 0 files, 0 B in 0:05
snapshot 2acc40ec saved
Warning: at least one source file could not be read

What I expect

My data backed up to the Backblaze


When I do the same on the host, it works well. The command I ran locally

restic -r s3:backblaze-bucket backup ./appsdata

no parent snapshot found, will read all files
[0:00]          0 index files loaded

Files:          60 new,     0 changed,     0 unmodified
Dirs:           19 new,     0 changed,     0 unmodified
Added to the repository: 37.438 MiB (33.419 MiB stored)

processed 60 files, 37.459 MiB in 0:17
snapshot ff53c0d4 saved

Thanks in advance!

You need to make this --volume ./appsdata:/appsdata \. This makes it a “bind mount” instead of a “named volume” (those are Docker concepts, very important to know what they mean).

1 Like

Hey, thank you for your comment!

Unfortunately, I’ve tried it before and it didn’t work :frowning:

I tried it both as

  • the relative path --volume ./appsdata:/appsdata
  • --mount type=bind,source="./appsdata",target="/appsdata"
  • --mount type=bind,source="/absolute/path/appsdata",target="/appsdata"

Both give the same result

In that case, you need to debug the issue. And it’s worth noting that the message “input/output error” suggests the problem might be something else than the file not existing or not having the correct permissions.

Exec into the running container after you mounted using the line I gave you, then investigate the content of /appsdata. See if the user that the process inside the container runs as can actually read those files properly.

Hi, this is me again with a follow up.

I tried to debug the problem, but with no luck. I started the container, the user had all the permissions, everything was fine, but the restic backup command would not execute.

Eventually I remembered that I had Colima on my machine and started the container with the new engine, and it worked as it should. So maybe it was the Docker Desktop itself.

Quite odd. I haven’t seen that before with Docker in general, and I run restic using Docker as well. But if it works now, great!