postgres-language-server icon indicating copy to clipboard operation
postgres-language-server copied to clipboard

Encountered an unexpected error

Open Marvosg opened this issue 8 months ago • 5 comments

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

server.log.2025-04-10-10.log

Marvosg avatar Apr 10 '25 10:04 Marvosg

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 :)

psteinroe avatar Apr 12 '25 19:04 psteinroe

0.4.0 is out :)

psteinroe avatar Apr 14 '25 05:04 psteinroe

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")'
...

Donnerstagnacht avatar Apr 22 '25 09:04 Donnerstagnacht

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.

t1mmen avatar Apr 30 '25 23:04 t1mmen

Thanks for reporting! Any chance we could get a log file for this?

psteinroe avatar May 01 '25 06:05 psteinroe

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?

psteinroe avatar Jul 15 '25 07:07 psteinroe

closing this since the code that crashed doesnt even exist anymore.

psteinroe avatar Sep 10 '25 06:09 psteinroe