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

Bash IDE throws a warning pasing the response from Explainshell, but works anyway? #1080

Open
KlfJoat opened this issue Jan 10, 2024 · 2 comments

Comments

@KlfJoat
Copy link

KlfJoat commented Jan 10, 2024

Code editor

VS Codium

Platform

Linux

Version

1.38.0

What steps will reproduce the bug?

Run Explainshell via docker-compose as per the instructions at https://github.com/idank/explainshell

Install and run Bash IDE in VS Codium v1.85.1 on Ubuntu 23.10 with the following configuration settings:

"bashIde.shellcheckPath": "",
"bashIde.explainshellEndpoint": "http://localhost:5000/",
"bashIde.includeAllWorkspaceSymbols": true

How often does it reproduce? Is there a required condition?

If I open a bash script and hover over a common command that Explainshell includes, like find, sort, sha1sum, cut, etc., I will see the text pop up and give me information on the command.

However, in the output console under "Bash IDE" I see an error message for each command I hover over.

What is the expected behavior?

No errors in the log while performing an explainshell lookup.

What do you see instead?

[Warn - 4:34:23 PM] 22:34:23.185 WARNING ⛔️ getExplainshellDocumentation exception: invalid json response body at http://localhost:5000//api/explain?cmd=find reason: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Additional information

The URL is correct and I have tried browsing to the URL http://localhost:5000//api/explain?cmd=find. It returns the following source.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

Browsing to http://localhost:5000/explain?cmd=find works as expected.

Explainshell has no API AFIAK. So I'm not sure what JSON output Bash IDE is expecting? And why it's hitting this non-existent /api endpoint first, then obviously finding the correct data to show me in the hover text.

@palansher
Copy link

Confirm.

The recommended https://github.com/idank/explainshell has no /api path. But works well on root / path
The request must be
http://localhost:5000/explain?cmd=echo
instead of http://localhost:5000/api/explain?cmd=echo

@KlfJoat
Copy link
Author

KlfJoat commented Feb 26, 2024

Palansher got me thinking, and I checked. https://explainshell.com/api/explain?cmd=find doesn't even work. It returns 404.

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

2 participants