warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
20.98k stars 359 forks source link

'Invalid UTF-8 encoding' when trying to SSH to NetApp #3691

Open unbreakabl3 opened 12 months ago

unbreakabl3 commented 12 months ago

Discord username (optional)

No response

Operating System

MacOS

Operating System and Version

14.0.0

Local Shell Version

5.9

Remote Shell Version

N/A

Warp Version

v0.2023.09.19.08.04.stable_00

I have tried commenting out my system & user rcfiles and warp still will not bootstrap

Screenshots

image

Include shell xtrace output

ssh node.domain (root@node.domain) Password:

Last login time: 9/22/2023 09:16:52 Unsuccessful login attempts since last login: 1

Error: Command contains invalid UTF-8 encoding

Error: "then " is not a recognized command

Connection to node.domain closed.

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore) - linear-label:e7dfaa84-5fdb-4a00-b754-d8912da923fa

None

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

dannyneira commented 12 months ago

Hi @unbreakabl3 Sorry to hear about this blocker. Please try using /usr/bin/ssh directly to connect to netapp, as well as make sure that the default shell on the netapp is bash, zsh, or fish. If none of those work, I recommend you disable the SSH wrapper as a workaround. Please see more in our docs. https://docs.warp.dev/features/ssh#troubleshooting-ssh. If we have any updates we'll post it on this thread.

To anyone else facing this issue, please add a :+1: to the original post at the top or comment with your details, and subscribe if you'd like to be notified.

unbreakabl3 commented 12 months ago

Hi, @dannyneira. Disabling the SSH wrapper as a workaround did the trick. Regular /bin/ssh did work as well.

Not sure if it's possible to change the shell on NetApp in general. But in any case, there are many use cases, where it's not possible to change the shell, just because the administrator using some modern new cool terminal 😁 (for example, validated health, banks, or similar environments). Maybe it will be not a bad idea (if you want to cover more customers, especially Enterprise) to make this wrapping feature detect automatically after the basic SSH connection is established if it's going to work or not. If so - enable the wrap feature automatically on the fly. If not - keep it disabled and notify the user.

Otherwise, the user should remember to switch it off each time before connecting to some "unsupported" system and re-enable it after. I would guess, that in that situation, there are two solutions only:

  1. keep the wrapper always disabled (makes this cool feature useless)
  2. use another terminal...
belkin1667 commented 5 months ago

Same problem here! Warp version: v0.2024.04.16.08.02.stable_00

Trying to ssh into remote host of my backend service: ssh -l '//user:root//configuration_id:my_service#my_service_vla-1713358457382' host.name.com

And getting the following error:

Shell start failed: '/portoshell_utils/sessionleader "belkinmike" /usr/bin/bash -c \'\nexport TERM_PROGRAM=\'"\'"\'WarpTerminal\'"\'"\'\nhook=$(printf "{\\"hook\\": \\"SSH\\", \\"value\\": {\\"socket_path\\": \\"~/.ssh/17135328212935\\", \\"remote_shell\\": \\"%s\\"}}" "${SHELL##*/}" | command -p od -An -v -tx1 | command -p tr -d " \\n")\nprintf \'"\'"\'\x1bP$d%s\x9c\'"\'"\' $hook\nif test "${SHELL##*/}" != "bash" -a "${SHELL##*/}" != "zsh"; then\n if test ! -e $HOME/.hushlogin; then\n if test -r /etc/motd; then\n command -p cat /etc/motd\n elif test -r /run/motd; then\n command -p cat /run/motd\n elif test -r /run/motd.dynamic; then\n command -p cat /run/motd.dynamic\n elif test -r /usr/lib/motd; then\n command -p cat /usr/lib/motd\n elif test -r /usr/lib/motd.dynamic; then\n command -p cat /usr/lib/motd.dynamic\n fi\n fi\n if test -r /etc/profile; then\n . /etc/profile\n fi\n exec $SHELL\nfi\ncase ${SHELL##*/} in\n bash)\n exec -a bash bash --rcfile <(echo \'"\'"\'\n command -p stty raw\n HISTCONTROL=ignorespace\n HISTIGNORE=" *"\n WARP_SESSION_ID="$(command -p date +%s)$RANDOM"\n WARP_COMBINED_PROMPT_COMMAND_GRID="0"\n WARP_HONOR_PS1="0"\n _hostname=$(command -pv hostname >/dev/null 2>&1 && command -p hostname 2>/dev/null || command -p uname -n)\n _user=$(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER)\n _msg=$(printf "{\\"hook\\": \\"InitShell\\", \\"value\\": {\\"session_id\\": $WARP_SESSION_ID, \\"shell\\": \\"bash\\", \\"user\\": \\"$_user\\", \\"hostname\\": \\"$_hostname\\"}}" | command -p od -An -v -tx1 | command -p tr -d " \\n")\n printf \'"\'"\'\\\'"\'"\'\'"\'"\'\\eP$d%s\\x9c\'"\'"\'\\\'"\'"\'\'"\'"\' "$_msg"\'"\'"\')\n unset _hostname _user _msg\n ;;\n zsh) WARP_TMP_DIR=$(command -p mktemp -d warptmp.XXXXXX)\nlocal ZSH_ENV_SCRIPT=\'"\'"\'756e7365746f7074205a4c453b20756e736574205243533b20756e73657420474c4f42414c5f5243533b20574152505f53455353494f4e5f49443d222428636f6d6d616e64202d702064617465202b2573292452414e444f4d223b20574152505f434f4d42494e45445f50524f4d50545f434f4d4d414e445f475249443d303b20574152505f484f4e4f525f5053313d303b205f686f73746e616d653d2428636f6d6d616e64202d707620686f73746e616d65203e2f6465762f6e756c6c20323e263120262620636f6d6d616e64202d7020686f73746e616d6520323e2f6465762f6e756c6c207c7c20636f6d6d616e64202d7020756e616d65202d6e293b205f757365723d2428636f6d6d616e64202d70762077686f616d69203e2f6465762f6e756c6c20323e263120262620636f6d6d616e64202d702077686f616d6920323e2f6465762f6e756c6c207c7c206563686f202455534552293b205f6d73673d24287072696e746620227b5c22686f6f6b5c223a205c22496e69745368656c6c5c222c205c2276616c75655c223a207b5c2273657373696f6e5f69645c223a2024574152505f53455353494f4e5f49442c205c227368656c6c5c223a205c227a73685c222c205c22757365725c223a205c22245f757365725c222c205c22686f73746e616d655c223a205c22245f686f73746e616d655c227d7d22207c20636f6d6d616e64202d70206f64202d416e202d76202d747831207c20636f6d6d616e64202d70207472202d642027205c6e27293b207072696e746620275c7831625c7835305c7832345c78363425735c7839632720245f6d73673b20756e736574205f686f73746e616d65205f75736572205f6d7367\'"\'"\'\nif [[ $? == 0 ]]; then\n if command -pv xxd >/dev/null 2>&1; then\n echo $ZSH_ENV_SCRIPT | command -p xxd -p -r > $WARP_TMP_DIR/.zshenv\n else\n for i in {0..$((${#ZSH_ENV_SCRIPT} - 1))..2}; do\n builtin printf "\\x${ZSH_ENV_SCRIPT:$i:2}"\n done > $WARP_TMP_DIR/.zshenv\n fi\nelse\n echo "Failed to bootstrap warp. Continuing with a non-bootstrapped shell."\nfi\nTMPPREFIX=$HOME/.zshtmp- WARP_SSH_RCFILES=${ZDOTDIR:-$HOME} ZDOTDIR=$WARP_TMP_DIR exec -l zsh -g \n ;;\nesac\n\'' has type str, but isn't valid UTF-8 encoding. Non-UTF-8 strings must be converted to unicode objects before being added.exec request failed on channel 1

command ssh indeed helps as a workaround