Giter VIP home page Giter VIP logo

Comments (10)

bakito avatar bakito commented on July 19, 2024

Hi @smorgan134

Please provide debug logs, otherwise I an not assist you: https://github.com/bakito/adguardhome-sync?tab=readme-ov-file#log-level

from adguardhome-sync.

smorgan134 avatar smorgan134 commented on July 19, 2024

Where can I get the debug logs?

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024

By setting the env variable LOG_LEVEL=debug

from adguardhome-sync.

smorgan134 avatar smorgan134 commented on July 19, 2024

Here is the log entry I get...

2023-12-19T17:05:16.684Z INFO sync sync/sync.go:38 AdGuardHome sync {"version": "v0.5.2", "build": "2023-11-23T07:13:51Z", "os": "linux", "arch": "amd64"}
2023-12-19T17:05:16.685Z DEBUG sync types/types.go:70 Using config {"config": {"origin":{"url":"http://10.134.50.4","apiPath":"/control","username":"m***n","password":"e***$","insecureSkipVerify":false,"autoSetup":false,"interfaceName":""},"replica":{"url":"http://10.134.50.5","apiPath":"/control","username":"m***n","password":"e***$","insecureSkipVerify":false,"autoSetup":false,"interfaceName":""},"cron":"*/1 * * * ","runOnStart":true,"api":{"port":8080},"features":{"dns":{"accessLists":true,"serverConfig":true,"rewrites":true},"dhcp":{"serverConfig":true,"staticLeases":true},"generalSettings":true,"queryLogConfig":true,"statsConfig":true,"clientSettings":true,"services":true,"filters":true}}}
2023-12-19T17:05:16.685Z INFO sync sync/sync.go:65 Setup cronjob {"cron": "
/1 * * * *", "next-execution": "2023-12-19T17:06:00.000Z"}
2023-12-19T17:05:16.685Z INFO sync sync/http.go:57 Starting API server {"port": 8080}
2023-12-19T17:05:16.685Z INFO sync sync/sync.go:75 Running sync on startup
2023-12-19T17:05:16.686Z DEBUG client client/client-methods.go:16 do get {"host": "10.134.50.4", "method": "GET", "path": "status", "username": "mvadmin"}
2023-12-19T17:05:16.768Z DEBUG client client/client-methods.go:32 got response {"host": "10.134.50.4", "method": "GET", "path": "status", "username": "mvadmin", "status": 403, "body": "Forbidden", "content-type": ["text/plain; charset=utf-8"]}
2023-12-19T17:05:16.768Z ERROR sync sync/sync.go:153 Error getting origin status {"from": "10.134.50.4", "error": "403 Forbidden(Forbidden)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:153
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/go/src/app/pkg/sync/sync.go:76

Additional information...I have this server pointed to BIND DNS servers for DNS, and the BIND DNS servers are forwarding to the Adguard instances. I don't think that's going to be the point of failure, but I'm sure it's useful info.

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024

403 means something is wrong with authentication.

How is your config?
How do you start the container?

Did you chechk https://github.com/bakito/adguardhome-sync/wiki/FAQ ?

from adguardhome-sync.

smorgan134 avatar smorgan134 commented on July 19, 2024

Here is my docker-compose file...

version: "2.1"
services:
adguardhome-sync:
image: ghcr.io/bakito/adguardhome-sync
container_name: adguardhome-sync
command: run
environment:
LOG_LEVEL: "debug"
ORIGIN_URL: "http://10.134.50.4"
ORIGIN_USERNAME: "username"
ORIGIN_PASSWORD: 'password with special characters'
REPLICA_URL: "http://10.134.50.5"
REPLICA_USERNAME: "username"
REPLICA_PASSWORD: 'password with special characters'
CRON: "*/1 * * * *"
RUNONSTART: true
ports:
- 8080:8080
restart: unless-stopped

I changed the double quotes I had around the password for single quotes like it suggests because my password has special characters. It is still giving me the same error. See log below.

2023-12-19T17:33:00.030Z DEBUG client client/client-methods.go:16 do get {"host": "10.134.50.4", "method": "GET", "path": "status", "username": "mvadmin"}
2023-12-19T17:33:00.114Z DEBUG client client/client-methods.go:32 got response {"host": "10.134.50.4", "method": "GET", "path": "status", "username": "mvadmin", "status": 403, "body": "Forbidden", "content-type": ["text/plain; charset=utf-8"]}
2023-12-19T17:33:00.114Z ERROR sync sync/sync.go:153 Error getting origin status {"from": "10.134.50.4", "error": "403 Forbidden(Forbidden)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:153
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:59
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312

I double checked the login information is correct on both instances, and they are indeed correct.

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024

can you reach the adguardhome instances from the server where adguardhome is running?

curl -u '<username>:<password>' http://10.134.50.4/control/status -v

or with special characters

export AGH_AUTH=$(echo -n '<username>:<password>' | base64)
curl -H "Authorization: Basic ${AGH_AUTH}" http://10.134.50.4/control/status -v

Please also check the logs of adguardhome, any errors there?

from adguardhome-sync.

smorgan134 avatar smorgan134 commented on July 19, 2024

This is what I got using...

export AGH_AUTH=$(echo -n ':' | base64)
curl -H "Authorization: Basic ${AGH_AUTH}" http://10.134.50.4/control/status -v

  • Trying 10.134.50.4:80...
  • Connected to 10.134.50.4 (10.134.50.4) port 80 (#0)

GET /control/status HTTP/1.1
Host: 10.134.50.4
User-Agent: curl/7.81.0
Accept: /
Authorization: Basic ......................=

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Content-Type: application/json
    < Server: AdGuardHome/v0.107.43
    < Vary: Accept-Encoding
    < Date: Tue, 19 Dec 2023 19:41:54 GMT
    < Content-Length: 245
    <
    {"version":"v0.107.43","language":"","dns_addresses":["127.0.0.1","::1","10.134.50.4","fe80::4001:aff:fe86:3204%ens4"],"dns_port":53,"http_port":80,"protection_disabled_duration":0,"protection_enabled":true,"dhcp_available":true,"running":true}
  • Connection #0 to host 10.134.50.4 left intact

I'm not sure where to find the Adguard Log files.

from adguardhome-sync.

bakito avatar bakito commented on July 19, 2024

do you have dollar signs in your password, then you'll need to escape them according to docker-compose documentation:
https://github.com/compose-spec/compose-spec/blob/master/spec.md#interpolation

Password: 'my$ecurePWD' -> docker-compose 'my$$ecurePWD'

You can use a $$ (double-dollar sign) when your configuration needs a literal dollar sign. This also prevents Compose from interpolating a value, so a $$ allows you to refer to environment variables that you don't want processed by Compose.

from adguardhome-sync.

smorgan134 avatar smorgan134 commented on July 19, 2024

I got the dollar signs out of my password and did the trick! Thanks for your help!

from adguardhome-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.