Indexing Freezes on a PHP Script
Hello
This is my first day using it and I'm testing it first by indexing a project.
I came here in issues and found other people complaining about this recent issue.
so I decided to rerun the indexing again to find out that it stuck at the same file.
I decided to cancel to share the error and I can share the file if that may help you.
PS C:\Users\Bond> uv run --directory "C:\Users\Bond\serena" index-project "C:\laragon\www\New folder" Indexing symbols in project C:\laragon\www\New folder Indexing (add_automatic_cart_clearing.php): 100%|████████████████████████████████████████| 1/1 [00:00<00:00, 48.77it/s] Windows detected - using nuclear shutdown to prevent zombies Symbols saved to C:\laragon\www\New folder.serena\cache\php\document_symbols_cache_v20-05-25.pkl Exception ignored in: <function IocpProactor.del at 0x0000024A2FD5D300> Traceback (most recent call last): File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_events.py", line 923, in del self.close() File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_events.py", line 890, in close fut.cancel() File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_events.py", line 159, in cancel return super().cancel(msg=msg) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\base_events.py", line 762, in call_soon self._check_closed() File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\base_events.py", line 520, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed Task was destroyed but it is pending! task: <Task pending name='Task-3' coro=<LanguageServerHandler.run_forever() running at C:\Users\Bond\serena\src\multilspy\lsp_protocol_handler\server.py:413> wait_for=<Future pending cb=[Task.task_wakeup()]>> Task was destroyed but it is pending! task: <Task pending name='Task-4' coro=<LanguageServerHandler.run_forever_stderr() running at C:\Users\Bond\serena\src\multilspy\lsp_protocol_handler\server.py:443> wait_for=<Future pending cb=[Task.task_wakeup()]>> Exception ignored in: <function BaseSubprocessTransport.del at 0x0000024A2FCE1DA0> Traceback (most recent call last): File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\base_subprocess.py", line 125, in del _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\base_subprocess.py", line 70, in repr info.append(f'stdin={stdin.pipe}') ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 80, in repr info.append(f'fd={self._sock.fileno()}') ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000024A2FCE3600> Traceback (most recent call last): File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 116, in del _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 80, in repr info.append(f'fd={self._sock.fileno()}') ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000024A2FCE3600> Traceback (most recent call last): File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 116, in del _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 80, in repr info.append(f'fd={self._sock.fileno()}') ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000024A2FCE3600> Traceback (most recent call last): File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 116, in del _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\proactor_events.py", line 80, in repr info.append(f'fd={self._sock.fileno()}') ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Bond\AppData\Roaming\uv\python\cpython-3.11.13-windows-x86_64-none\Lib\asyncio\windows_utils.py", line 102, in fileno raise ValueError("I/O operation on closed pipe") ValueError: I/O operation on closed pipe RuntimeError: <_overlapped.Overlapped object at 0x0000024A32C14930> still has pending operation at deallocation, the process may crash RuntimeError: <_overlapped.Overlapped object at 0x0000024A32C15170> still has pending operation at deallocation, the process may crash RuntimeError: <_overlapped.Overlapped object at 0x0000024A32C152F0> still has pending operation at deallocation, the process may crash RuntimeError: <_overlapped.Overlapped object at 0x0000024A32C14B70> still has pending operation at deallocation, the process may crash RuntimeError: <_overlapped.Overlapped object at 0x0000024A32C14C30> still has pending operation at deallocation, the process may crash
I had the same issue, gets stuck on the same PHP file every time even after clearing the cache and restarting.
Please note this line:
Windows detected - using nuclear shutdown to prevent zombies
The task completed successfully (after having indexed all files and having saved the symbol cache); the process was just not shut down gracefully, because we couldn't yet find a way to do so.
Why do you say it "got stuck"? Didn't the process terminate?
We are working on handling this better, but for now, the reported traceback can simply be ignored.
Everytime I run a full project, it is stuck at the same file like this
but when I only did the index over that specific file, it gave me the previous response.
However, it didn't just gave me the response directly, It got stuck too and I had to click multiple ctrl+c to cancel, terminate or end it, and when it did, it showed the message I shared earlier.
@DeployThemAll can you please check whether switching to Serena branch solid-lsp makes a difference?
@opcode81 It worked for me, thanks!
It worked for indexing but too slow
for example the folder I'm trying to index is about 14k it hit the file that had issues before at 7336 in roughly 3 mins but took another 3 hours to complete the whole indexing.
I'm not sure if that is normal, I'm sharing what happened., it may help you in debugging.
Thank you
Most likely, the language server died and every subsequent attempt to index a file timed out (after several minutes). We will have to make Serena robust to language server crashes. Added #270 to address this.
I've implemented a solution for this PHP indexing issue in PR #346.
The problem occurs when Intelephense encounters large PHP files that exceed its default memory/file size limits, causing indexing to hang indefinitely.
Solution: Configurable Intelephense Options
Added CLI parameters to the index-project command:
--max-memory: Set maximum memory (MB) for Intelephense (minimum 256)--max-file-size: Set maximum file size (bytes) for Intelephense to process
Usage:
# Index with higher memory limit and file size limit
uv run index-project /path/to/php/project --max-memory 512 --max-file-size 500000
This allows users to:
- Increase memory when hitting memory limits
- Reduce file size limits to skip problematic large files
- Configure these settings per-project as needed
The implementation follows the established development patterns and has been tested with the exact scenario described in this issue. All PHP tests pass and the solution successfully resolves the indexing hangs.
Please see PR #346 for full implementation details and testing results.
am also in the same boat where i get _ide_helper.php is over the maximum file size of 1000000 bytes., having a way to pass either some config to the lsp or a global config for serena to apply to all lsp will be very beneficial.
Configuration will be possible after #524 is merged. I'll try to find time to finalize it soon, it has already been reviewed and only minimal changes are needed