bakito / adguardhome-sync

🛡️ Synchronize AdGuard Home config to replicas
Apache License 2.0
832 stars 36 forks source link

"403 forbidden" My username does not contain $ signs #377

Open pickles4evaaaa opened 1 month ago

pickles4evaaaa commented 1 month ago

What happened?

My origin AdGuard instance is not playing nice with sync. I have verified that the address, username, and password are all correct. My replica 1 server can be logged into just fine. I am running AdguardHome-Sync in a container that is on the same machine as my origin AGH instance.

AdguardHome-Sync Version

v0.6.12

AdguardHome Version

v0.107.52

Configuration

---
version: "2.1"

volumes:
  adguardhome-sync:

services:
  adguardhome-sync:
    image: ghcr.io/bakito/adguardhome-sync
    container_name: adguardhome-sync
    command: run --config /config/adguardhome-sync.yaml
    volumes:
      - /home/adguardhome-sync.yaml:/config/adguardhome-sync.yaml
    ports:
      - 8083:8080
    restart: unless-stopped
    environment:
      - RUNONSTART=true
      - LOG_LEVEL=info
      - CRON=*/10 * * * *
      - ORIGIN_URL=http://192.168.69.74
      - ORIGIN_USERNAME=xxxx
      - ORIGIN_PASSWORD=xxxx
      - REPLICA_URL=http://192.168.69.253
      - REPLICA_USERNAME=xxxx
      - REPLICA_PASSWORD=xxxx

Relevant log output

2024-07-26T00:53:38.383Z    ERROR   sync    sync/sync.go:136    Error getting origin status {"from": "192.168.69.74", "error": "403 Forbidden(Forbidden)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).getStatus
    /go/src/app/pkg/sync/sync.go:136
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).status
    /go/src/app/pkg/sync/sync.go:98
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).handleRoot
    /go/src/app/pkg/sync/http.go:40
github.com/gin-gonic/gin.(*Context).Next
    /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
    /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
    /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
    /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
    /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
    /usr/local/go/src/net/http/server.go:3142
net/http.(*conn).serve
    /usr/local/go/src/net/http/server.go:2044

Anything else?

No response

bakito commented 1 month ago

Hi @pickles4evaaaa Did you check https://github.com/bakito/adguardhome-sync/wiki/FAQ#sync-error-403-forbidden--401-unauthorized ? Is your password field in single quotes?

pickles4evaaaa commented 1 month ago

Hi @pickles4evaaaa Did you check https://github.com/bakito/adguardhome-sync/wiki/FAQ#sync-error-403-forbidden--401-unauthorized ? Is your password field in single quotes?

I rechecked my config file and still no dice. I am going to paste my updated config, as my original did not have the quotations.

Here is what is in my docker-compose file on portainer stack: https://pastebin.com/X28rAFzb

Thanks

bakito commented 1 month ago

Try SINGLE quotes 'xxx' not DOUBLE quotes

pickles4evaaaa commented 1 month ago

Try SINGLE quotes 'xxx' not DOUBLE quotes

I will try this- should I switch all of the double quotes to single quotes in the compose file? Or just the username and password of the origin server?

bakito commented 1 month ago

At least username and password, for the rest, it should not matter. Docker compose interpretes some characters, when they are in double quotes. With single quotes they should be kept as is.

pickles4evaaaa commented 1 month ago

At least username and password, for the rest, it should not matter. Docker compose interpretes some characters, when they are in double quotes. With single quotes, they should be kept as is.

No luck, still getting an error. For what it's worth, I can connect to the replica server just fine using the same setup in the config file as the origin. Meaning, the application can reach my replica1 server with no issue whereas it doesn't want to connect to my origin.

bakito commented 1 month ago

Have you considered using a different password, or the same as for your replica?

There's not much more I can do here, sorry