projectile icon indicating copy to clipboard operation
projectile copied to clipboard

projectile-find-file crashes when viewing a file over SSH

Open modulitos opened this issue 1 year ago • 2 comments

Expected behavior

When I'm viewing a file over an SSH connection on a remote server, M-x projectile-find-file opens the minibuffer with a list of files in the project to select.

Actual behavior

Minibuffer doesn't open, with these messages in my *Messages* buffer:

Projectile is initializing cache for /ssh:my.example.com:/home/me/projects/my-remote-project/ ... project--read-file-cpd-relative: Wrong type argument: stringp, nil

Note that the "Projectile is initializing cache..." message appears every time I run projectile-find-file, as if the project isn't being created/cached successfully.

Steps to reproduce the problem

  1. open a file over SSH with TRAMP, where the file is within a git repo (C-x C-f /ssh:my.example.com:/home/me/projects/my-remote-project/readme.md)
  2. the file opens successfully (SSH and TRAMP are working)
  3. run M-x projectile-find-file

My minibuffer should show list of files within that repo that I can select, but there are no files.

Note that everything works as expected when I open a file on my local machine:

  1. The minibuffer opens, with a prompt like 1/12 [my-local-project] Find file:, and a list of files to select
  2. The "Projectile is initializing cache..." only happens the first time I run projectile-find-file within that repo, indicating that the project was created and cached successfully.

Environment & Version information

Projectile version information

2.9.0-snapshot

(via Doom Emacs)

Emacs version

29.1

Operating system

Macos Sonoma 14.5 (23F79)

Other notes

projectile-indexing-method is set to hybrid

fd is present on my remote machine, and is on my path when I run TERM=dumb ssh my.example.com

Perhaps related to this issue: https://github.com/bbatsov/projectile/issues/1886

modulitos avatar Jul 25 '24 03:07 modulitos

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed soon if no further activity occurs. Thank you for your contribution and understanding!

github-actions[bot] avatar Jan 19 '25 02:01 github-actions[bot]

Does this still happen with the latest Projectile from master?

Can you also post the full backtrace?

bbatsov avatar Feb 01 '25 08:02 bbatsov