NathanVaughn / webtrees-docker

Up-to-date Docker image for webtrees with all the bells and whistles.
https://hub.docker.com/r/nathanvaughn/webtrees
MIT License
64 stars 16 forks source link

Connection refused #143

Closed nothing2obvi closed 4 months ago

nothing2obvi commented 4 months ago

Hello, I'd really like to use webtrees but I'm getting an error I can't figure out.

[NV_INIT] Automating setup wizard
[NV_INIT] Starting Apache in background
[NV_INIT] Disabling site webtrees-redir
Site webtrees-redir already disabled
[NV_INIT] Disabling site webtrees-ssl
Site webtrees-ssl already disabled
[NV_INIT] Enabling site webtrees
Site webtrees already enabled
[NV_INIT] Sending setup wizard request to http://127.0.0.1:80/
[NV_INIT] Attempt 0 for http://127.0.0.1:80/
Traceback (most recent call last):
  File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 851, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/socket.py", line 836, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/docker-entrypoint.py", line 558, in <module>
    main()
  File "/docker-entrypoint.py", line 543, in main
    setup_wizard()
  File "/docker-entrypoint.py", line 440, in setup_wizard
    retry_urlopen(
  File "/docker-entrypoint.py", line 200, in retry_urlopen
    resp = request.urlopen(url, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

This is my docker-compose.yml file:

version: "3"

services:
  app:
    container_name: webtrees
    depends_on:
      - db
    environment:
      - PRETTY_URLS=False
      - HTTPS=False
      - HTTPS_REDIRECT=False
      - LANG=en-US
      - BASE_URL=10.0.0.94
      - DB_TYPE=mysql
      - DB_HOST=db
      - DB_PORT=3306
      - DB_USER=username
      - DB_PASS=password-here
      - DB_NAME=webtrees
      - DB_PREFIX=wt_
      - WT_USER=name
      - WT_NAME=Name
      - WT_PASS=wt-password-here
      - WT_EMAIL=email-here
      - PUID=1000
      - PGID=1000
    image: ghcr.io/nathanvaughn/webtrees:latest
    ports:
      - 5990:80
      # - 443:443
    restart: unless-stopped
    volumes:
      # - ~/certs:/certs/
      - /Users/username/Docker/webtrees/data:/var/www/webtrees/data/
    labels:
      - com.centurylinklabs.watchtower.enable=true

  db:
    container_name: webtrees_db
    environment:
      - MARIADB_DATABASE=webtrees
      - MARIADB_USER=username
      - MARIADB_ROOT_PASSWORD=root-password-here
      - MARIADB_PASSWORD=password-here
    image: docker.io/library/mariadb:latest
    ports:
      - 7850:3306
    restart: unless-stopped
    volumes:
      - /Users/username/Docker/webtrees/db:/var/lib/mysql

  # db:
  #   environment:
  #     POSTGRES_DB: webtrees
  #     POSTGRES_USER: webtrees
  #     POSTGRES_PASSWORD: badpassword
  #   image: docker.io/library/postgres:latest
  #   restart: unless-stopped
  #   volumes:
  #     - db_data:/var/lib/postgresql/data

networks:
  default:
    name: lsio
    external: true

I have tried changing the 5990 to 80 (after removing the service I had on port 80) but that didn't work.

For BASE_URL I've tried 10.0.0.94:5990 and that didn't work either. Also tried that and 10.0.0.94 using http:// but that didn't work.

Any help would be greatly appreciated. Thank you!

nothing2obvi commented 4 months ago

I got it. Had to change DB_HOST=db to DB_HOST=webtrees_db

NathanVaughn commented 4 months ago

Yeah, that'll get you. I just pushed a new version that makes the database checks more explicit to hopefully make this more obivous