Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown and reboot commands broken in "Terminal & SSH" #2767

Closed
michaeltandy opened this issue Nov 28, 2022 · 3 comments
Closed

Shutdown and reboot commands broken in "Terminal & SSH" #2767

michaeltandy opened this issue Nov 28, 2022 · 3 comments
Labels

Comments

@michaeltandy
Copy link

Describe the issue you are experiencing

When attempting to reboot my RPi via "Terminal & SSH" with a fresh install of Home Assistant OS, neither shutdown nor reboot works.

image

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Terminal & SSH

What is the version of the add-on?

9.6.1

Steps to reproduce the issue

  1. Begin with a fresh install of Home Assistant OS. I'm using haos_rpi4-64-9.3.img.xz on a Raspberry Pi for this.
  2. Install "Terminal & SSH" and open the terminal. The one in the browser will do fine.
  3. Run whoami and note that you are root, so restarting the host should be within your power.
  4. Run the command shutdown -r now
  5. You will get the message : No such file or directory bashio
  6. Inspect the file /usr/local/bin/shutdown and note that it seems to have Windows line terminations.
  7. Run the command reboot
  8. You will get the messages parse error: Expected string key before : at line 1, column 4 and ERROR: Unknown HTTP error occured
  9. No reboot has occurred.
    ...

System Health information

System Information

version core-2022.11.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.7
os_name Linux
os_version 5.15.61-v8
arch aarch64
timezone Europe/London
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 9.3
update_channel stable
supervisor_version supervisor-2022.11.2
agent_version 1.4.1
docker_version 20.10.18
disk_total 56.7 GB
disk_used 2.6 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.1.3), Terminal & SSH (9.6.1)
Dashboards
dashboards 1
resources 0
mode auto-gen
Recorder
oldest_recorder_run 28 November 2022 at 10:29
current_recorder_run 28 November 2022 at 10:29
estimated_db_size 0.27 MiB
database_engine sqlite
database_version 3.38.5

Anything in the Supervisor logs that might be useful for us?

There are some occurrences of `22-11-28 22:10:46 ERROR (MainThread) [supervisor.api.middleware.security] Invalid token for access /host/reboot`

Anything in the add-on logs that might be useful for us?

[2022/11/28 22:09:59:1135] N: lws_libuv_closewsi: thr 0: [wsisrv|0|adopted] sa left 2: dyn left: 3 (rk 0)
[2022/11/28 22:09:59:1136] N:  -- [wsisrv|0|adopted] (0) 14.346min
[22:09:59] INFO: Service restart after closing
[22:10:03] INFO: Starting Web Terminal...
[2022/11/28 22:10:03:8170] N: ttyd 1.6.3-3e37e33 (libwebsockets 4.2.1-v4.2.1)
[2022/11/28 22:10:03:8172] N: tty configuration:
[2022/11/28 22:10:03:8172] N:   start command: tmux -u new -A -s homeassistant bash -l
[2022/11/28 22:10:03:8172] N:   close signal: SIGHUP (1)
[2022/11/28 22:10:03:8172] N:   terminal type: xterm-256color
[2022/11/28 22:10:03:8172] N: LWS: 4.2.1-v4.2.1, loglevel 7
[2022/11/28 22:10:03:8172] N: NET CLI SRV H1 H2 WS ConMon IPV6-off
[2022/11/28 22:10:03:8189] N:    /usr/lib/libwebsockets-evlib_uv.so
[2022/11/28 22:10:03:8557] N:  Using foreign event loop...
[2022/11/28 22:10:03:8560] N:  ++ [wsi|0|pipe] (1)
[2022/11/28 22:10:03:8561] N:  ++ [vh|0|netlink] (1)
[2022/11/28 22:10:03:8562] N:  ++ [vh|1|default||8099] (2)
[2022/11/28 22:10:03:8563] N: lws_socket_bind: nowsi: source ads 0.0.0.0
[2022/11/28 22:10:03:8563] N:  ++ [wsi|1|listen|default||8099] (2)
[2022/11/28 22:10:03:8564] N:  Listening on port: 8099
[2022/11/28 22:10:26:3317] N:  ++ [wsisrv|0|adopted] (1)
[2022/11/28 22:10:26:3353] N: HTTP / - 172.30.32.2
[2022/11/28 22:10:26:4462] N: HTTP /token - 172.30.32.2
[2022/11/28 22:10:26:6221] N: WS   /ws - 172.30.32.2, clients: 1
[2022/11/28 22:10:26:6279] N: started process, pid: 324
[2022/11/28 22:15:58:6750] N: WS closed from 172.30.32.2, clients: 0
[2022/11/28 22:15:58:6751] N: killing process, pid: 324
[2022/11/28 22:15:58:6752] N: lws_libuv_closewsi: [wsisrv|0|adopted]
[2022/11/28 22:15:58:6752] N: lws_libuv_closewsi: thr 0: [wsisrv|0|adopted] sa left 2: dyn left: 3 (rk 0)
[2022/11/28 22:15:58:6754] N:  -- [wsisrv|0|adopted] (0) 5.539min
[22:15:59] INFO: Service restart after closing
[22:16:01] INFO: Starting Web Terminal...
[2022/11/28 22:16:01:6423] N: ttyd 1.6.3-3e37e33 (libwebsockets 4.2.1-v4.2.1)
[2022/11/28 22:16:01:6425] N: tty configuration:
[2022/11/28 22:16:01:6425] N:   start command: tmux -u new -A -s homeassistant bash -l
[2022/11/28 22:16:01:6425] N:   close signal: SIGHUP (1)
[2022/11/28 22:16:01:6425] N:   terminal type: xterm-256color
[2022/11/28 22:16:01:6425] N: LWS: 4.2.1-v4.2.1, loglevel 7
[2022/11/28 22:16:01:6425] N: NET CLI SRV H1 H2 WS ConMon IPV6-off
[2022/11/28 22:16:01:6450] N:    /usr/lib/libwebsockets-evlib_uv.so
[2022/11/28 22:16:01:6808] N:  Using foreign event loop...
[2022/11/28 22:16:01:6809] N:  ++ [wsi|0|pipe] (1)
[2022/11/28 22:16:01:6810] N:  ++ [vh|0|netlink] (1)
[2022/11/28 22:16:01:6812] N:  ++ [vh|1|default||8099] (2)
[2022/11/28 22:16:01:6814] N: lws_socket_bind: nowsi: source ads 0.0.0.0
[2022/11/28 22:16:01:6815] N:  ++ [wsi|1|listen|default||8099] (2)
[2022/11/28 22:16:01:6816] N:  Listening on port: 8099
[2022/11/28 22:16:02:8266] N:  ++ [wsisrv|0|adopted] (1)
[2022/11/28 22:16:02:8290] N: HTTP / - 172.30.32.2
[2022/11/28 22:16:02:9424] N: HTTP /token - 172.30.32.2
[2022/11/28 22:16:03:0002] N: WS   /ws - 172.30.32.2, clients: 1
[2022/11/28 22:16:03:0053] N: started process, pid: 352
[2022/11/28 22:20:33:2330] N: WS closed from 172.30.32.2, clients: 0
[2022/11/28 22:20:33:2331] N: killing process, pid: 352
[2022/11/28 22:20:33:2332] N: lws_libuv_closewsi: [wsisrv|0|adopted]
[2022/11/28 22:20:33:2333] N: lws_libuv_closewsi: thr 0: [wsisrv|0|adopted] sa left 2: dyn left: 3 (rk 0)
[2022/11/28 22:20:33:2334] N:  -- [wsisrv|0|adopted] (0) 4.506min
[22:20:33] INFO: Service restart after closing
[22:20:39] INFO: Starting Web Terminal...
[2022/11/28 22:20:39:7941] N: ttyd 1.6.3-3e37e33 (libwebsockets 4.2.1-v4.2.1)
[2022/11/28 22:20:39:7944] N: tty configuration:
[2022/11/28 22:20:39:7945] N:   start command: tmux -u new -A -s homeassistant bash -l
[2022/11/28 22:20:39:7946] N:   close signal: SIGHUP (1)
[2022/11/28 22:20:39:7946] N:   terminal type: xterm-256color
[2022/11/28 22:20:39:7947] N: LWS: 4.2.1-v4.2.1, loglevel 7
[2022/11/28 22:20:39:7948] N: NET CLI SRV H1 H2 WS ConMon IPV6-off
[2022/11/28 22:20:39:7966] N:    /usr/lib/libwebsockets-evlib_uv.so
[2022/11/28 22:20:39:8317] N:  Using foreign event loop...
[2022/11/28 22:20:39:8321] N:  ++ [wsi|0|pipe] (1)
[2022/11/28 22:20:39:8323] N:  ++ [vh|0|netlink] (1)
[2022/11/28 22:20:39:8325] N:  ++ [vh|1|default||8099] (2)
[2022/11/28 22:20:39:8326] N: lws_socket_bind: nowsi: source ads 0.0.0.0
[2022/11/28 22:20:39:8327] N:  ++ [wsi|1|listen|default||8099] (2)
[2022/11/28 22:20:39:8328] N:  Listening on port: 8099
[2022/11/28 22:20:45:6652] N:  ++ [wsisrv|0|adopted] (1)
[2022/11/28 22:20:45:6674] N: HTTP / - 172.30.32.2
[2022/11/28 22:20:45:8252] N: HTTP /token - 172.30.32.2
[2022/11/28 22:20:45:8888] N: WS   /ws - 172.30.32.2, clients: 1
[2022/11/28 22:20:45:8936] N: started process, pid: 373
[2022/11/28 22:27:28:5128] N: WS closed from 172.30.32.2, clients: 0
[2022/11/28 22:27:28:5129] N: killing process, pid: 373
[2022/11/28 22:27:28:5130] N: lws_libuv_closewsi: [wsisrv|0|adopted]
[2022/11/28 22:27:28:5131] N: lws_libuv_closewsi: thr 0: [wsisrv|0|adopted] sa left 2: dyn left: 3 (rk 0)
[2022/11/28 22:27:28:5132] N:  -- [wsisrv|0|adopted] (0) 6.714min
[22:27:28] INFO: Service restart after closing
[22:27:31] INFO: Starting Web Terminal...
[2022/11/28 22:27:31:1072] N: ttyd 1.6.3-3e37e33 (libwebsockets 4.2.1-v4.2.1)
[2022/11/28 22:27:31:1074] N: tty configuration:
[2022/11/28 22:27:31:1074] N:   start command: tmux -u new -A -s homeassistant bash -l
[2022/11/28 22:27:31:1074] N:   close signal: SIGHUP (1)
[2022/11/28 22:27:31:1074] N:   terminal type: xterm-256color
[2022/11/28 22:27:31:1074] N: LWS: 4.2.1-v4.2.1, loglevel 7
[2022/11/28 22:27:31:1074] N: NET CLI SRV H1 H2 WS ConMon IPV6-off
[2022/11/28 22:27:31:1095] N:    /usr/lib/libwebsockets-evlib_uv.so
[2022/11/28 22:27:31:1452] N:  Using foreign event loop...
[2022/11/28 22:27:31:1453] N:  ++ [wsi|0|pipe] (1)
[2022/11/28 22:27:31:1454] N:  ++ [vh|0|netlink] (1)
[2022/11/28 22:27:31:1456] N:  ++ [vh|1|default||8099] (2)
[2022/11/28 22:27:31:1456] N: lws_socket_bind: nowsi: source ads 0.0.0.0
[2022/11/28 22:27:31:1457] N:  ++ [wsi|1|listen|default||8099] (2)
[2022/11/28 22:27:31:1457] N:  Listening on port: 8099

Additional information

No response

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 28, 2022
@bbrks
Copy link

bbrks commented Dec 31, 2022

I observe this issue with shutdown too - but reboot does work as expected.

@github-actions github-actions bot removed the stale label Dec 31, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 30, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants