phpactor/phpactor

PHPActor langauge-server is unable to create cache directory for project

Closed this issue · 2 comments

I'm trying to start the language server (for an ancient codebase) using a script to start the language-server and am into this issue where the language server tries to create the dirty file while trying to Find References. The problem it runs into is that the project's directory under the cache doesn't exist.

LSP Error (code -32603): Exception [RuntimeException] Dirty index file path "/home/myuser/.cache/phpactor/index/myproject-6a9df1/dirty" cannot be created, maybe the directory does not exist? at phar:///home/myuser/.local/bin/phpactor/lib/Indexer/Model/FileListProvider/DirtyFileListProvider.php#33

If I manually create the /home/myuser/.cache/phpactor/index/myproject-6a9df1/ directory, then it works fine.

I also tried changing the cache location to be under /tmp/phpactor-cache/ and gave the directory 755 (also tried 777) permission so it can create whatever sub-dirs it needs, but it's still not able to (or is it not trying to?).

There's nothing in my system that would stop it from being able to create a directory and the permissions are wide open.

Version:
Phpactor 2025.04.17.0

OS:
Linux

Please let me know if there's any additional information I can provide to get to the bottom of why it's failing.

That's an interesting problem it looks like the index directory/home/myuser/.cache/phpactor/index doesn't exist when the dirty tracker is running. Can you check that this is created when running the phpactor index:build command?

Looks like the mistake is mine. I assumed the Language Server would build the index as requests are made to it - that's the way most other language servers that I've used operate. I didn't know I had to invoke phpactor index:build for it to work.

It's working with this s I'll be closing this issue.