hassio-addons / addon-adguard-home

AdGuard Home - Home Assistant Community Add-ons
https://addons.community
MIT License
389 stars 48 forks source link

AdGuard Home doesn't start: /var/run/s6/etc/cont-init.d/adguard.sh: line 29: null: unbound variable #181

Closed Shamilik closed 3 years ago

Shamilik commented 3 years ago

Problem/Motivation

[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] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: AdGuard Home
 Network-wide ads & trackers blocking DNS server
-----------------------------------------------------------
 Add-on version: 4.1.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.13  (armv7 / raspberrypi3)
 Home Assistant Core: 2021.5.5
 Home Assistant Supervisor: 2021.04.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to TRACE
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adguard.sh: executing... 
[12:16:29] TRACE: bashio::fs.file_exists: /data/adguard/AdGuardHome.yaml
[12:16:29] TRACE: bashio::addon.port 53/udp
[12:16:29] TRACE: bashio::addons self addons.self.network.53-udp .network["53/udp"] // empty
[12:16:29] TRACE: bashio::cache.exists: addons.self.network.53-udp
[12:16:29] TRACE: bashio::fs.file_exists: /tmp/.bashio/addons.self.network.53-udp.cache
[12:16:29] TRACE: bashio::var.false: self
[12:16:29] TRACE: bashio::cache.exists: addons.self.info
[12:16:29] TRACE: bashio::fs.file_exists: /tmp/.bashio/addons.self.info.cache
[12:16:29] TRACE: bashio::cache.get: addons.self.info
[12:16:29] TRACE: bashio::cache.exists: addons.self.info
[12:16:29] TRACE: bashio::fs.file_exists: /tmp/.bashio/addons.self.info.cache
[12:16:29] TRACE: bashio::var.has_value: .network["53/udp"] // empty
[12:16:29] TRACE: bashio::jq: {"name":"AdGuard Home","slug":"X","hostname":"X","dns":["X"],"description":"Network-wide ads & trackers blocking DNS server","long_description":"# Home Assistant Community Add-on: AdGuard Home
[![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]
[![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum]
[![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors]
[![Support Frenck on Patreon][patreon-shield]][patreon]
Network-wide ads & trackers blocking DNS server.
## About
AdGuard Home is a network-wide ad-and-tracker blocking DNS server with
parental control (adult content blocking) capabilities. Its purpose is to let
you control your entire network and all your devices, and it does not require
using a client-side program.
AdGuard Home provides a beautiful, easy and feature-rich web interface to
easily manage the filtering process and its settings.
![AdGuard Home in the Home Assistant frontend][screenshot]
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
[discord]: https://discord.me/hassioaddons
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
[forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-adguard-home/90684?u=frenck
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
[github-sponsors]: https://github.com/sponsors/frenck
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
[release-shield]: https://img.shields.io/badge/version-v4.1.3-blue.svg
[release]: https://github.com/hassio-addons/addon-adguard-home/tree/v4.1.3
[screenshot]: https://github.com/hassio-addons/addon-adguard-home/raw/v4.1.3/images/screenshot.png","advanced":false,"stage":"stable","auto_update":false,"repository":"a0d7b954","version":"4.1.3","version_latest":"4.1.3","update_available":false,"protected":true,"rating":5,"boot":"auto","options":{"ssl":true,"certfile":"fullchain.pem","keyfile":"privkey.pem","log_level":"trace"},"schema":[{"name":"log_level","optional":true,"type":"select","options":["trace","debug","info","notice","warning","error","fatal"]},{"name":"ssl","required":true,"type":"boolean"},{"name":"certfile","required":true,"type":"string"},{"name":"keyfile","required":true,"type":"string"},{"name":"leave_front_door_open","optional":true,"type":"boolean"}],"arch":["aarch64","amd64","armhf","armv7","i386"],"machine":[],"homeassistant":"0.113.2","url":"https://github.com/hassio-addons/addon-adguard-home","state":"started","detached":false,"available":true,"build":false,"network":{"53/udp":53,"80/tcp":null},"network_description":{"53/udp":"DNS server port","80/tcp":"Web interface (Not required for Ingress)"},"host_network":true,"host_pid":false,"host_ipc":false,"host_dbus":false,"privileged":[],"full_access":false,"apparmor":"default","devices":[],"icon":true,"logo":true,"changelog":true,"documentation":true,"stdin":false,"webui":null,"hassio_api":true,"hassio_role":"manager","auth_api":true,"homeassistant_api":false,"gpio":false,"usb":false,"uart":false,"kernel_modules":false,"devicetree":false,"udev":false,"docker_api":false,"video":false,"audio":false,"audio_input":null,"audio_output":null,"startup":"services","services":[],"discovery":["adguard"],"ip_address":"172.30.32.1","translations":{},"ingress":true,"ingress_entry":"/api/hassio_ingress/X","ingress_url":"/api/hassio_ingress/X/","ingress_port":64641,"ingress_panel":true,"watchdog":true} .network["53/udp"] // empty
[12:16:29] TRACE: bashio::cache.set: addons.self.network.53-udp 53
[12:16:29] TRACE: bashio::fs.directory_exists: /tmp/.bashio
[12:16:29] TRACE: bashio::var.has_value: null
/var/run/s6/etc/cont-init.d/adguard.sh: line 29: null: unbound variable
[cont-init.d] adguard.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.

 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Expected behavior

AdGuard starts without an error

Actual behavior

AdGuard Home doesn't start

frenck commented 3 years ago

Duplicate of #175

Fixed in 4.1.3

Shamilik commented 3 years ago

@frenck Add-on version: 4.1.3

frenck commented 3 years ago

Wut?

frenck commented 3 years ago

😢 AAARGH OK, back to the board.

Thanks for reporting in so quickly 👍

Shamilik commented 3 years ago

It got auto-updated today and broke home DNS, so reloaded releases page every minute :) Thanks you for fixing so quickly 👍

frenck commented 3 years ago

The problem with this one: I don't have a reproduction. I can't get this to trigger on any of my devices :(

tuxflo commented 3 years ago

Also updated to 4.1.3, facing the same problem. Is there anything we could provide to help you out with this? Trace logs?

frenck commented 3 years ago

I have to make another round anyways, used a different expression that should be less sensitive to this.

bsmeding commented 3 years ago

same problem here, didnt start so removed everything and reinstalled. now endup with error

[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] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: AdGuard Home
 Network-wide ads & trackers blocking DNS server
-----------------------------------------------------------
 Add-on version: 4.1.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.13  (amd64 / qemux86-64)
 Home Assistant Core: 2021.5.4
 Home Assistant Supervisor: 2021.04.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adguard.sh: executing... 
/var/run/s6/etc/cont-init.d/adguard.sh: line 27: null: unbound variable
[cont-init.d] adguard.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.

 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
frenck commented 3 years ago

@bsmeding Please make sure to upgrade to the latest version before reporting in.

2xdehelft commented 3 years ago

Disabling IPV6 in supervisor fixes the problem for me

frenck commented 3 years ago

@2xdehelft If that helps, this issue is not related to anything you have.

2xdehelft commented 3 years ago

OK since update this morning I got this error:

2021/05/20 11:55:15.341417 [fatal] couldn't start forwarding DNS server: couldn't listen to UDP socket, cause: listen udp [fe80::d0ba:2c0a:387b:7143]:53: bind: invalid argument

And Addguard kept rebooting. Disabling IP6 fixed it... Indeed might not be related.

bartsmykla commented 3 years ago

Now, after update to 4.1.4 it still doesn't want to start for me with logs:

[12:05:04] INFO: Starting AdGuard Home server...
2021/05/20 12:05:04.572697 [info] AdGuard Home, version v0.106.3
2021/05/20 12:05:04.574149 [info] home.upgradeSchema0to1(): called
2021/05/20 12:05:04.574213 [info] deleting /data/adguard/dnsfilter.txt as we don't need it anymore
2021/05/20 12:05:04.574294 [info] home.upgradeSchema1to2(): called
2021/05/20 12:05:04.574319 [info] deleting /data/adguard/Corefile as we don't need it anymore
2021/05/20 12:05:04.574375 [info] home.upgradeSchema2to3(): called
2021/05/20 12:05:04.574436 [info] home.upgradeSchema3to4(): called
2021/05/20 12:05:04.575059 [info] home.upgradeSchema4to5(): called
2021/05/20 12:05:04.575476 [info] home.upgradeSchema5to6(): called
2021/05/20 12:05:04.575517 [info] Upgrade yaml: 6 to 7
2021/05/20 12:05:04.576197 [info] Upgrade yaml: 7 to 8
2021/05/20 12:05:04.576561 [fatal] unexpected type of dns.bind_host: <nil>

in a loop

frenck commented 3 years ago

Thanks! That output from 4.1.4 actually helps! Not sure yet how to solve it, but at least it is some useful information the darn thing gives now 🕺

bartsmykla commented 3 years ago

@frenck no worries, just ping me if I can help more anyhow

Rijswijker commented 3 years ago

Is there a way to trigger/force the update without removing and reinstall Adguard by ssh or something? Because the big list with Adblock lists, mine is still on 4.1.2 and I see no update in Home Assistant.

frenck commented 3 years ago

4.1.5 is available, that should help with AdGuards migration 👍

bartsmykla commented 3 years ago

@frenck the same logs as before in 4.1.5

[12:28:53] INFO: Starting AdGuard Home server...
2021/05/20 12:28:54.059225 [info] AdGuard Home, version v0.106.3
2021/05/20 12:28:54.060333 [info] home.upgradeSchema0to1(): called
2021/05/20 12:28:54.060395 [info] deleting /data/adguard/dnsfilter.txt as we don't need it anymore
2021/05/20 12:28:54.060474 [info] home.upgradeSchema1to2(): called
2021/05/20 12:28:54.060499 [info] deleting /data/adguard/Corefile as we don't need it anymore
2021/05/20 12:28:54.060556 [info] home.upgradeSchema2to3(): called
2021/05/20 12:28:54.060612 [info] home.upgradeSchema3to4(): called
2021/05/20 12:28:54.060649 [info] home.upgradeSchema4to5(): called
2021/05/20 12:28:54.060686 [info] home.upgradeSchema5to6(): called
2021/05/20 12:28:54.060709 [info] Upgrade yaml: 6 to 7
2021/05/20 12:28:54.060730 [info] Upgrade yaml: 7 to 8
2021/05/20 12:28:54.060823 [fatal] unexpected type of dns.bind_host: <nil>
[12:28:54] INFO: Starting AdGuard Home server...
frenck commented 3 years ago

Is there a way to trigger/force the update without removing and reinstall Adguard by ssh or something?

@Rijswijker Go to the add-on store, top right ... -> reload

mythicaleinhorn commented 3 years ago

@Rijswijker Go to the Add-on Store and in the menu in the top right there is a refresh option. Then you can install the update as normal

bartsmykla commented 3 years ago

@frenck full logs here: image

Shamilik commented 3 years ago

^ Same here.

Rijswijker commented 3 years ago

@Rijswijker Go to the Add-on Store and in the menu in the top right there is a refresh option. Then you can install the update as normal

Thanks it is working again (v4.1.5)

frenck commented 3 years ago

I'm confused why it starts a 0

image

Something triggers it to start from scratch. Is it a fresh install? Have you re-installed in between?

bartsmykla commented 3 years ago

Yes, I have reinstalled it before

frenck commented 3 years ago

Yes, I have reinstalled it before

Right, that would explain something. I'm staring at a migration path, while this probably isn't one. 😬

IamDan77 commented 3 years ago

Here is my log if it helps (trace)

AdGuard Home provides a beautiful, easy and feature-rich web interface to
easily manage the filtering process and its settings.
![AdGuard Home in the Home Assistant frontend][screenshot]
[discord-shield]: https://img.shields.io/discord/478094546522079232.svg
[discord]: https://discord.me/hassioaddons
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
[forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-adguard-home/90684?u=frenck
[github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png
[github-sponsors]: https://github.com/sponsors/frenck
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
[release-shield]: https://img.shields.io/badge/version-v4.1.5-blue.svg
[release]: https://github.com/hassio-addons/addon-adguard-home/tree/v4.1.5
[screenshot]: https://github.com/hassio-addons/addon-adguard-home/raw/v4.1.5/images/screenshot.png","advanced":false,"stage":"stable","auto_update":false,"repository":"a0d7b954","version":"4.1.5","version_latest":"4.1.5","update_available":false,"protected":true,"rating":5,"boot":"auto","options":{"ssl":false,"certfile":"fullchain.pem","keyfile":"privkey.pem","log_level":"trace"},"schema":[{"name":"log_level","optional":true,"type":"select","options":["trace","debug","info","notice","warning","error","fatal"]},{"name":"ssl","required":true,"type":"boolean"},{"name":"certfile","required":true,"type":"string"},{"name":"keyfile","required":true,"type":"string"},{"name":"leave_front_door_open","optional":true,"type":"boolean"}],"arch":["aarch64","amd64","armhf","armv7","i386"],"machine":[],"homeassistant":"0.113.2","url":"https://github.com/hassio-addons/addon-adguard-home","state":"started","detached":false,"available":true,"build":false,"network":{"53/udp":53,"80/tcp":null},"network_description":{"53/udp":"DNS server port","80/tcp":"Web interface (Not required for Ingress)"},"host_network":true,"host_pid":false,"host_ipc":false,"host_dbus":false,"privileged":[],"full_access":false,"apparmor":"default","devices":[],"icon":true,"logo":true,"changelog":true,"documentation":true,"stdin":false,"webui":null,"hassio_api":true,"hassio_role":"manager","auth_api":true,"homeassistant_api":false,"gpio":false,"usb":false,"uart":false,"kernel_modules":false,"devicetree":false,"udev":false,"docker_api":false,"video":false,"audio":false,"audio_input":null,"audio_output":null,"startup":"services","services":[],"discovery":["adguard"],"ip_address":"172.30.32.1","translations":{},"ingress":true,"ingress_entry":"/api/hassio_ingress/IeIL2yH5bJx_yyv4rech4B30nXDPPGC55js2-q8b_3w","ingress_url":"/api/hassio_ingress/IeIL2yH5bJx_yyv4rech4B30nXDPPGC55js2-q8b_3w/","ingress_port":62248,"ingress_panel":true,"watchdog":false} .network["80/tcp"] // empty
[20:44:00] TRACE: bashio::cache.set: addons.self.network.80-tcp 
[20:44:00] TRACE: bashio::fs.directory_exists: /tmp/.bashio
[20:44:00] TRACE: bashio::var.has_value: 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:44:00] TRACE: bashio::net.wait_for 45158 localhost 900
[20:44:00] INFO: Starting AdGuard Home server...
2021/05/20 20:44:00.459921 [info] AdGuard Home, version v0.106.3
2021/05/20 20:44:00.461158 [info] home.upgradeSchema0to1(): called
2021/05/20 20:44:00.461841 [info] deleting /data/adguard/dnsfilter.txt as we don't need it anymore
2021/05/20 20:44:00.462570 [info] home.upgradeSchema1to2(): called
2021/05/20 20:44:00.463167 [info] deleting /data/adguard/Corefile as we don't need it anymore
2021/05/20 20:44:00.463808 [info] home.upgradeSchema2to3(): called
2021/05/20 20:44:00.464392 [info] home.upgradeSchema3to4(): called
2021/05/20 20:44:00.464927 [info] home.upgradeSchema4to5(): called
2021/05/20 20:44:00.465491 [info] home.upgradeSchema5to6(): called
2021/05/20 20:44:00.466092 [info] Upgrade yaml: 6 to 7
2021/05/20 20:44:00.466615 [info] Upgrade yaml: 7 to 8
2021/05/20 20:44:00.467155 [fatal] unexpected type of dns.bind_host: <nil>
bsmeding commented 3 years ago

after upgrade (hass and addon) still not working, same error log

-----------------------------------------------------------
 Add-on: AdGuard Home
 Network-wide ads & trackers blocking DNS server
-----------------------------------------------------------
 Add-on version: 4.1.5
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.13  (amd64 / qemux86-64)
 Home Assistant Core: 2021.5.5
 Home Assistant Supervisor: 2021.04.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] adguard.sh: executing... 
[cont-init.d] adguard.sh: exited 0.
[cont-init.d] discovery.sh: executing... 
[12:50:09] INFO: Successfully send discovery information to Home Assistant.
[cont-init.d] discovery.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[12:50:09] INFO: Starting AdGuard Home server...
2021/05/20 12:50:10.287585 [info] AdGuard Home, version v0.106.3
2021/05/20 12:50:10.289190 [info] home.upgradeSchema0to1(): called
2021/05/20 12:50:10.289336 [info] deleting /data/adguard/dnsfilter.txt as we don't need it anymore
2021/05/20 12:50:10.291227 [info] home.upgradeSchema1to2(): called
2021/05/20 12:50:10.292028 [info] deleting /data/adguard/Corefile as we don't need it anymore
2021/05/20 12:50:10.292603 [info] home.upgradeSchema2to3(): called
2021/05/20 12:50:10.292671 [info] home.upgradeSchema3to4(): called
2021/05/20 12:50:10.292765 [info] home.upgradeSchema4to5(): called
2021/05/20 12:50:10.293460 [info] home.upgradeSchema5to6(): called
2021/05/20 12:50:10.293485 [info] Upgrade yaml: 6 to 7
2021/05/20 12:50:10.293498 [info] Upgrade yaml: 7 to 8
2021/05/20 12:50:10.293520 [fatal] unexpected type of dns.bind_host: <nil>
[12:50:10] INFO: Starting AdGuard Home server...

It looks like the an ipv6 is added to hass host and the binding of port 53 cannot be made correctly, but it is a gues will try to get more info of the container

bartsmykla commented 3 years ago

I have disabled ipv6, so I'm not sure about it

frenck commented 3 years ago

It looks like the an ipv6 is added to hass host and the binding of port 53 cannot be made correctly

That error message has no relation to IPv6...

frenck commented 3 years ago

Just started the builds for 4.1.6, I'm pretty confident this time 🙏

I'm going to plan a bigger refactor around this configuration part. It should not be needed at all and parts of it are leftovers from a long time ago.

Anyways, 🙏

IamDan77 commented 3 years ago

Thanks for all your efforts!

IamDan77 commented 3 years ago

Mate. Its working a treat! Huge thanks

bartsmykla commented 3 years ago

@frenck thank you, it works now! :-)

jcsjacobs commented 3 years ago

Thanks alot for all the effort, its working again

Nenodema commented 3 years ago

Works great @frenck many thanks!

omurphy522 commented 3 years ago

Dude you rock! I came here to see if there was a quick fix and you have been tirelessly working on this all night. Everyone here thanks you!

tuxflo commented 3 years ago

Hmmm I did a clean and fresh install and adguard ist starting fine. But it seems it couldn't get the correct IP Adress from the host. In the setup guid it just shows "try to use 127.0.0.1 in your router" whereas in the previous versions it showed the correct IP address (192.168.x.x in my case). My connected clients are also not able to resolve IP addresses so it is not fixed for me.

frenck commented 3 years ago

@tuxflo Restart the add-on once more.

Nenodema commented 3 years ago

@tuxflo Restart the add-on once more.

I can confirm this!

jhogendorn commented 3 years ago

Updated to 4.1.6, seemed ok, bound to the correct host ip. Reenabled ipv6, now it only binds to the docker network. disabled ipv6, only binds to the docker network still. No luck with multiple restarts. Getting this in log:

[21:48:42] ERROR: Got unexpected response from the API: Interface default does not exist

jhogendorn commented 3 years ago

rebooting host brought it good again, with ipv6 disabled.

frenck commented 3 years ago

@jhogendorn That sounds like you are running an unsupported installation (and is not related to this issue).

jhogendorn commented 3 years ago

its a bog standard hassos install on an rpi, i dont really understand your comment about an unsupported installation. Its certainly not doing anything custom.

frenck commented 3 years ago

@jhogendorn It might be an upstream bug in that case? Dunno? The add-on gets the info used from the Supervisor.

However, happy to debug and investigate, but in a separate issue; as this issue is not related.