docker-timemachine: Timemachine cannot access sparsebundle anymore

Describe the Bug

I have been running this image for about a year. I have auto-upgrade enabled of smb and some time during May it stopped working.

Logging in OSX with log stream --level debug --predicate 'subsystem == "com.apple.TimeMachine"' gives the following:

2023-05-17 22:26:37.853263+0200 0x3da15f   Error       0x0                  50259  0    backupd: (TimeMachine) [com.apple.TimeMachine:DiskImages] Failed to read 'file:///Volumes/.timemachine/timemachine._smb._tcp.local./8FA0DA96-BDE4-452C-8AC3-68A20FC53AC1/Backup/Bananas.sparsebundle/com.apple.TimeMachine.MachineID.bckup', error: Error Domain=NSCocoaErrorDomain Code=257 "The file “com.apple.TimeMachine.MachineID.bckup” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/Volumes/.timemachine/timemachine._smb._tcp.local./8FA0DA96-BDE4-452C-8AC3-68A20FC53AC1/Backup/Bananas.sparsebundle/com.apple.TimeMachine.MachineID.bckup, NSUnderlyingError=0x7fa104f2a730 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

Reverting back to tag mbentley/timemachine:smb-20230501 made things work again.

Expected Behavior

Normal working time machine backups over SMB.

Steps to Reproduce

  1. Use image tag smb and the problem shows up.
  2. Use image tag smb-20230501 and it is gone.

How You’re Launching the Container

Setup with Ansible like this:

- name: Setup container
  docker_container:
    name: timemachine
    image: mbentley/timemachine:smb-20230401
    restart_policy: unless-stopped
    networks:
      - name: "{{ docker_network_name }}"
    hostname: timemachine
    purge_networks: yes
    volumes:
      - /mnt/backup/timemachine:/opt/timemachine
    ports:
      - "137:137/udp"
      - "138:138/udp"
      - "139:139/tcp"
      - "445:445/tcp"
    env:
      SHARE_NAME: "Backup"


### Container Logs

```plain
INFO: CUSTOM_SMB_CONF=false; generating [global] section of /etc/samba/smb.conf...
INFO: Creating /var/log/samba/cores
INFO: Avahi - generating base configuration in /etc/avahi/services/smbd.service...
INFO: Avahi - adding the 'dk0', 'Backup' share txt-record to /etc/avahi/services/smbd.service...
INFO: Group timemachine doesn't exist; creating...
INFO: User timemachine doesn't exist; creating...
INFO: Using default password: timemachine
chpasswd: password for 'timemachine' changed
INFO: INFO: CUSTOM_SMB_CONF=false; generating [Backup] section of /etc/samba/smb.conf...
INFO: Samba - Created Added user timemachine.
INFO: Samba - Enabled user timemachine.
INFO: Samba - setting password
INFO: SET_PERMISSIONS=false; not setting ownership and permissions for /opt/timemachine
INFO: Avahi - completing the configuration in /etc/avahi/services/smbd.service...
INFO: running test for xattr support on your time machine persistent storage location...
INFO: xattr test successful - your persistent data store supports xattrs
INFO: entrypoint complete; executing 's6-svscan /etc/s6'
dbus socket not yet available; sleeping...
nmbd version 4.18.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2023
smbd version 4.18.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2023
INFO: Profiling support unavailable in this build.
Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
Successfully dropped root privileges.
avahi-daemon 0.8 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Loading service file /etc/avahi/services/smbd.service.
Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.192.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
New relevant interface lo.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for 192.168.1.192 on eth0.IPv4.
Registering new address record for 127.0.0.1 on lo.IPv4.
Server startup complete. Host name is timemachine.local. Local service cookie is 3992747074.
Service "timemachine" (/etc/avahi/services/smbd.service) successfully established.
*****

Samba name server TIMEMACHINE is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.192

*****

Additional Context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 28 (13 by maintainers)

Most upvoted comments

I just merged a PR that seems to have helped my backups: https://github.com/mbentley/docker-timemachine/pull/156

If you don’t have SMB_VFS_OBJECTS defined as an env var, just pulling the newest image from today and recreating the containers help.

Well good news - I can reproduce this in my own environment. The bad news is that I didn’t have to do anything to reproduce it so I don’t know what’s triggered it but at least I can do some digging.

*edit: Well, annoying thing is that I just restarted my time machine container and tried to start a backup and it started working so that’s not exactly helpful.