Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[401 Error](CouchDB)Host is not accessible, retrying...∞ #330

Open
anonymous-99529 opened this issue Feb 24, 2024 · 1 comment
Open

[401 Error](CouchDB)Host is not accessible, retrying...∞ #330

anonymous-99529 opened this issue Feb 24, 2024 · 1 comment
Labels

Comments

@anonymous-99529
Copy link

anonymous-99529 commented Feb 24, 2024

Host OS: Synology NAS DSM 7.2.

Issue: Can't access to CouchDB(PostgreSQL backup works fine).

Here is my docker-compose.yml:

version: "3.9"

services:
  couchdb:
    container_name: couchdb
    hostname: couchdb
    image: couchdb
    networks:
      - db
    ports:
      - 5984:5984
    volumes:
      - /volume1/docker/couchdb/data:/opt/couchdb/data
      - /volume1/docker/couchdb/local.ini:/opt/couchdb/etc/local.ini
    environment:
      - COUCHDB_USER=*REDACTED* # enter the desired CouchDB admin username
      - COUCHDB_PASSWORD=*REDACTED* # enter the desired CouchDB admin password
    restart: unless-stopped

  postgres:
    container_name: postgres
    hostname: postgres
    image: postgres:16
    networks:
      - db
    ports:
      - 5432:5432
    volumes:
      - /volume1/docker/postgres:/var/lib/postgresql/data
    environment:
      - TZ=Asia/Seoul
      - POSTGRES_PASSWORD=*REDACTED*
      - POSTGRES_USER=*REDACTED*
      - POSTGRES_DB=*REDACTED*
    restart: unless-stopped

db-backup:
    container_name: db-backup
    image: tiredofit/db-backup
    networks:
      - db
    volumes:
      - /volume1/docker/db-backup:/backup
      #- ./post-script.sh:/assets/custom-scripts/post-script.sh
    environment:
      - TIMEZONE=Asia/Seoul
      - CONTAINER_NAME=db-backup
      - CONTAINER_ENABLE_MONITORING=FALSE
      - DEBUG_MODE=TRUE
      - BACKUP_JOB_CONCURRENCY=2     # Run two jobs at a time
      - DEFAULT_CHECKSUM=NONE        # Don't create checksums
      - DEFAULT_COMPRESSION=ZSTD     # Compress all with ZSTD
      - DEFAULT_COMPRESSION_LEVEL=19
      - DEFAULT_BACKUP_INTERVAL=60   # Backup every 60 minutes
      - DEFAULT_BACKUP_BEGIN=0030    # Start backing up at 00:30
      - DEFAULT_CLEANUP_TIME=420     # Cleanup backups after 7 hours
      - DEFAULT_BACKUP_BLACKOUT_BEGIN=1159
      - DEFAULT_BACKUP_BLACKOUT_END=0001
      - DB01_TYPE=couch
      - DB01_HOST=couchdb
      - DB01_PORT=5984
      - DB01_NAME=ALL
      - DB01_USER=REDACTED
      - DB01_PASS=REDACTED
      - DB02_TYPE=pgsql
      - DB02_HOST=postgres
      - DB02_PORT=5432
      - DB02_NAME=ALL
      - DB02_USER=REDACTED
      - DB02_PASS=REDACTED
    restart: always

networks:
  db:
    external: true

And this is the log:

2024/02/24 23:39:16 | stdout | 2024-02-24.23:39:16 �[44m[WARN]�[49m /etc/services.available/dbbackup-01/run ** [01-couchdb__ALL] CouchDB Host 'couchdb' is not accessible, retrying.. (15 seconds so far)
-- | -- | --
2024/02/24 23:39:16 | stderr | + set +x
2024/02/24 23:39:16 | stderr | + '[' true = true ']'
2024/02/24 23:39:16 | stderr | + output_off
2024/02/24 23:39:16 | stderr | + '[' '' = yes ']'
2024/02/24 23:39:16 | stderr | + '[' '' = true ']'
2024/02/24 23:39:16 | stderr | + var_true ''
2024/02/24 23:39:16 | stderr | + write_log warn 'CouchDB Host '\''couchdb'\'' is not accessible, retrying.. (15 seconds so far)'
2024/02/24 23:39:16 | stderr | + ((  counter+=5  ))
2024/02/24 23:39:11 | stderr | + sleep 5
2024/02/24 23:39:11 | stderr | + '[' 401 = 200 ']'
2024/02/24 23:39:11 | stderr | + code_received=401
2024/02/24 23:39:11 | stderr | ++ sudo -Eu dbbackup curl -XGET -sSL -o /dev/null -L -w '%{http_code}' couchdb:5984
2024/02/24 23:39:11 | stderr | ++ run_as_user curl -XGET -sSL -o /dev/null -L -w '%{http_code}' couchdb:5984
2024/02/24 23:39:11 | stderr | + '[' 401 '!=' 200 ']'
2024/02/24 23:39:11 | stderr | + '[' '' = yes ']'
2024/02/24 23:39:11 | stderr | + '[' '' = true ']'
2024/02/24 23:39:11 | stderr | + var_true ''
2024/02/24 23:39:11 | stderr | + set -x
2024/02/24 23:39:11 | stderr | + case "$PWD" in
2024/02/24 23:39:11 | stderr | ++ basename ./run
2024/02/24 23:39:11 | stderr | + case "$(basename "$0")" in
2024/02/24 23:39:11 | stderr | + '[' true = true ']'
2024/02/24 23:39:11 | stderr | + output_on
2024/02/24 23:39:11 | stdout | 2024-02-24.23:39:11 �[44m[WARN]�[49m /etc/services.available/dbbackup-01/run ** [01-couchdb__ALL] CouchDB Host 'couchdb' is not accessible, retrying.. (10 seconds so far)
2024/02/24 23:39:11 | stderr | + set +x
2024/02/24 23:39:11 | stderr | + '[' true = true ']'
2024/02/24 23:39:11 | stderr | + output_off
2024/02/24 23:39:11 | stderr | + '[' '' = yes ']'
2024/02/24 23:39:11 | stderr | + '[' '' = true ']'
2024/02/24 23:39:11 | stderr | + var_true ''
2024/02/24 23:39:11 | stderr | + write_log warn 'CouchDB Host '\''couchdb'\'' is not accessible, retrying.. (10 seconds so far)'
2024/02/24 23:39:11 | stderr | + ((  counter+=5  ))
2024/02/24 23:39:06 | stderr | + sleep 5
2024/02/24 23:39:06 | stderr | + '[' 401 = 200 ']'
2024/02/24 23:39:06 | stderr | + code_received=401
2024/02/24 23:39:06 | stderr | ++ sudo -Eu dbbackup curl -XGET -sSL -o /dev/null -L -w '%{http_code}' couchdb:5984
2024/02/24 23:39:06 | stderr | ++ run_as_user curl -XGET -sSL -o /dev/null -L -w '%{http_code}' couchdb:5984
2024/02/24 23:39:06 | stderr | + '[' 401 '!=' 200 ']'
2024/02/24 23:39:06 | stderr | + '[' '' = yes ']'
2024/02/24 23:39:06 | stderr | + '[' '' = true ']'
2024/02/24 23:39:06 | stderr | + var_true ''
2024/02/24 23:39:06 | stderr | + set -x
2024/02/24 23:39:06 | stderr | + case "$PWD" in
2024/02/24 23:39:06 | stderr | ++ basename ./run
2024/02/24 23:39:06 | stderr | + case "$(basename "$0")" in
2024/02/24 23:39:06 | stderr | + '[' true = true ']'
2024/02/24 23:39:06 | stderr | + output_on
2024/02/24 23:39:06 | stdout | 2024-02-24.23:39:06 �[44m[WARN]�[49m /etc/services.available/dbbackup-01/run ** [01-couchdb__ALL] CouchDB Host 'couchdb' is not accessible, retrying.. (5 seconds so far)
2024/02/24 23:39:06 | stderr | + set +x
2024/02/24 23:39:06 | stderr | + '[' true = true ']'
2024/02/24 23:39:06 | stderr | + output_off
2024/02/24 23:39:06 | stderr | + '[' '' = yes ']'
2024/02/24 23:39:06 | stderr | + '[' '' = true ']'
2024/02/24 23:39:06 | stderr | + var_true ''
2024/02/24 23:39:06 | stderr | + write_log warn 'CouchDB Host '\''couchdb'\'' is not accessible, retrying.. (5 seconds so far)'
2024/02/24 23:39:06 | stderr | + ((  counter+=5  ))
2024/02/24 23:39:01 | stderr | + sleep 5
2024/02/24 23:39:01 | stderr | + '[' 401 = 200 ']'
2024/02/24 23:39:01 | stderr | + code_received=401
2024/02/24 23:39:01 | stderr | ++ sudo -Eu dbbackup curl -XGET -sSL -o /dev/null -L -w '%{http_code}' couchdb:5984
2024/02/24 23:39:01 | stderr | ++ run_as_user curl -XGET -sSL -o /dev/null -L -w '%{http_code}' couchdb:5984

.
.
.
Repeating endlessly.
Getting error code 401 and can't access the host.
I believe I have written docker-compose.yml correctly. Or am I missing something?
Please let me know what am I missing. I have no idea at all.

@anonymous-99529 anonymous-99529 changed the title [401 Error] Host is not accessible, retrying...∞ [401 Error](CouchDB)Host is not accessible, retrying...∞ Feb 25, 2024
@ryryonline
Copy link

While not much of a coder myself, I was looking into it and CouchDB requires a login to access the database. The code looks like it isn't passing the username and password to the curl URL to pull data. Just a guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants