Encountered an unexpected error
Bug report
- [x] I confirm this is a bug with Supabase, not with my own application.
- [ ] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Got a message popup to check my output because the tools crashed. This was in the output:
Encountered an unexpected error
This is a bug in Postgres Tools, not an error in your code, and we would appreciate it if you could report it along with the following information to help us fixing the issue:
Source Location: crates\pgt_workspace\src\workspace\server\change.rs:130:14
Thread Name: tokio-runtime-worker
Message: called `Result::unwrap_err()` on an `Ok` value: 1
(There could also be a link to the issues page of this project. I was unsure where to post the report)
To Reproduce
I was uncommenting some selected SQL with the VSCode Toggle Block Comment (editor.action.blockComment) action.
Expected behavior
No crash.
System information
- OS: Windows
Additional context
I tried to repro using the provided logs but it did not crash for me. We fixed a few things in this area recently - maybe it's already fixed on main. We will release a new version in the next few days. Will ping you to retry this then :)
0.4.0 is out :)
With 0.5.0, vs-code and windos11 I receive a similiar error (quiet frequently) @psteinroe :
2025-04-22 11:03:03.514 [info] Encountered an unexpected error
This is a bug in Postgres Tools, not an error in your code, and we would appreciate it if you could report it along with the following information to help us fixing the issue:
Source Location: crates\pgt_lexer\src\lib.rs:181:9
Thread Name: tokio-runtime-worker
Message: No token found at position 315: 'Some("\r")'
Position is always different:
Message: No token found at position 311: 'Some("\r")'
Message: No token found at position 317: 'Some("\r")'
...
Seen in v.0.6.1 in vscode insiders;
2025-04-29 09:28:11.306 [info] [Info - 9:28:11 AM] Server initialized with PID: 84737
2025-04-30 16:07:02.223 [info] Encountered an unexpected error
This is a bug in Postgres Tools, not an error in your code, and we would appreciate it if you could report it along with the following information to help us fixing the issue:
Source Location: crates/pgt_workspace/src/workspace/server/change.rs:119:14
Thread Name: tokio-runtime-worker
Message: called `Result::unwrap_err()` on an `Ok` value: 18
2025-04-30 16:07:02.473 [info] [Error - 4:07:02 PM] PostgresTools language server closed
2025-04-30 16:07:02.473 [info] [Error - 4:07:02 PM] Server process exited with code 0.
Thanks for reporting! Any chance we could get a log file for this?
hey, the latest release should fix this! we removed the code that was causing all of these issues and replaced it with a much simpler variant. could you try it out and report back?
closing this since the code that crashed doesnt even exist anymore.