linuxserver / docker-daapd

GNU General Public License v3.0
103 stars 37 forks source link

[BUG] Avahi broadcast wrong host name by adding -2 in the 28.x versions #81

Closed philippelt closed 7 months ago

philippelt commented 11 months ago

Is there an existing issue for this?

Current Behavior

I added an avahi ressource to advertise a samba share used for time machine. When using an image with 28.x tag, the samba share is displayed as attached to xxx-2 (xxx is the appropriate hostname) and time machine do not find the backup disk. If I start a 27.4 image, the samba share is displayed as attached to xxx without any suffix and time machine works. I tried 28.4 and 28.5 and both do not work.

Expected Behavior

I expected that the host did not change and was not added a -2 suffix that avoid mac stations to find time machine share.

Steps To Reproduce

Start daapd container with latest version. Even on an empty server, no need to run samba or anything else.

My compose file is mounting a volume for avahi resources : <server path>:/etc/avahi/services:ro

Add an avahi resource (file timemachine.service) in the mounted service directory :

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
   <type>_smb._tcp</type>
   <port>445</port>
 </service>
 <service>
   <type>_device-info._tcp</type>
   <port>0</port>
   <txt-record>model=RackMac</txt-record>
 </service>
 <service>
   <type>_adisk._tcp</type>
   <txt-record>sys=waMa=0,adVF=0x100</txt-record>
   <txt-record>dk0=adVN=time_machine,adVF=0x82</txt-record>
 </service>
</service-group>

Test broadcast using mdns-scan Invalid output : xxx-2._adisk._tcp.local Expected output: xxx._adisk._tcp.local xxx being the hostname of the server.

Running the same configuration with the 24.7 image provide the expected output

Environment

- OS: Ubuntu 22.04.2 LTS
- From docker repo : docker-ce, docker-ce-cli, ...
 version
Client: Docker Engine - Community
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:18 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:18 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

CPU architecture

x86-64

Docker creation

version: '3'

services:
  daapd_srv:
    container_name: daapd
    image: linuxserver/daapd:version-27.4
    network_mode: "host"
    volumes:
      - /data/daapd/avahi_services:/etc/avahi/services:ro
      - /medias/music:/music:ro
      - /data/daapd/:/config
    healthcheck:
      test: [ "CMD-SHELL", "wget -O - http://localhost:3689/api/player >/dev/null 2>&1" ]
      interval: 30s
      timeout: 2s
      retries: 3
    restart: always
    environment:
      - TZ=Europe/Paris
    logging:
      driver: json-file
      options:
        max-size: "10M"
        max-file: "7"
    deploy:
      resources:
        limits:
          memory: 2G

### Container logs

```bash
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-dbus: executing... 
[cont-init.d] 30-dbus: exited 0.
[cont-init.d] 40-config: executing... 
[cont-init.d] 40-config: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Failed to set ownership on logfile: Operation not permitted
[2023-07-28 16:00:17] [  LOG]     main: Forked Media Server Version 27.4 taking off
[2023-07-28 16:00:17] [  LOG]     main: Built with:
[2023-07-28 16:00:17] [  LOG]     main: - ffmpeg
[2023-07-28 16:00:17] [  LOG]     main: - Spotify
[2023-07-28 16:00:17] [  LOG]     main: - LastFM
[2023-07-28 16:00:17] [  LOG]     main: - Chromecast
[2023-07-28 16:00:17] [  LOG]     main: - MPD
[2023-07-28 16:00:17] [  LOG]     main: - Websockets
[2023-07-28 16:00:17] [  LOG]     main: - ALSA
[2023-07-28 16:00:17] [  LOG]     main: - Webinterface
[2023-07-28 16:00:17] [  LOG]     main: - Regex
[2023-07-28 16:00:17] [  LOG]     main: mDNS init
[2023-07-28 16:00:17] [  LOG]     mdns: Avahi state change: Client connecting
[2023-07-28 16:00:17] [  LOG]       db: Configured to use database file '/config/dbase_and_logs/songs3.db'
[2023-07-28 16:00:17] [  LOG]       db: Now vacuuming database, this may take some time...
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/AirPrint-DNP_DS620.service.
Loading service file /etc/avahi/services/timemachine.service.
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 virbr0.IPv4 with address 192.168.122.1.
New relevant interface virbr0.IPv4 for mDNS.
Joining mDNS multicast group on interface br0.IPv4 with address 192.168.0.221.
New relevant interface br0.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 172.17.0.1 on docker0.IPv4.
Registering new address record for 192.168.122.1 on virbr0.IPv4.
Registering new address record for 192.168.0.221 on br0.IPv4.
Registering new address record for 127.0.0.1 on lo.IPv4.
[2023-07-28 16:00:18] [  LOG]       db: Database OK with 396 active files and 6 active playlists
[2023-07-28 16:00:18] [  LOG]     mdns: Failed to create service browser: Bad state
[2023-07-28 16:00:18] [  LOG]     raop: Could not add mDNS browser for AirPlay devices
[2023-07-28 16:00:18] [  LOG]     mdns: Failed to create service browser: Bad state
[2023-07-28 16:00:18] [  LOG]  airplay: Could not add mDNS browser for AirPlay devices
[2023-07-28 16:00:18] [  LOG]     mdns: Failed to create service browser: Bad state
[2023-07-28 16:00:18] [  LOG]     cast: Could not add mDNS browser for Chromecast devices
[2023-07-28 16:00:19] [  LOG]     mdns: Failed to create service browser: Bad state
[2023-07-28 16:00:19] [FATAL]   remote: Could not browse for Remote services
[2023-07-28 16:00:19] [FATAL]     main: Remote pairing service failed to start
[2023-07-28 16:00:19] [  LOG]     main: MPD deinit
[2023-07-28 16:00:19] [  LOG]     main: HTTPd deinit
[2023-07-28 16:00:19] [  LOG]     scan: Scanned 200 files...
Server startup complete. Host name is nasbox.local. Local service cookie is 796284919.
[2023-07-28 16:00:20] [  LOG]     main: Player deinit
Service "nasbox" (/etc/avahi/services/timemachine.service) successfully established.
Service "AirPrint DNP_DS620 @ nasbox" (/etc/avahi/services/AirPrint-DNP_DS620.service) successfully established.
Static host name "nasbox.local" successfully established.
[2023-07-28 16:00:20] [  LOG]     main: Library scanner deinit
[2023-07-28 16:00:21] [  LOG]  spotify: No spotify refresh token found
[2023-07-28 16:00:21] [  LOG]  spotify: Spotify webapi token refresh failed. In order to use the web api, authorize forked-daapd to access your saved tracks by visiting http://forked-daapd.local:3689
[2023-07-28 16:00:23] [  LOG]      lib: Library init scan completed in 5 sec (3 changes)
[2023-07-28 16:00:24] [  LOG]     main: Cache deinit
[2023-07-28 16:00:24] [  LOG]     main: Worker deinit
[2023-07-28 16:00:24] [  LOG]     main: Database deinit
[2023-07-28 16:00:24] [  LOG]     main: mDNS deinit
[2023-07-28 16:00:24] [  LOG]     main: Exiting.
Failed to set ownership on logfile: Operation not permitted
[2023-07-28 16:00:24] [  LOG]     main: Forked Media Server Version 27.4 taking off
[2023-07-28 16:00:24] [  LOG]     main: Built with:
[2023-07-28 16:00:24] [  LOG]     main: - ffmpeg
[2023-07-28 16:00:24] [  LOG]     main: - Spotify
[2023-07-28 16:00:24] [  LOG]     main: - LastFM
[2023-07-28 16:00:24] [  LOG]     main: - Chromecast
[2023-07-28 16:00:24] [  LOG]     main: - MPD
[2023-07-28 16:00:24] [  LOG]     main: - Websockets
[2023-07-28 16:00:24] [  LOG]     main: - ALSA
[2023-07-28 16:00:24] [  LOG]     main: - Webinterface
[2023-07-28 16:00:24] [  LOG]     main: - Regex
[2023-07-28 16:00:24] [  LOG]     main: mDNS init
[2023-07-28 16:00:24] [  LOG]     mdns: Avahi state change: Client running
[2023-07-28 16:00:24] [  LOG]       db: Configured to use database file '/config/dbase_and_logs/songs3.db'
[2023-07-28 16:00:24] [  LOG]       db: Now vacuuming database, this may take some time...
[2023-07-28 16:00:24] [  LOG]       db: Database OK with 1201 active files and 6 active playlists
[2023-07-28 16:00:24] [  LOG]     scan: Scanned 200 files...
github-actions[bot] commented 11 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

LinuxServer-CI commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

philippelt commented 10 months ago

Is there any information missing ? No one have an idea :smiley: For the moment, I will force use of 27.x so there is no big issue for me but I would have like to understand the problem and possibly find a work-around or solution...

LinuxServer-CI commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 6 months ago

This issue is locked due to inactivity