Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot bring up the container #49

Closed
Yeboster opened this issue Aug 25, 2020 · 6 comments
Closed

Cannot bring up the container #49

Yeboster opened this issue Aug 25, 2020 · 6 comments

Comments

@Yeboster
Copy link

Hello,

Thank you for maintaining this project. It is very nice to host a time machine as simple as deploying a container.

Unfortunately I cannot get it working and I'm not sure where I am doing wrong because the logs aren't so clear.
I can see the server from the mac but the connection time out when I'm trying to connect to it. I've opened the ports 137/udp, 138/udp, 139/tcp, 445/tcp on the server.

This is the docker-compose I'm using:

version: '3.4'

services:
  timemachine:
    image: mbentley/timemachine:smb
    container_name: timemachine
    network_mode: "host"
#     ports:
#      - 137:137/udp
#      - 138:138/udp
#      - 139:139
#      - 445:445
    environment:
      - CUSTOM_SMB_CONF=false
      - CUSTOM_USER=false
      - DEBUG_LEVEL=1
      - MIMIC_MODEL=TimeCapsule8,119
      - EXTERNAL_CONF=
      - HIDE_SHARES=no
      - TM_USERNAME=timemachine
      - TM_GROUPNAME=timemachine
      - TM_UID=1000
      - TM_GID=1000
      - PASSWORD=timemachine
      - SET_PERMISSIONS=false
      - SHARE_NAME=TimeMachine
      - SMB_PORT=445
      - VOLUME_SIZE_LIMIT=0
      - WORKGROUP=WORKGROUP
    volumes:
      - ./data:/opt/timemachine
      - timemachine-var-lib-samba:/var/lib/samba
      - timemachine-var-cache-samba:/var/cache/samba
      - timemachine-run-samba:/run/samba
volumes:
  timemachine-var-lib-samba:
  timemachine-var-cache-samba:
  timemachine-run-samba:

Those are the logs:

Attaching to timemachine
 INFO: CUSTOM_SMB_CONF=false; generating [global] section of /etc/samba/smb.conf...
 INFO: Avahi - generating base configuration in /etc/avahi/services/smbd.service...
 INFO: Avahi - adding the 'dk0', 'TimeMachine' share txt-record to /etc/avahi/services/smbd.service...
 INFO: Group timemachine exists; skipping creation
 INFO: User timemachine exists; skipping creation
 INFO: CUSTOM_SMB_CONF=false; generating [TimeMachine] section of /etc/samba/smb.conf...
 INFO: Samba - Created User timemachine password set to none.
 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: dbus PID exists; removing...
 removed '/run/dbus.pid'
 INFO: avahi PID exists; removing...
 removed '/run/avahi-daemon/pid'
 INFO: entrypoint complete; executing 's6-svscan /etc/s6'
 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.
 *** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***
 Joining mDNS multicast group on interface docker0.IPv6 with address fe80::42:8dff:fea1:988d.
 New relevant interface docker0.IPv6 for mDNS.
 Joining mDNS multicast group on interface docker0.IPv4 with address 172.17.0.1.
 New relevant interface docker0.IPv4 for mDNS.
 Joining mDNS multicast group on interface enp2s0.IPv6 with address fe80::5886:8bb8:e2d:5d7.
 New relevant interface enp2s0.IPv6 for mDNS.
 Joining mDNS multicast group on interface enp2s0.IPv4 with address 192.168.1.101.
 New relevant interface enp2s0.IPv4 for mDNS.
 Joining mDNS multicast group on interface lo.IPv6 with address ::1.
 New relevant interface lo.IPv6 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 fe80::42:8dff:fea1:988d on docker0.*.
 Registering new address record for 172.17.0.1 on docker0.IPv4.
 Registering new address record for fe80::5886:8bb8:e2d:5d7 on enp2s0.*.
 Registering new address record for 192.168.1.101 on enp2s0.IPv4.
 Registering new address record for ::1 on lo.*.
 Registering new address record for 127.0.0.1 on lo.IPv4.
 nmbd version 4.12.2 started.
 Copyright Andrew Tridgell and the Samba Team 1992-2020
 daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
 EOF on stdin
 Got SIGTERM: going down...
 smbd version 4.12.2 started.
 Copyright Andrew Tridgell and the Samba Team 1992-2020
 INFO: Profiling support unavailable in this build.
 daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
 Failed to fetch record!
 Server startup complete. Host name is big.local. Local service cookie is 3547224719.
 nmbd version 4.12.2 started.
 Copyright Andrew Tridgell and the Samba Team 1992-2020
 daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
 EOF on stdin
 Got SIGTERM: going down...
 smbd version 4.12.2 started.
 Copyright Andrew Tridgell and the Samba Team 1992-2020
 INFO: Profiling support unavailable in this build.
 daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
 Failed to fetch record!
 Service "big" (/etc/avahi/services/smbd.service) successfully established.
 nmbd version 4.12.2 started.
 Copyright Andrew Tridgell and the Samba Team 1992-2020
 daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
 EOF on stdin
 Got SIGTERM: going down...
# It's looping over and over

Have a nice day.

@mbentley
Copy link
Owner

Sorry for the delay. Could you tell me a bit about the server you're running this on? If you have Samba or nbd running on your host, you might be seeing a conflict with the host's processes. That being said, I am not sure why just that process is terminating. Setting the environment variable to set the debug level to 3 could help get logs as to why the process would be terminating: - DEBUG_LEVEL=3

@lyarenei
Copy link

I've got the same problem. I'm running this on an ASUSTOR NAS, where I have SMB and SFTP enabled. I tried to disable both of them, but no success. The container is running on a macvlan network as described in the readme.

I was able to fix it by adding < /dev/null to etc/s6/smbd/run as per https://unix.stackexchange.com/a/277119. While definitely not the cleanest fix, it seems to work, at least for now. I also added the same line to etc/s6/nmbd/run, which was exitting too.

Here are logs from the first container start with the first exit loop:
debug level 3
debug level 4

At first glance it doesn't look like there's any useful info though. (Besides the fd limit fail, which should not be related.)

@Yeboster
Copy link
Author

Hello, sorry for the delay.

I have a NAS running centos 7. I've just uninstalled samba and cleaned the docker volumes and folders. Are there some other packages that could conflict with the container ?

Anyway, here are the logs with DEBUG_LEVEL=3

INFO: CUSTOM_SMB_CONF=false; generating [global] section of /etc/samba/smb.conf...
Creating /var/log/samba/cores
INFO: Avahi - generating base configuration in /etc/avahi/services/smbd.service...
INFO: Avahi - adding the 'dk0', 'TimeMachine' share txt-record to /etc/avahi/services/smbd.service...
INFO: Group timemachine doesn't exist; creating...
INFO: User timemachine doesn't exist; creating...
adduser: /opt/timemachine: Permission denied
INFO: Using default password: timemachine
chpasswd: password for 'timemachine' changed
INFO: INFO: CUSTOM_SMB_CONF=false; generating [TimeMachine] 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: entrypoint complete; executing 's6-svscan /etc/s6'
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.
*** WARNING: Detected another IPv4 mDNS stack running on this host. This makes mDNS unreliable and is thus not recommended. ***
Joining mDNS multicast group on interface docker0.IPv4 with address 172.17.0.1.
New relevant interface docker0.IPv4 for mDNS.
Joining mDNS multicast group on interface enp2s0.IPv6 with address fe80::5886:8bb8:e2d:5d7.
New relevant interface enp2s0.IPv6 for mDNS.
Joining mDNS multicast group on interface enp2s0.IPv4 with address 192.168.1.101.
New relevant interface enp2s0.IPv4 for mDNS.
Joining mDNS multicast group on interface lo.IPv6 with address ::1.
New relevant interface lo.IPv6 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 172.17.0.1 on docker0.IPv4.
Registering new address record for fe80::5886:8bb8:e2d:5d7 on enp2s0.*.
Registering new address record for 192.168.1.101 on enp2s0.IPv4.
Registering new address record for ::1 on lo.*.
Registering new address record for 127.0.0.1 on lo.IPv4.
nmbd version 4.12.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
services not loaded
standard input is not a socket, assuming -D option
Becoming a daemon.
Registered MSG_REQ_POOL_USAGE
Opening sockets 137
open_sockets: Broadcast sockets opened.
added interface docker0 ip=172.17.0.1 bcast=172.17.255.255 netmask=255.255.0.0
added interface enp2s0 ip=192.168.1.101 bcast=192.168.1.255 netmask=255.255.255.0
making subnet name:192.168.1.101 Broadcast address:192.168.1.255 Subnet mask:255.255.255.0
making subnet name:172.17.0.1 Broadcast address:172.17.255.255 Subnet mask:255.255.0.0
making subnet name:UNICAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
making subnet name:REMOTE_BROADCAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
Loaded hosts file /etc/samba/lmhosts
add_name_to_subnet: Added netbios name *<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet 172.17.0.1
add_name_to_subnet: Added netbios name *<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet 172.17.0.1
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet 172.17.0.1
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet 172.17.0.1
create_server_on_workgroup: Created server entry BIG of type 40819a03 (Samba 4.12.2) on workgroup WORKGROUP.
initiate_myworkgroup_startup: Added server name entry BIG on subnet 172.17.0.1
add_name_to_subnet: Added netbios name *<00> with first IP 192.168.1.101 ttl=0 nb_flags= 0 to subnet 192.168.1.101
add_name_to_subnet: Added netbios name *<20> with first IP 192.168.1.101 ttl=0 nb_flags= 0 to subnet 192.168.1.101
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.1.101 ttl=0 nb_flags= 0 to subnet 192.168.1.101
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.1.101 ttl=0 nb_flags= 0 to subnet 192.168.1.101
create_server_on_workgroup: Created server entry BIG of type 40819a03 (Samba 4.12.2) on workgroup WORKGROUP.
initiate_myworkgroup_startup: Added server name entry BIG on subnet 192.168.1.101
add_name_to_subnet: Added netbios name *<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name *<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name BIG<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name BIG<03> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name BIG<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name WORKGROUP<00> with first IP 172.17.0.1 ttl=0 nb_flags=80 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name WORKGROUP<1e> with first IP 172.17.0.1 ttl=0 nb_flags=80 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name *<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
add_name_to_subnet: Added netbios name *<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 172.17.0.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
EOF on stdin
Got SIGTERM: going down...
send_host_announcement: type 0 for host BIG on subnet 172.17.0.1 for workgroup WORKGROUP
send_host_announcement: type 0 for host BIG on subnet 192.168.1.101 for workgroup WORKGROUP
smbd version 4.12.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Processing section "[TimeMachine]"
adding IPC service
added interface docker0 ip=172.17.0.1 bcast=172.17.255.255 netmask=255.255.0.0
added interface enp2s0 ip=192.168.1.101 bcast=192.168.1.255 netmask=255.255.255.0
loaded services
INFO: Profiling support unavailable in this build.
Standard input is not a socket, assuming -D option
Becoming a daemon.
Registered MSG_REQ_POOL_USAGE
No builtin backend found, trying to load plugin
load_module_absolute_path: Module '/usr/lib/samba/pdb/tdbsam.so' loaded
pid_to_procid: messaging_dgm_get_unique failed: No such file or directory
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_POOL_USAGE
tdb(/var/lib/samba/registry.tdb): tdb_open_ex: could not open file /var/lib/samba/registry.tdb: No such file or directory
Could not open tdb: No such file or directory
Failed to fetch domain sid for WORKGROUP
Initialise the svcctl registry keys if needed.
Server startup complete. Host name is big.local. Local service cookie is 3296803446.
Initialise the eventlog registry keys if needed.
register_rpc_module: Successfully added RPC module 'mdssvc'
daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
start_background_queue: Starting background LPQ thread
Registered MSG_REQ_POOL_USAGE
Failed to fetch record!
waiting for connections
reloading printcap cache
pcap_cache_reload: skipping reload - load printers disabled
Server exit (EOF on stdin)
Server exit (termination signal)

@mbentley
Copy link
Owner

So I am really not sure why I can't reproduce it but anyway, I am going to apply the < /dev/null workaround for both smbd and nmbd.

mbentley added a commit that referenced this issue Sep 17, 2020
Added '< /dev/null' to both smbd and nmbd; fixes #49
@mbentley
Copy link
Owner

An image should be building here shortly on Docker Hub (https://hub.docker.com/r/mbentley/timemachine/tags?page=1&name=smb). Please check and let me know if that resolves the issues you were seeing.

@Yeboster
Copy link
Author

Hello, I've wanted to tell you that now the timemachine is working well ! I really don't know why I had such issue, also because we are running into a containerized environment. Anyway, I'm happy to backup some data.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants