Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Handle language server is closed error in user readable format #500

Closed
1 task done
shawn-hurley opened this issue Feb 8, 2024 · 3 comments
Closed
1 task done
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@shawn-hurley
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

All

Priority

Minor

Current Behavior

When we get an error from a language server, we usually get it from an RPC connection either stopping or being unreachable. The current errors that come out of the package are like: ERRO[0015] unable to ask for tackle rule entry error="write |1: broken pipe" provider=java

Expected Behavior

We should expose errors that make sense to the end user and log the errors coming from RPC at a lower verbosity for debugging.

The error that is exposed should be "connection to the language server is closed, language server is not running"

How Reproducible

Always (Default)

Steps To Reproduce

  1. podman build -f demo.Dockerfile
  2. Podman run -it -m 1G --entrypoint /bin/bash
  3. konveyor-analyzer

The pod is killed, and you will eventually see: ERRO[0015] unable to ask for tackle rule entry error="write |1: broken pipe" provider=java

Environment

- **Analyzer Image SHA** 
- **JDTLS  base image SHA**
- **Provider Settings JSON**

Anything else?

To fix this, we will need to capture this error from the RPC client and override it.

First find all the times we call rpc.Call function. Create a new package in jsonrpc2 called rpcerr.

From here create a function that will look like:

func IsRPCClosed(err error) bool 

This function will compare the error string, for the error that we don't want to see. If it finds it return true, if not return false.

Where we deal with the rpc.Call error, add a block that will see if it is a closed error, if it is, change the error in the log to:
``fmt.Errrof("connection to the language server is closed, lanaguage server is not running")```

@shawn-hurley shawn-hurley added kind/bug Categorizes issue or PR as related to a bug. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Feb 8, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Feb 8, 2024
@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Feb 8, 2024
@konveyor-ci-bot
Copy link

This issue has been marked 'good first issue'
Please, make sure it aligns with the criteria found here

@shawn-hurley shawn-hurley changed the title [BUG] <title> [BUG] Handle language server is closed error in user readable format Feb 8, 2024
@shawn-hurley
Copy link
Contributor Author

/priority backlog

@konveyor-ci-bot konveyor-ci-bot bot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. labels Feb 8, 2024
@dymurray dymurray moved this from 🆕 New to 📋 Backlog in Planning Jun 20, 2024
shawn-hurley pushed a commit that referenced this issue Jul 12, 2024
Solves #500

---------

Signed-off-by: Alejandro Brugarolas <[email protected]>
@jmle jmle moved this from 📋 Backlog to ✅ Done in Planning Jul 16, 2024
@jmle
Copy link
Contributor

jmle commented Jul 24, 2024

Done by @abrugaro

@jmle jmle closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants