Skip to content

Process killed after 5s after unknown text document error - using Zed #2847

Open
@OliverBeckwith

Description

@OliverBeckwith

Context:

  • On a large Laravel + legacy codebase
  • Using Zed.

phpactor gets stuck "resolving code actions" after a while quickly moving around within a large project. Enabling logging surfaces that the lsp process is killed "because it lived longer than 5s", immediately after an unknown text document error (commonly for a file that isn't even php, such as a .env or other config file).

Image

Log:


[2025-02-20 15:09:04] phpactor.INFO: Listening on STDIO {"channel":"LSP"} []
[2025-02-20 15:09:04] phpactor.INFO: Starting service: diagnostics (Phpactor\LanguageServer\Service\DiagnosticsService) {"channel":"LSP"} []
[2025-02-20 15:09:04] phpactor.INFO: Starting service: indexer (Phpactor\Extension\LanguageServerIndexer\Handler\IndexerHandler) {"channel":"LSP"} []
[2025-02-20 15:09:09] phpactor.ERROR: Error when handling "Phpactor\LanguageServer\Core\Rpc\NotificationMessage" ({"jsonrpc":"2.0","method":"workspace\/didChangeConfiguration","params":{"settings":[]}}): Exception [Phpactor\LanguageServer\Core\Handler\HandlerNotFound] Handler "workspace/didChangeConfiguration" not found, available handlers: "phpactor/debug/config", "phpactor/debug/workspace", "phpactor/status", "phpactor/service/start", "phpactor/service/stop", "phpactor/service/running", "workspace/executeCommand", "workspace/didChangeWatchedFiles", "textDocument/didOpen", "textDocument/didChange", "textDocument/didClose", "textDocument/didSave", "textDocument/willSave", "textDocument/willSaveWaitUntil", "phpactor/stats", "textDocument/codeAction", "textDocument/completion", "completionItem/resolve", "textDocument/signatureHelp", "textDocument/definition", "textDocument/typeDefinition", "textDocument/references", "textDocument/implementation", "textDocument/documentHighlight", "phpactor/indexer/reindex", "workspace/symbol", "textDocument/hover", "textDocument/documentSymbol", "textDocument/selectionRange", "textDocument/prepareRename", "textDocument/rename", "workspace/willRenameFiles" {"channel":"LSP"} []
[2025-02-20 15:09:15] phpactor.WARNING: The process was killed {"channel":"LSP"} []
[2025-02-20 15:09:15] phpactor.WARNING: Killed process "55160" ('/opt/homebrew/Cellar/php/8.4.3/bin/php' '/Users/ollie.beckwith/Library/Application Support/Zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar' 'language-server:diagnostics' '--uri=file:///Users/ollie.beckwith/Documents/sites/project/app/Models/Order.php' '--config-extra={"worse_reflection.enable_context_location": false}') because it lived longer than 5s {"channel":"LSP"} []
[2025-02-20 15:09:21] phpactor.INFO: Could not locate definition ""Do not know how to goto definition of symbol type "<unknown>"" {"channel":"LSP-REF"} []
[2025-02-20 15:09:21] phpactor.INFO: Could not locate definition ""Word "App\Models\[" could not be resolved to a class" {"channel":"LSP-REF"} []
[2025-02-20 15:09:21] phpactor.INFO: Could not locate definition ""Could not locate any references to variable" {"channel":"LSP-REF"} []
[2025-02-20 15:09:21] phpactor.INFO: Could not locate definition ""Do not know how to goto definition of symbol type "<unknown>"" {"channel":"LSP-REF"} []
[2025-02-20 15:09:21] phpactor.INFO: Could not locate definition ""Word "App\Models\ " could not be resolved to a class" {"channel":"LSP-REF"} []
[2025-02-20 15:09:21] phpactor.INFO: Could not locate definition ""Could not locate any references to variable" {"channel":"LSP-REF"} []
[2025-02-20 15:09:26] phpactor.ERROR: Error when handling "Phpactor\LanguageServer\Core\Rpc\NotificationMessage" ({"jsonrpc":"2.0","method":"textDocument\/didSave","params":{"textDocument":{"uri":"file:\/\/\/Users\/ollie.beckwith\/Documents\/sites\/project\/.env.example"},"text":" *omitting for security* "}}): Exception [Phpactor\LanguageServer\Core\Workspace\Exception\UnknownDocument] Unknown text document "file:///Users/ollie.beckwith/Documents/sites/project/.env.example" {"channel":"LSP"} []
[2025-02-20 15:09:27] phpactor.ERROR: Error when handling "Phpactor\LanguageServer\Core\Rpc\NotificationMessage" ({"jsonrpc":"2.0","method":"textDocument\/didSave","params":{"textDocument":{"uri":"file:\/\/\/Users\/ollie.beckwith\/Documents\/sites\/project\/.env.example"},"text":" *omitting for security* "}}): Exception [Phpactor\LanguageServer\Core\Workspace\Exception\UnknownDocument] Unknown text document "file:///Users/ollie.beckwith/Documents/sites/project/.env.example" {"channel":"LSP"} []
[2025-02-20 15:09:27] phpactor.WARNING: The process was killed {"channel":"LSP"} []
[2025-02-20 15:09:27] phpactor.WARNING: Killed process "55199" ('/opt/homebrew/Cellar/php/8.4.3/bin/php' '/Users/ollie.beckwith/Library/Application Support/Zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar' 'language-server:diagnostics' '--uri=file:///Users/ollie.beckwith/Documents/sites/project/app/Models/Order.php' '--config-extra={"worse_reflection.enable_context_location": false}') because it lived longer than 5s {"channel":"LSP"} []
[2025-02-20 15:09:29] phpactor.ERROR: Error when handling "Phpactor\LanguageServer\Core\Rpc\NotificationMessage" ({"jsonrpc":"2.0","method":"textDocument\/didSave","params":{"textDocument":{"uri":"file:\/\/\/Users\/ollie.beckwith\/Documents\/sites\/project\/.env"},"text":" *omitting for security* "}}): Exception [Phpactor\LanguageServer\Core\Workspace\Exception\UnknownDocument] Unknown text document "file:///Users/ollie.beckwith/Documents/sites/project/.env" {"channel":"LSP"} []
[2025-02-20 15:09:33] phpactor.WARNING: The process was killed {"channel":"LSP"} []
[2025-02-20 15:09:33] phpactor.WARNING: Killed process "55285" ('/opt/homebrew/Cellar/php/8.4.3/bin/php' '/Users/ollie.beckwith/Library/Application Support/Zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar' 'language-server:diagnostics' '--uri=file:///Users/ollie.beckwith/Documents/sites/project/app/Models/Order.php' '--config-extra={"worse_reflection.enable_context_location": false}') because it lived longer than 5s {"channel":"LSP"} []

It never restarts itself after this happens and I have to manually restart phpactor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions