AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home/overview.html
GNU General Public License v3.0
25.76k stars 1.85k forks source link

Snap service fails to start on boot but can be started manually #7081

Open sbe-arg opened 5 months ago

sbe-arg commented 5 months ago

Prerequisites

Platform (OS and CPU architecture)

Ubuntu 24

Installation

Snapcraft

Setup

On one machine

AdGuard Home version

latest-snap

Action

sudo systemctl status snap.adguard-home.adguard-home.service 
× snap.adguard-home.adguard-home.service - Service for snap application adguard-home.adguard-home
     Loaded: loaded (/etc/systemd/system/snap.adguard-home.adguard-home.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2024-06-18 12:51:52 NZST; 7min ago
   Duration: 127ms
    Process: 2717 ExecStart=/usr/bin/snap run adguard-home (code=exited, status=1/FAILURE)
   Main PID: 2717 (code=exited, status=1/FAILURE)
        CPU: 101ms

Jun 18 12:51:52 hp-z240 systemd[1]: snap.adguard-home.adguard-home.service: Failed with result 'exit-code'.
Jun 18 12:51:52 hp-z240 systemd[1]: snap.adguard-home.adguard-home.service: Scheduled restart job, restart counter is at 5.
Jun 18 12:51:52 hp-z240 systemd[1]: snap.adguard-home.adguard-home.service: Start request repeated too quickly.
Jun 18 12:51:52 hp-z240 systemd[1]: snap.adguard-home.adguard-home.service: Failed with result 'exit-code'.
Jun 18 12:51:52 hp-z240 systemd[1]: Failed to start snap.adguard-home.adguard-home.service - Service for snap application adguard-home.adguard-home.

Expected result

service to start on boot

Actual result

fails

Additional information and/or screenshots

ubuntu 24.0

sbe-arg commented 5 months ago

More context, it makes not diff if U purge and fresh install under another port, ip etc

boot log

adguard-home.adguard-home[2414]: 2024/06/18 13:16:32.504324 [fatal] listen tcp 192.168.1.2:3001: bind: cannot assign requested address

manual snap service start adguard-home

adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969262 [info] dnsproxy: starting dns proxy server
adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969284 [info] dnsproxy: creating udp server socket 192.168.1.2:53
adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969353 [info] dnsproxy: listening to udp://192.168.1.2:53
adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969362 [info] dnsproxy: creating tcp server socket 192.168.1.2:53
adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969404 [info] dnsproxy: listening to tcp://192.168.1.2:53
adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969453 [info] dnsproxy: entering udp listener loop on 192.168.1.2:53
adguard-home.adguard-home[7478]: 2024/06/18 13:17:17.969525 [info] dnsproxy: entering tcp listener loop on 192.168.1.2:53
ainar-g commented 5 months ago

Some additional questions:

  1. What version exactly are you using?

  2. Is the address actually available on the machine? I.e., is it present in the ifconfig or ip a outputs?

sbe-arg commented 5 months ago

Version

v0.107.51

And yes the ip is static for the server. I select eno1 during adguard fresh setup.

Adguard is running and active. Restart server (as would happen for kernel pactches) adguard is not running.

I tried setting different ports for the web console seems to be a race condition at the interface because if I expose 0.0.0.0:53 instead of 192.168.1.2:53 udp this does not happen.

Although I do not want to expose :53 in all interfaces I only want to use services over eno1 or other enoX but not docker, local or any other virtual vpn etc.

sbe-arg commented 5 months ago

The problem only happens when selecting both web console and 53 UDP over eno1