withfig / fig

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

bug: Can not use the SSH autocompletion due to socket issues in /tmp folder on the remote Ubuntu Machine #2905

Open EmranMR opened 4 months ago

EmranMR commented 4 months ago

Checks

Operating system

Ubuntu 22 and MacOS

Expected behaviour

I should be able to install ssh integration on macOS and remote Ubuntu and be able to receive autocompletion

Actual behaviour

I do not get autocompletion, the fig doctor outputs an error that there are no socket. I digged in to the log files and apparently it is a permission issue I do not know how to fix.

Doctor on sshed remote Machine

✘ Figterm: Tried to find the socket file, but it wasn't there.

  Fig uses the /tmp directory for sockets.
  Did you delete files in /tmp? The OS will clear it automatically.
  Try making a new tab or window in your terminal, then run `fig doctor` again.
  No file at path: "/var/tmp/fig/xxx/figterm/f2cca691-d4b8-4b86-97e9-318e9bcf90ee.socket"

✘ Doctor found errors. Please fix them and try again.

Note that I can see MANY sockets when I ls inside my /var/tmp so not sure what is going on

Steps to reproduce

To reproduce simply follow instructions in the manual for ssh integration Once done run fig doctor and you get an error.

Environment

# SSH Ubuntu Env 
## Diagnostics

fig-details:
  - 2.15.0
hardware-info:
  - model:
  - model-id:
  - chip-id: Intel(R) Xeon(R) Gold 6230R CPU @ 2.10GHz
  - cores: 2
  - mem: 3.79 GB
os-info:
  - kernel: 5.15.0-91-generic
  - distro: "Ubuntu"
  - distro-version: "22.04.3 LTS (Jammy Jellyfish)"
environment:
  - shell: /usr/bin/zsh
  - terminal: <unknown>
  - cwd: /tmp/fig/xxx/logs
  - exe-path: /usr/bin/fig
  - install-method: unknown
  - env-vars:
    - PATH: 
    - SHELL: /usr/bin/zsh
    - TERM: xterm-256color
    - XDG_SESSION_TYPE: tty
    - FIG_PARENT: d14f0227-ba00-458f-b47b-1ec441bcd328
    - FIG_SET_PARENT_CHECK: 1
    - FIG_EXECUTION_STRING:
    - FIG_START_TEXT:
    - FIG_SHELL: /usr/bin/zsh
    - FIG_IS_LOGIN_SHELL: '0'
    - FIGTERM_SESSION_ID: f2cca691-d4b8-4b86-97e9-318e9bcf90ee
    - FIG_TERM: 2.15.0
    - FIG_PID: 872925
    - FIG_SET_PARENT: f2cca691-d4b8-4b86-97e9-318e9bcf90ee


MacOS

Diagnostics:

fig-details:
  - 2.17.1
hardware-info:
  - model:
  - model-id:
  - chip-id: Intel(R) Core(TM) i5-8600 CPU @ 3.10GHz
  - cores: 6
  - mem: 52.00 GB
os-info:
  - macOS 14.2.1 (23C71)
environment:
  - shell: /bin/zsh
  - terminal: iterm
  - cwd: xxx
  - exe-path: /Users/xxx/.fig/bin/fig
  - install-method: brew
  - env-vars:
    - FIGTERM_SESSION_ID: 0c9f4c27-b7e1-4720-8a47-5c9b598e2555
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.17.1
    - PATH: XXX
    - TERM: xterm-256color
    - __CFBundleIdentifier: com.googlecode.iterm2
    - FIG_PID: 7985
    - FIG_SET_PARENT: 0c9f4c27-b7e1-4720-8a47-5c9b598e2555

Doctor

Let's check if you're logged in...
✔ Logged into Fig

Let's check your dotfiles...
✔ bash ~/.bashrc integration check
✔ bash ~/.profile integration check
✔ bash ~/.bash_profile integration check
✔ zsh ~/.zshrc integration check
✔ zsh ~/.zprofile integration check

Let's make sure Fig is setup correctly...
✔ Fig bin exists
✔ PATH contains ~/.local/bin
✔ PATH contains ~/.fig/bin
✔ Settings Corruption
✔ State Corruption
✔ Fig Integration
✔ SSH integration

Let's make sure Fig is running...
✔ Fig is running
✔ Fig socket exists
✔ Daemon
✔ Daemon diagnostics

Let's see if Fig is in a working state...
✔ Figterm
✔ Insertion lock does not exist
✔ Autocomplete dev mode
✔ Plugin dev mode
✔ Dashboard is loading from the correct URL
✔ Autocomplete is loading from the correct URL

Let's check if your system is compatible...
✔ OS is supported
✔ Fish is up to date
✔ Jetbrains Toolbox Check

Let's check fig diagnostic...
✔ Compatible shell
✔ Fig app installed in the right place
✔ Autocomplete is enabled
✔ Fig CLI path
✔ Accessibility enabled

Let's check your terminal integrations...
✔ Terminal support

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

I would check that the the environment value of FIG_SET_PARENT on the macOS side matches the value of the env var FIG_PARENT on the Linux side. If these don't match up then the app will not be able to connect to the correct socket.

It also looks like the Linux CLI version is a few versions behind, would try to update that.

EmranMR commented 4 months ago

@grant0417 Thanks for the reply, I uninstalled and installed again, following the documentations from your website. I am still getting the version 2.15.0 on my ubuntu.. Is there a way to force and install a specific version in this case 2.17.1

I also double checked the diagnostics after reinstalling the Fig Integration. As you noted, the FIG_SET_PARENT and FIG_PARENT are still not matching.... Can I manually change my remote to match the local machine?

I also get the following error whenever I install the integration on the remote machine. I dont think this has any significance but I just thought to share with you.

Thanks Emran :)

0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
Need to get 80.5 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://repo.fig.io/apt stable/main amd64 fig-headless amd64 2.15.0 [80.5 MB]
Fetched 80.5 MB in 2s (40.2 MB/s)
Selecting previously unselected package fig-headless.
(Reading database ... 234651 files and directories currently installed.)
Preparing to unpack .../fig-headless_2.15.0_amd64.deb ...
Unpacking fig-headless (2.15.0) ...
Setting up fig-headless (2.15.0) ...
Installing integrations
Installing dotfiles integration
Installed!
Installing daemon integration
Installed!
Installing ssh integration
Installed!

✨ Fig has been installed ✨

Fig had an Error!: No such file or directory (os error 2)
error: Already logged in as xxx@xxx.xxx , please logout first.