Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 Request textDocument/codeAction failed. #4136

Closed
1 task done
dougg0k opened this issue Jan 3, 2023 · 17 comments
Closed
1 task done

🐛 Request textDocument/codeAction failed. #4136

dougg0k opened this issue Jan 3, 2023 · 17 comments
Labels
S-Needs info Status: the issue needs more info in order to be triaged

Comments

@dougg0k
Copy link

dougg0k commented Jan 3, 2023

Environment

> pnpm rome rage .
CLI:
  Version:              11.0.0
  Color support:        true

Platform:
  CPU Architecture:     x86_64
  OS:                   linux

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "xterm-256color"

Rome Configuration:
  Status:               loaded
  Formatter disabled:   false
  Linter disabled:      false

Workspace:
  Open Documents:       0

Discovering running Rome servers...

Incompatible Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ Rage discovered this running server using an incompatible version of Rome.

Server:
  Version:              <=10.0.0

Running Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:              11.0.0
  Name:                 rome_lsp
  CPU Architecture:     x86_64
  OS:                   linux

Workspace:
  Open Documents:       0

What happened?

Just got this from VScode rome output.

[cli-stdout] data 18
[cli] exit 0
Connecting to "/tmp/rome-socket-" ...
[Info  - 2:16:03 PM] Server initialized with PID: 1907599
[Error - 2:19:28 PM] Request textDocument/codeAction failed.
  Message: failed to access range Range { start: Position { line: 173, character: 48 }, end: Position { line: 173, character: 61 } } in document file:///project/src/services/auth.service.ts
  Code: -32603 
failed to access range Range { start: Position { line: 173, character: 48 }, end: Position { line: 173, character: 61 } } in document file:///project/src/services/auth.service.ts

Caused by:
    position Position { line: 173, character: 61 } is out of range

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@dougg0k dougg0k added the S-To triage Status: user report of a possible bug that needs to be triaged label Jan 3, 2023
@leops
Copy link
Contributor

leops commented Jan 4, 2023

Could you restore the "Environment" section from the issue template with the output of the rome rage command ? It may contain important information to help us debug the issue

@leops leops added S-Needs info Status: the issue needs more info in order to be triaged and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Jan 4, 2023
@dougg0k
Copy link
Author

dougg0k commented Jan 4, 2023

It contains too much data if the server are on. Not possible.

@ematipico
Copy link
Contributor

@dougg0k, you're free to remove the logs from the output - or keep the relevant ones, but we need that information to triage the issue. We need further info to be able to help fix the problem.

@dougg0k
Copy link
Author

dougg0k commented Jan 4, 2023

Done

@dougg0k
Copy link
Author

dougg0k commented Jan 6, 2023

I am not able to easily reproduce the issue, but this time, I got somewhere else. I use typescript in the project and there was an typescript error, as I was trying to fix the type error trying out some stuff and saving, the error appeared.

Tried (possible type fix > saved > failed) around 2 to 3 times, before I got it right, and in between, the error appeared.

That's pretty much it.

@leops
Copy link
Contributor

leops commented Jan 9, 2023

This looks like an instance of the document content on the server side getting out of sync with the text buffer in the editor client, but unfortunately without the server logs it's difficult to understand the sequence of events that make this happen

@hwallis93
Copy link

I am trialling Rome for my medium-large TypeScript project and unfortunately hit this frequently. I am (anecdotally) more likely to hit it when moving lines up and down, or when my PC is under load.

Where can I find the server logs?

@dougg0k
Copy link
Author

dougg0k commented Jan 12, 2023

First you start the rome server with rome start and logs will appear with rome rage .

@ematipico
Copy link
Contributor

I am trialling Rome for my medium-large TypeScript project and unfortunately hit this frequently. I am (anecdotally) more likely to hit it when moving lines up and down, or when my PC is under load.

Where can I find the server logs?

They in the temporary folder of the OS, under a folder called rome-logs

@hwallis93
Copy link

hwallis93 commented Jan 13, 2023

server.log.2023-01-13-09.txt
Repro'd this morning by opening my codebase in VS code and moving some lines around. Server log attached, error first hit on line 1256. I closed VS Code immediately after hitting it to keep the log small.

For future reference my logs were in C:\Users\<username>\AppData\Local\Temp\rome-logs

@github-actions
Copy link

👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella

@hwallis93
Copy link

Any update on this?

@ematipico ematipico removed the S-Stale label Feb 14, 2023
@TomerAtarScopio
Copy link

TomerAtarScopio commented Apr 3, 2023

I seem to be getting this issue mostly after interacting a bit with the code in the code diff split editor, also in a TypeScript project.

When this reproduces it also sometimes seems to produce broken code when formatting on save - some text gets deleted, or content reverts in some parts to old file content
Once it reproduces it fails on any file and on every caret move, can be mitigated by Reload Window action

@ematipico
Copy link
Contributor

Thank you for the input. It seems we still have synchronisation issues: the document we have in the LSP and the document we have in the workspace get out of sync somehow.

There are a few issues already around the same problem. We're looking into it.

@denbezrukov
Copy link
Contributor

@TomerAtarScopio
I guess that it's the same issue which you have #4338

@elijaholmos
Copy link

Also getting this error after using diff view in VScode, it spams notifications for each keystroke I type in files afterwards and is very annoying.

@ematipico
Copy link
Contributor

Duplicate of #4338

@ematipico ematipico marked this as a duplicate of #4338 Apr 7, 2023
@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Needs info Status: the issue needs more info in order to be triaged
Projects
None yet
Development

No branches or pull requests

7 participants