arthurdent75 / SimpleScheduler

An Home Assistant AddOn to schedule entities on/off on weekly base
183 stars 36 forks source link

[docker] HASSIO_URL ENV does not resolve #120

Closed sveba closed 1 year ago

sveba commented 1 year ago

Hi,

first of all, thank you for your time and work.

I have an issue with the integration over docker container.

My setup: HASS 2023.2.2 in a docker container. SimpleScheduler in a docker container.

What have I done so far:

  1. git clone
  2. docker build (command form your howto)
  3. docker run -d -e SUPERVISOR_TOKEN="myhassiotoken" \
        -e HASSIO_URL="http://10.23.23.23:8123" \
        -v $(pwd)/SimpleScheduler-persistant:/share/simplescheduler \
        -p 8099:8099 \
        --name simplescheduler \
        mysimplescheduler:latest
  4. Log:
    [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
    [s6-init] ensuring user provided files have correct perms...exited 0.
    [fix-attrs.d] applying ownership & permissions fixes...
    [fix-attrs.d] done.
    [cont-init.d] executing container initialization scripts...
    [cont-init.d] 00-banner.sh: executing...
    curl: (6) Could not resolve host: supervisor
    [09:31:27] ERROR: Something went wrong contacting the API
    [cont-init.d] 00-banner.sh: exited 0.
    [cont-init.d] 01-log-level.sh: executing...
    curl: (6) Could not resolve host: supervisor
    [09:31:27] ERROR: Something went wrong contacting the API
    [cont-init.d] 01-log-level.sh: exited 0.
    [cont-init.d] done.
    [services.d] starting services
    [services.d] done.
    [09:31:27] INFO: Starting service.d [Interface]
    [09:31:27] INFO: Starting service.d [Scheduler]
    [09:31:27] INFO: Running interface.sh
    [09:31:27] INFO: Running scheduler.sh
  5. env-result form inside the container
    S6_BEHAVIOUR_IF_STAGE2_FAILS=2
    HOSTNAME=bc28560df7d8
    PWD=/
    HOME=/root
    LANG=C.UTF-8
    TERM=xterm-256color
    SUPERVISOR_TOKEN=myhassiotoken
    SHLVL=1
    PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$
    HASSIO_URL=http://10.23.23.23:8123
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    S6_CMD_WAIT_FOR_SERVICES=1
    DEBIAN_FRONTEND=noninteractive
    _=/usr/bin/env

So the issue can be seen in the log

curl: (6) Could not resolve host: supervisor
[09:31:27] ERROR: Something went wrong contacting the API

Am I doing something wrong?

arthurdent75 commented 1 year ago

Seems correct. Let me run some test. Does the addon run anyway? What issue in the do you get besides the log?

sveba commented 1 year ago

Oh sorry, forgot to add the application log :) Previous comment has the output of docker logs

[2023-02-12 12:03:00] ERROR: Unable to obtain entities names from Home Assistant
[2023-02-12 12:03:00] DEBUG: Retrieving sunrise and sunset
[2023-02-12 12:03:01] ERROR: Unable to obtain timezone from Home Assistant
[2023-02-12 12:03:06] DEBUG: Max Retry: 3
[2023-02-12 12:03:06] DEBUG: Starting Queue management - Queue length: 0
[2023-02-12 12:03:06] DEBUG: Finished Queue management - Queue length: 0

So the UI is reachable but all DropDowns are empty.

Is it actually possible to send the application log also to stdout?

arthurdent75 commented 1 year ago

You forgot to add /api at the end of the URL, as for the instructions. You should write: HASSIO_URL="http://10.23.23.23:8123/api"

sveba commented 1 year ago

you are completely right. Sorry for bothering