OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: alexroz on February 07, 2022, 07:37:17 pm

Title: Can't start AdGuard plug-in after opnsense upgrade
Post by: alexroz on February 07, 2022, 07:37:17 pm
Is it just me or others can't start AdGuard after opnsense 22.1 upgrade too?
AdGuardHome (os-adguardhome-maxit) from https://www.routerperformance.net/opnsense-repo/ worked fine immediately after upgrade to Opnsense 22.1. But after a couple of hours, adguard crashed and I can't start it anymore.
ref: https://github.com/mimugmail/opn-repo/issues/93
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: Vesalius on February 07, 2022, 09:27:20 pm
AdGuard continues to work just fine for me after the upgrade, so it’s not a universal issue.
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: mimugmail on February 07, 2022, 09:46:29 pm
Maybe Firewall just needs an additional reboot
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: alexroz on February 08, 2022, 08:35:22 pm
Maybe Firewall just needs an additional reboot

Unfortunately, an additional reboot didn't help AdGuard to start. It seems that the issue calls for a much more thorough investigation. Although I am competent enough to ssh into the Opnsense box I don't know which logs I can check in order to discover the issue's root cause.
And I'll much appreciate it if you could explain to me how can I backup Adguards configs in case I'll reinstall it or the entire Opnsense.
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: alexroz on February 10, 2022, 05:45:21 pm
There is a link to a corresponding issue at https://github.com/mimugmail/opn-repo/issues/93
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: cookiemonster on February 11, 2022, 02:20:58 pm
Works fine for me on 22.1 but I always wanted to know where to find the AdGuard logs anyway. It led me to understand Adguard does not have logging for freeBSD https://github.com/AdguardTeam/AdGuardHome/issues/4213 (https://github.com/AdguardTeam/AdGuardHome/issues/4213)
On that issue I've been given a potential option to get some logging going. I'll try it and report back.
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: cookiemonster on February 11, 2022, 03:43:04 pm
yes I've tested it and logging can be done.
1. Stop the service from the plugin UI.
I didn't find it possible to control it from the command line as per AdGuard docs ie. ./AdGuardHome -s --service VALUE
https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#configuration-file (https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#configuration-file) maybe I misread the command syntax.
2. Modify your yaml: /usr/local/AdGuardHome/AdGuardHome.yaml
Pupulate the parameter log_file:
I used log_file: /var/log/AdGuard.log
3. Start the service from the plugin UI.
Note: by default the parameter and value "verbose: false" gives some logging but not a lot. Changing it to true is the oppossite, as the name implies, verbose. So you might want to only keep it to true for a short time.
Title: Re: Can't start AdGuard plug-in after opnsense upgrade
Post by: alexroz on February 11, 2022, 06:00:32 pm
yes I've tested it and logging can be done.
1. Stop the service from the plugin UI.
I didn't find it possible to control it from the command line as per AdGuard docs ie. ./AdGuardHome -s --service VALUE
https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#configuration-file (https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#configuration-file) maybe I misread the command syntax.
2. Modify your yaml: /usr/local/AdGuardHome/AdGuardHome.yaml
Pupulate the parameter log_file:
I used log_file: /var/log/AdGuard.log
3. Start the service from the plugin UI.
Note: by default the parameter and value "verbose: false" gives some logging but not a lot. Changing it to true is the oppossite, as the name implies, verbose. So you might want to only keep it to true for a short time.

Thank you cookiemonster. That's what I'm talking about - Team work!
I descovered thet my  /usr/local/AdGuardHome/AdGuardHome.yaml were empty.
Beside it I found :
Code: [Select]
# ls -hal /usr/local/AdGuardHome/.AdGuardHome.yaml943720732
-rw-r--r--  1 root  wheel   3.7K Feb  5 07:21 /usr/local/AdGuardHome/.AdGuardHome.yaml943720732

I have added AdGuard logging line to AdGuardHome.yaml according to your instructions...
Code: [Select]
# cat /usr/local/AdGuardHome/AdGuardHome.yaml
log_file: /var/log/AdGuard.log

And launched adguard service:
Code: [Select]
service adguardhome onestatus
I'v got the following log:
Code: [Select]
# cat /var/log/AdGuard.log
2022/02/11 18:44:17.210037 [info] AdGuard Home, version v0.107.2
2022/02/11 18:44:17.210075 [info] AdGuard Home is running as a service
2022/02/11 18:44:17.210171 [info] home.upgradeSchema0to1(): called
2022/02/11 18:44:17.210179 [info] deleting /usr/local/AdGuardHome/dnsfilter.txt as we don't need it anymore
2022/02/11 18:44:17.210198 [info] home.upgradeSchema1to2(): called
2022/02/11 18:44:17.210204 [info] deleting /usr/local/AdGuardHome/Corefile as we don't need it anymore
2022/02/11 18:44:17.210220 [info] home.upgradeSchema2to3(): called
2022/02/11 18:44:17.210234 [fatal] dns configuration is not a map

So I renamed .AdGuardHome.yaml943720732 back to AdGuardHome.yaml and now I can launch adguard!