core icon indicating copy to clipboard operation
core copied to clipboard

Shell command error 255

Open paule1120 opened this issue 1 year ago • 6 comments

The problem

Hello, I got this error if i try to shutdown my repetier Server with ssh. In the addon "Advanced ssh & Web terminal" it works with the command.

What version of Home Assistant Core has the issue?

2024.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shell_command

Diagnostics information

No response

Example YAML snippet

shell_command:
  shutdown_repetier: ssh -i /config/ssh_keys/id_rsa -o 'StrictHostKeyChecking=no' [email protected] 'sudo shutdown -h now'

Anything in the logs that might be useful for us?

`Logger: homeassistant.components.shell_command
Quelle: /usr/src/homeassistant/homeassistant/components/shell_command/__init__.py:129
Integration: Shell Command (Dokumentation, Probleme)
Erstmals aufgetreten: 21:34:21 (3 Vorkommnisse)
Zuletzt protokolliert: 22:02:08

Error running command: `ssh -i /config/ssh_keys/id_rsa -o 'StrictHostKeyChecking=no' [email protected] 'sudo shutdown -h now'`, return code: 255
NoneType: None`

Additional information

No response

paule1120 avatar Sep 11 '24 20:09 paule1120

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (shell_command) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of shell_command can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign shell_command Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


shell_command documentation shell_command source (message by IssueLinks)

home-assistant[bot] avatar Sep 11 '24 20:09 home-assistant[bot]

When you run the command manually, does sudo prompt you for a password?

I've run into this before where it would fail to ask for a password (because it's not an interactive terminal) and exit with a failure status.

Klikini avatar Sep 12 '24 04:09 Klikini

No. Manually it works without problems

paule1120 avatar Sep 12 '24 04:09 paule1120

The same situation with my case. Do you have solution?

arturhomepl avatar Sep 18 '24 16:09 arturhomepl

Unfortunately not, but it worked again last time

paule1120 avatar Sep 19 '24 06:09 paule1120

Thanks. I walkaround this problem using NodeRed :)

arturhomepl avatar Sep 19 '24 11:09 arturhomepl