DrozmotiX / ioBroker.esphome

Control your ESP8266/ESP32 with simple yet powerful configuration files created and managed by ESPHome
MIT License
30 stars 23 forks source link

Trying to use inbuilt dashboard still crashes #176

Closed Bavarialex closed 10 months ago

Bavarialex commented 11 months ago

using 0.3.2

node js 18.17.1 npm 9.6.7 admin 6.12.0

proxmox 8 vm debian 11

changed to actual beta because of the need to see numbers. Works fine - spent a coffee...

Trying to use the inbuilt dashboard still crashes:

[espHomeDashboard] Error: Command failed with exit code 1: /home/iobroker/.cache/autopy/python/3.11.6/bin/python3 -m venv /home/iobroker/.cache/autopy/venv/esphomePython path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = '/home/iobroker/.cache/autopy/python/3.11.6/bin/python3' isolated = 0 environment = 1 user site = 1 safe_path = 0 import site = 1 is in build tree = 0 stdlib dir = '/home/iobroker/.cache/autopy/python/3.11.6/lib/python3.11' sys._base_executable = '/home/iobroker/.cache/autopy/python/3.11.6/bin/python3' sys.base_prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.base_exec_prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.platlibdir = 'lib' sys.executable = '/home/iobroker/.cache/autopy/python/3.11.6/bin/python3' sys.prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.exec_prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.path = [ '/home/iobroker/.cache/autopy/python/3.11.6/lib/python311.zip', '/home/iobroker/.cache/autopy/python/3.11.6/lib/python3.11', '/home/iobroker/.cache/autopy/python/3.11.6/lib/python3.11/lib-dynload', ]Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encodingPython runtime state: core initializedLookupError: no codec search functions registered: can't find encodingCurrent thread 0x00007ff54f137740 (most recent call first): <no Python frame>

Switching inbuilt dashboard off and using external esphome-container is fine...

DutchmanNL commented 11 months ago

What kind of Linux system is this ?

Bavarialex commented 11 months ago

Proxmox 8.0.4 VM: Debian GNU/Linux 11.8 (bullseye) GNOME 3.38.5

DutchmanNL commented 11 months ago

Proxmox 8.0.4 VM: Debian GNU/Linux 11.8 (bullseye) GNOME 3.38.5

I will setup a VM with this version to reproduce

Bavarialex commented 11 months ago

Proxmox vm with debian, additional zerotier and midnight commander, fresh install iobroker, restore from backitup... Otherwise you may have a look with teamviewer...

DutchmanNL commented 11 months ago

Proxmox vm with debian, additional zerotier and midnight commander, fresh install iobroker, restore from backitup... Otherwise you may have a look with teamviewer...

can you please try to upgrade to latest version and verify if that solves the issue ?

Bavarialex commented 11 months ago

using 0.3.2

there is no newer one than 0.3.2

total uninstall and reinstall got no change in behaviour: `

2023-11-02 20:08:26.405 - info: host.iobroker23 instance system.adapter.esphome.0 started with pid 421807 -- 2023-11-02 20:08:27.409 - info: esphome.0 (421807) starting. Version 0.3.2 (non-npm: DrozmotiX/ioBroker.esphome#385216342a0b81b702149e633d26399ac88e5966) in /opt/iobroker/node_modules/iobroker.esphome, node: v18.17.1, js-controller: 5.0.12 2023-11-02 20:08:27.704 - info: esphome.0 (421807) Try to connect to 10.11.12.71 2023-11-02 20:08:27.706 - info: esphome.0 (421807) Try to connect to 10.11.12.72 2023-11-02 20:08:27.706 - info: esphome.0 (421807) Try to connect to 10.11.12.73 2023-11-02 20:08:27.707 - warn: esphome.0 (421807) Auto Discovery disabled, new devices (or IP changes) will NOT be detected automatically! 2023-11-02 20:08:27.707 - info: esphome.0 (421807) Native Integration of ESPHome Dashboard enabled 2023-11-02 20:08:34.392 - warn: esphome.0 (421774) Client 10.11.12.71 Timeout, will reconnect automatically when device is available! 2023-11-02 20:08:34.392 - warn: esphome.0 (421774) Client 10.11.12.73 Timeout, will reconnect automatically when device is available! 2023-11-02 20:08:34.393 - warn: esphome.0 (421774) Client 10.11.12.72 Timeout, will reconnect automatically when device is available! 2023-11-02 20:08:34.404 - warn: esphome.0 (421774) Got terminate signal. Checking desired PID: 0 vs own PID 421774 2023-11-02 20:08:34.407 - warn: esphome.0 (421774) ESPHome client prs01kh \| F4CFA2E3E8AA \| on 10.11.12.71 disconnected 2023-11-02 20:08:34.408 - warn: esphome.0 (421774) ESPHome client bewflurunten \| 483FDA658E54 \| on 10.11.12.73 disconnected 2023-11-02 20:08:34.411 - warn: esphome.0 (421774) ESPHome client prs02ko \| 483FDA664CE2 \| on 10.11.12.72 disconnected 2023-11-02 20:08:34.411 - info: esphome.0 (421774) terminating 2023-11-02 20:08:34.412 - info: esphome.0 (421774) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason 2023-11-02 20:08:34.412 - warn: esphome.0 (421774) Got terminate signal. Checking desired PID: 421807 vs own PID 421774 2023-11-02 20:08:34.498 - error: esphome.0 (421774) [espHomeDashboard] Error: Command failed with exit code 1: /home/iobroker/.cache/autopy/python/3.11.6/bin/python3 -m venv /home/iobroker/.cache/autopy/venv/esphome Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = '/home/iobroker/.cache/autopy/python/3.11.6/bin/python3' isolated = 0 environment = 1 user site = 1 safe_path = 0 import site = 1 is in build tree = 0 stdlib dir = '/home/iobroker/.cache/autopy/python/3.11.6/lib/python3.11' sys._base_executable = '/home/iobroker/.cache/autopy/python/3.11.6/bin/python3' sys.base_prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.base_exec_prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.platlibdir = 'lib' sys.executable = '/home/iobroker/.cache/autopy/python/3.11.6/bin/python3' sys.prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.exec_prefix = '/home/iobroker/.cache/autopy/python/3.11.6' sys.path = [ '/home/iobroker/.cache/autopy/python/3.11.6/lib/python311.zip', '/home/iobroker/.cache/autopy/python/3.11.6/lib/python3.11', '/home/iobroker/.cache/autopy/python/3.11.6/lib/python3.11/lib-dynload', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized LookupError: no codec search functions registered: can't find encoding Current thread 0x00007f461e6b8740 (most recent call first):   2023-11-02 20:08:34.526 - error: esphome.0 (421774) Connection issue for Presence TypeError: Cannot read properties of undefined (reading 'type') 2023-11-02 20:08:34.913 - info: esphome.0 (421774) terminating 2023-11-02 20:08:34.972 - info: host.iobroker23 instance system.adapter.esphome.0 terminated by request of the instance itself and will not be restarted, before user restarts it. 2023-11-02 20:08:34.972 - info: host.iobroker23 Do not restart adapter system.adapter.esphome.0 because desired by instance

`

DutchmanNL commented 11 months ago

First Error is related to the dashboard prices which I really don't get what's wrong with

Second error is related to adapter code I solved already, Wille release 0.3.3 tomorrow

Bavarialex commented 11 months ago

esph02 Just a hint: /home/iobroker/.cache/autopy/venv/esphome is empty.

DutchmanNL commented 11 months ago

Just a hint: /home/iobroker/.cache/autopy/venv/esphome is empty.

nothing I can change, that's a python cache directory no relation to the adapter

Bavarialex commented 11 months ago

I'm sorry, but no change in behaviour with 0.4.0... esph03

DutchmanNL commented 11 months ago

I'm sorry, but no change in behaviour with 0.4.0... esph03

I have another Debian (10) installation with an equal issue so maybe it's related to the OS. Will setup some LXC virtual machines to reproduce/test

Bavarialex commented 11 months ago

So you think, upgrading to bookworm would be neccessary?

Don't hurry, it's not crucial for me. I've setup a small ESPHome container, this works.

Another thing, I've discovered: Even when you stop the esphome instance after the error regarding dashboard, the instance is still running and recognizing ESPHome p.Ex. ...

DutchmanNL commented 11 months ago

So you think, upgrading to bookworm would be neccessary?

Don't hurry, it's not crucial for me. I've setup a small ESPHome container, this works.

not sure but possible, will see with my develop environment

Another thing, I've discovered: Even when you stop the esphome instance after the error regarding dashboard, the instance is still running and recognizing ESPHome p.Ex. ...

can you give me some logs about that please ?

Bavarialex commented 11 months ago

sorry, no change in behaviour with debian 12...

Bavarialex commented 11 months ago

Deleted instance and adapter, there is still a process running (old 0.4.0)

esph05 esph04

Bavarialex commented 11 months ago

0.4.1 still error when trying to use internal dashboard

esph06

DutchmanNL commented 11 months ago

@Bavarialex I did setup several container now and on all of them I am not able to reproduce it, based on the amount of installation I expect this is an isolated issue. We have seen this in the past (mostly on older installation) that dependencies have an issue.

Sure I am not aware what kind of hardware and possibilities you have, but I would strongly advise to newly set-up the system and restore a backup. This will give you a fresh install and ensure all basics are good.

As workaround, maybe not the best solution but also workable, you can deactivate the ESPHome Dashboard in this adapter and use an external installation of it

Bavarialex commented 11 months ago

So I thank for your time and efforts, it's already running smooth with an external ESPHome installation. Will come back after a fresh install...

DutchmanNL commented 11 months ago

Will come back after a fresh install...

I will keep the issue open and wait for feedback, really would like to understand if that's the root cause.

Thank you 👌

Bavarialex commented 10 months ago

Proxmox 8 fresh Debian 12 vm Fresh iobroker install Additional zerotier install Additional midnight commander Restore iobroker backup iobroker / history / zigbee Esphome internal dashboard running!

Everything fine - issue can be closed...

DutchmanNL commented 10 months ago

Esphome internal dashboard running!

Everything fine - issue can be closed...

thank you for your valuable feedback !