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

Ruff: Ruff encountered a problem. Check the logs for more details. #463

Open
jerodg opened this issue Jul 1, 2024 · 10 comments
Open

Ruff: Ruff encountered a problem. Check the logs for more details. #463

jerodg opened this issue Jul 1, 2024 · 10 comments

Comments

@jerodg
Copy link

jerodg commented Jul 1, 2024

Describe the bug
Ruff: Ruff encountered a problem. Check the logs for more details.
Where are the logs? This used to display the actual error in the notification window. The new error message is not helpful at all.

To Reproduce
Steps to reproduce the behavior:
Encounter an error.

Expected behavior
Tell me what actually happened in the notification window as in the previous versions. Or in the very least include a clickable link to where the logs are stored.

Screenshots
image

Environments (please complete the following information):

  • IDE: PyCharm 2024.1.4 (Pro)
  • OS: macOS 14.5
  • Ruff Version: 0.5.0
  • Plugin version: 0.0.34

Additional context
N/A

@LiaoSW
Copy link

LiaoSW commented Jul 2, 2024

I came across the same error

@rh-sp
Copy link

rh-sp commented Jul 2, 2024

Log:

2024-07-02 13:27:51,068 [9457973]   INFO - #c.i.p.l.i.LspServerImpl - RuffServerServerDescriptor@<project>(Running;91): window/showMessage: Ruff encountered a problem. Check the logs for more details.
2024-07-02 13:27:51,069 [9457974]   WARN - #c.i.p.l.i.LspServerImpl - RuffServerServerDescriptor@<project>(Running;91): Error response from server: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: A parsing error occurred during `fix_all

From Ruff 0.5.0 changelog:

From the announcement blog post:

Use --output-format=concise or the RUFF_OUTPUT_FORMAT environment variable to go back to a more concise output without code snippets:

@rh-sp
Copy link

rh-sp commented Jul 4, 2024

In case of syntax errors, this message will also pop up with Ruff < 0.5.0. Might be related to ongoing changes in Ruff to their parser for handling syntax errors. Would be cool if the plugin could support this!

I am using ruff server, if that makes a difference.

@pySilver
Copy link

pySilver commented Aug 9, 2024

Does anyone have any workaround for this or you simply sticked to lower ruff version?

@rh-sp
Copy link

rh-sp commented Sep 4, 2024

Does anyone have any workaround for this or you simply sticked to lower ruff version?

I just trained myself to ignore the error message...

@jerodg
Copy link
Author

jerodg commented Sep 4, 2024

Does anyone have any workaround for this or you simply sticked to lower ruff version?

A previous reply has the solution.

If you set the environment variable or use the argument it will show you the full error which you can then correct yourself, typically an error in your configuration.

From the announcement blog post:

Use --output-format=concise or the RUFF_OUTPUT_FORMAT environment variable to go back to a more concise output...

@rh-sp
Copy link

rh-sp commented Sep 5, 2024

Use --output-format=concise or the RUFF_OUTPUT_FORMAT environment variable to go back to a more concise output...

Since the plugin doesn't have an option to set either of those things, what you're saying is that the workaround would be to either of these two options?

  1. Create a wrapper script for ruff that passes the extra argument (or sets the environment variable) and configure the plugin to use the wrapper script as the Ruff executable, or
  2. Set the environment variable at a user / system level.

@jerodg
Copy link
Author

jerodg commented Sep 5, 2024

Just set the environment variable. It's a trivial thing to do.

@dhruvmanila
Copy link

@rh-sp Thank you for the logs. The error message that you received has been fixed in astral-sh/ruff#12148 (released in 0.5.1). Sorry for the inconvenience.

@jerodg Can you provide the logs? Do you still get the error message when using the latest Ruff version?

@rh-sp
Copy link

rh-sp commented Sep 6, 2024

Strange, I thought I was still seeing the error sometimes despite upgrading, but maybe that was for a different reason. I'll keep my eyes open and update / create no issue if required.

dhruvmanila added a commit to astral-sh/ruff-vscode that referenced this issue Sep 6, 2024
## Summary

This PR includes a "Show Logs" button for all window messages from Ruff.
This might be useful to reduce the friction for the users in figuring
out where the logs are. This is something I saw when looking at
koxudaxi/ruff-pycharm-plugin#463 description.

## Test Plan

<img width="472" alt="Screenshot 2024-09-06 at 10 15 55"
src="https://github.com/user-attachments/assets/783259ed-ce68-411c-93cd-3e7e094c8172">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants