Skip to content

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

Open
@anonymous-99529

Description

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.

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions