danielperna84 / hass-configurator

Configuration UI for Home Assistant
MIT License
306 stars 168 forks source link

urlopen error accessi api #246

Closed fragolinux closed 3 months ago

fragolinux commented 3 months ago

hi, i've this docker-compose.yml

services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - ./data:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    ports:
      - '8123:8123'
    # enable following 2 lines in case of error: "<jemalloc>: Unsupported system page size"
    # environment:
    #   - DISABLE_JEMALLOC=true
    # enable following 2 lines to pass zigbee dongles directly to the container, details in README.md
    # devices:
    #   - /dev/serial/by-id/DEVICE_ID:/dev/ttyUSB0
  ha-configurator:
    container_name: ha-configurator
    restart: unless-stopped
    volumes:
      - ./data:/hass-config
      - ./data_configurator:/config
    ports:
      - 3218:3218
    image: causticlab/hass-configurator-docker:latest
    environment:
      HC_BASEPATH: "/hass-config/"
      ENFORCE_BASEPATH: true
      HC_HASS_API_PASSWORD: "LONG_LIVE_TOKEN_REDACTED"
      HASS_API_PASSWORD: "LONG_LIVE_TOKEN_REDACTED"

but if i try to restart HA from inside the hass-configurator, i see this in logs:

ha-configurator  | No configuration file found proceeding with default values
ha-configurator  | INFO:2024-05-27 08:41:17,120:hass_configurator.configurator:Starting server
ha-configurator  | INFO:2024-05-27 08:41:17,121:hass_configurator.configurator:Listening on: http://0.0.0.0:3218
homeassistant    | s6-rc: info: service s6rc-oneshot-runner: starting
homeassistant    | s6-rc: info: service s6rc-oneshot-runner successfully started
homeassistant    | s6-rc: info: service fix-attrs: starting
homeassistant    | s6-rc: info: service fix-attrs successfully started
homeassistant    | s6-rc: info: service legacy-cont-init: starting
homeassistant    | s6-rc: info: service legacy-cont-init successfully started
homeassistant    | s6-rc: info: service legacy-services: starting
homeassistant    | services-up: info: copying legacy longrun home-assistant (no readiness notification)
homeassistant    | s6-rc: info: service legacy-services successfully started
ha-configurator  | INFO:2024-05-27 08:43:02,232:hass_configurator.configurator:.......... - "GET / HTTP/1.1" 200 -
ha-configurator  | WARNING:2024-05-27 08:43:02,238:hass_configurator.configurator:Exception getting bootstrap
ha-configurator  | WARNING:2024-05-27 08:43:02,239:hass_configurator.configurator:<urlopen error [Errno 111] Connection refused>
ha-configurator  | INFO:2024-05-27 08:43:02,430:hass_configurator.configurator:.......... - "GET /style.css HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,431:hass_configurator.configurator:.......... - "GET /material-icons.fallback.css HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,483:hass_configurator.configurator:.......... - "GET /jquery-3.6.0.min.js HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,506:hass_configurator.configurator:.......... - "GET /materialize.min.js HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,560:hass_configurator.configurator:.......... - "GET /flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2 HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,586:hass_configurator.configurator:.......... - "GET /js-yaml.min.js HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,818:hass_configurator.configurator:.......... - "GET /api/file?filename=/hass-config/configuration.yaml HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,858:hass_configurator.configurator:.......... - "GET /api/listdir?path=. HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,925:hass_configurator.configurator:.......... - "GET /favicon.ico HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:02,925:hass_configurator.configurator:.......... - "GET /favicon.ico HTTP/1.1" 404 -
ha-configurator  | INFO:2024-05-27 08:43:10,980:hass_configurator.configurator:.......... - "GET /api/restart HTTP/1.1" 200 -
ha-configurator  | INFO:2024-05-27 08:43:10,980:hass_configurator.configurator:/api/restart
ha-configurator  | WARNING:2024-05-27 08:43:10,981:hass_configurator.configurator:<urlopen error [Errno 111] Connection refused>

what am i missing? thanks

danielperna84 commented 3 months ago

As I am not familiar with Docker, please ask for assistance in the Home Assistant Community.

fragolinux commented 3 months ago

i don't think it's docker related, it's like a parameter is missing... i left out the HASSAPI as they both are on the same server, so the default should be fine, a proper token is there, i added both the env vars with and without the HC to be sure at least 1 is correct, but as you can see, i get a connection refused

danielperna84 commented 3 months ago

With Docker it might be on the same server, but different containers. Hence you probably have to do some special configuration. And that, as mentioned above, is not part of my knowledge. And it's more likely to finde someone capable of solving your problem in the community. Besides me no one gets notified about issues in this repository. And I am unable to help.

fragolinux commented 3 months ago

ok, thanks, i'll ask there!