withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

Ubuntu 20 Not Supported - Fig Access #1895

Open KyloJorgensen opened 1 year ago

KyloJorgensen commented 1 year ago

Sanity checks

Issue Details

Description:

$ fig integrations install ssh

$ fig ssh SERVER_URL Connecting to SERVER_URL with identity MY_IDENTITY Warning: remote port forwarding failed for listen path /var/tmp/fig-parent-63fad7f5-52ff-4066-9e03-de1a6390dfe0.socket

$ curl -fSsL https://fig.io/install-headless.sh | bash

$ logout

$ fig ssh SERVER_URL Connecting to SERVER_URL with identity MY_IDENTITY Warning: remote port forwarding failed for listen path /var/tmp/fig-parent-63fad7f5-52ff-4066-9e03-de1a6390dfe0.socket

$ fig doctor --verbose Let's check if you're logged in... ✔ Logged into Fig

Let's check your dotfiles... ✔ ~/.bashrc contains valid fig hooks ✔ ~/.profile contains valid fig hooks

Let's make sure Fig is setup correctly... ✔ Fig bin exists ✔ PATH contains ~/.local/bin ✘ Fig Integration: Figterm is not running FIG_INTEGRATION_VERSION=None

Let's see if Fig is in a working state... ✘ Figterm: No TERM_SESSION_ID

0: No TERM_SESSION_ID 1: environment variable not found

Location: fig_cli/src/cli/doctor.rs:600

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets. ✔ Insertion lock does not exist ✔ PATH and PseudoTerminal PATH match ✔ Autocomplete dev mode ✔ Plugin dev mode ✔ Mission Control is loading from the correct URL

Let's check if your system is compatible... ● Fig's support for Linux 5.4.0-126-generic - "Ubuntu 20.04.5 LTS" is in development. It may not work properly on your system.

Fig still not working? Run fig issue to let us know! Or, email us at hello@fig.io!

Environment

fig-details:
  - cli-version: 1.5.0
  - figterm-version: 5.2.0
hardware-info:
  - chip-id: Common KVM processor
  - cores: 32
  - mem: 64314.38 GB
os-info:
  - kernel: 5.4.0-126-generic
  - distro: "Ubuntu 20.04.5 LTS"
  - distro-version: "20.04.5 LTS (Focal Fossa)"
environment:
  - shell: /usr/bin/bash
  - terminal: <unknown>
  - cwd: /home/kylo
  - exe-path: /usr/bin/fig
  - install-method: unknown
  - env-vars:
    - SHELL: /bin/bash
    - FIG_WORKFLOWS_KEYBIND: ^f
    - TERM: xterm-256color
    - FIG_PID: 141799
    - PATH: /home/kylo/.poetry/bin:/home/kylo/.local/bin:/home/kylo/bin:/home/kylo/.poetry/bin:/home/kylo/.deno/bin:/home/kylo/.gem/bin:/home/kylo/bin:/home/kylo/.local/bin:/usr/bin:/sbin:/usr/sbin:/tmp/fnm_multishells/141911_1665412595171/bin:/home/kylo/.fnm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/snap/bin:/home/kylo/.local/bin:/home/kylo/.fig/bin
KyloJorgensen commented 1 year ago

This error broke my remote vscode. Here is the error vscode output.

[08:44:22.766] Log Level: 2
[08:44:22.768] remote-ssh@0.84.0
[08:44:22.769] darwin x64
[08:44:22.799] SSH Resolver called for "ssh-remote+HOST", attempt 1
[08:44:22.800] "remote.SSH.useLocalServer": true
[08:44:22.800] "remote.SSH.path": undefined
[08:44:22.801] "remote.SSH.configFile": undefined
[08:44:22.801] "remote.SSH.useFlock": true
[08:44:22.801] "remote.SSH.lockfilesInTmp": false
[08:44:22.802] "remote.SSH.localServerDownload": always
[08:44:22.802] "remote.SSH.remoteServerListenOnSocket": false
[08:44:22.803] "remote.SSH.showLoginTerminal": false
[08:44:22.803] "remote.SSH.defaultExtensions": []
[08:44:22.803] "remote.SSH.loglevel": 2
[08:44:22.804] "remote.SSH.enableDynamicForwarding": true
[08:44:22.805] "remote.SSH.enableRemoteCommand": false
[08:44:22.805] "remote.SSH.serverPickPortsFromRange": {}
[08:44:22.805] "remote.SSH.serverInstallPath": {}
[08:44:22.812] SSH Resolver called for host: HOST
[08:44:22.812] Setting up SSH remote "HOST"
[08:44:22.816] Acquiring local install lock: /var/folders/7p/js8_hpf164q8hrl2w16dm82h0000gr/T/vscode-remote-ssh-e02314b8-install.lock
[08:44:22.820] Looking for existing server data file at /Users/USER_NAME/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-e02314b8-64bbfbf67ada9953918d72e1df2f4d8e537d340e-0.84.0/data.json
[08:44:22.822] Using commit id "64bbfbf67ada9953918d72e1df2f4d8e537d340e" and quality "stable" for server
[08:44:22.826] Install and start server if needed
[08:44:22.832] PATH: PATH:/Users/USER_NAME/.fig/bin
[08:44:22.832] Checking ssh with "ssh -V"
[08:44:22.853] > OpenSSH_9.0p1, LibreSSL 3.3.6

[08:44:22.858] askpass server listening on /var/folders/7p/js8_hpf164q8hrl2w16dm82h0000gr/T/vscode-ssh-askpass-b0bd6a0822193ee84884957f56b8e0b73854ea34.sock
[08:44:22.858] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/7p/js8_hpf164q8hrl2w16dm82h0000gr/T/vscode-ssh-askpass-fe11be542dbc0c7ccafff28f2d6b49376e2a006b.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","49761","-o","ConnectTimeout=15","HOST","bash"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/USER_NAME/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-e02314b8-64bbfbf67ada9953918d72e1df2f4d8e537d340e-0.84.0/data.json"}
[08:44:22.858] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.xMcG2fK4JX/Listeners","SHELL":"/bin/bash","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/7p/js8_hpf164q8hrl2w16dm82h0000gr/T/vscode-ssh-askpass-b0bd6a0822193ee84884957f56b8e0b73854ea34.sock"}
[08:44:22.860] Spawned 2413
[08:44:23.030] > local-server-1> Spawned ssh, pid=2420
[08:44:23.035] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[08:44:23.036] stderr> vdollar_percent_expand: env var ${TERM_SESSION_ID} has no value
[08:44:23.036] stderr> /Users/USER_NAME/.fig/ssh line 2: Bad forwarding specification.
[08:44:23.037] stderr> /Users/USER_NAME/.fig/ssh: terminating, 1 bad configuration options
[08:44:23.037] > local-server-1> ssh child died, shutting down
[08:44:23.041] Local server exit: 0
[08:44:23.042] Received install output: local-server-1> Spawned ssh, pid=2420
OpenSSH_9.0p1, LibreSSL 3.3.6
vdollar_percent_expand: env var ${TERM_SESSION_ID} has no value
/Users/USER_NAME/.fig/ssh line 2: Bad forwarding specification.
/Users/USER_NAME/.fig/ssh: terminating, 1 bad configuration options
local-server-1> ssh child died, shutting down

[08:44:23.043] Failed to parse remote port from server output
[08:44:23.044] Resolver error: Error: 
    at g.Create (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:585222)
    at t.handleInstallOutput (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:583874)
    at Object.e [as tryInstallWithLocalServer] (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:624373)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:643506
    at async t.withShowDetailsEvent (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:647224)
    at async /Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622845
    at async T (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:619351)
    at async t.resolveWithLocalServer (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622460)
    at async t.resolve (/Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:644834)
    at async /Users/USER_NAME/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:727082
[08:44:23.055] ------
grant0417 commented 1 year ago

This is actually an issue with the ssh integrations, In the first issue you do not have figterm running, this should happen automatically but it looks like it didn't, what terminal is the shell session running in?

Also there is still an issue with fig ssh integrations and vscode, @squili any suggestions?

squili commented 1 year ago

Could you run sudo grep 'AcceptEnv' /etc/ssh/sshd_config and sudo grep 'AcceptEnv' /etc/ssh/sshd_config.d/* on your remote machine? We send environment variables over the SSH connection, but sometimes SSHD can be configured to reject them.

On the VSCode remote issue, we currently cannot coexist with the VSCode remote system. This is because it runs the ssh command, which pulls in our configuration, and our configuration requires that your shell is running under figterm. When we add support for VSCode remote, this issue specifically should be resolved.

KyloJorgensen commented 1 year ago
sudo grep 'AcceptEnv' /etc/ssh/sshd_config 
AcceptEnv LANG LC_*
KyloJorgensen commented 1 year ago

Remote $fig diagnostic --force

fig-details:
  - cli-version: 1.5.0
  - figterm-version: 5.2.0
hardware-info:
  - chip-id: Common KVM processor
  - cores: 32
  - mem: 64314.38 GB
os-info:
  - kernel: 5.4.0-126-generic
  - distro: "Ubuntu 20.04.5 LTS"
  - distro-version: "20.04.5 LTS (Focal Fossa)"
environment:
  - shell: /usr/bin/bash
  - terminal: <unknown>
  - cwd: /home/kylo
  - exe-path: /usr/bin/fig
  - install-method: unknown
  - env-vars:
    - SHELL: /bin/bash
    - FIG_WORKFLOWS_KEYBIND: ^f
    - TERM: xterm-256color
    - FIG_PID: 148996
grant0417 commented 1 year ago

@squili any update on this?

squili commented 1 year ago

@grant0417 Been focusing on infra, so haven't had a change to look more into this. Not quite sure what's happening, though - maybe some of the fixes we've been pushing out on develop might fix something when we release a new version for Linux

mirandole commented 11 months ago

I got the same issue only on OpenMediaVault distribution. But fig remote integration works well on a Debian container in Proxmox.

Edit : I managed to resolve this issue on OpenMediaVault distribution by doing these change to the omv remote server /etc/sshd_config file :

#AllowTcpForwarding no
AcceptEnv LANG LC_* FIG_*

Commenting AllowTcpForwarding no line and add AcceptEnv LANG LC_* FIG_* line. Now fig remote works well on my OMV server.