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

Error: Could not get valid data from REST API #201

Open
fwolter opened this issue Apr 13, 2020 · 5 comments
Open

Error: Could not get valid data from REST API #201

fwolter opened this issue Apr 13, 2020 · 5 comments

Comments

@fwolter
Copy link
Member

fwolter commented Apr 13, 2020

I'm getting the following error, when connecting to my openHAB instance, running behind a nginx reverse proxy with Basic Auth and Letsencrypt with redirection to SSL:

Error: Could not get valid data from REST API
    at U._callback (c:\Users\fab\.vscode\extensions\openhab.openhab-0.7.0\serverJS\out\LSPServer.js:135:130206)
    at U.t._callback.t.callback.t.callback (c:\Users\fab\.vscode\extensions\openhab.openhab-0.7.0\serverJS\out\LSPServer.js:195:5603)
    at U.emit (events.js:203:13)
    at U.<anonymous> (c:\Users\fab\.vscode\extensions\openhab.openhab-0.7.0\serverJS\out\LSPServer.js:195:18463)
    at U.emit (events.js:203:13)
    at IncomingMessage.<anonymous> (c:\Users\fab\.vscode\extensions\openhab.openhab-0.7.0\serverJS\out\LSPServer.js:195:17295)
    at Object.onceWrapper (events.js:291:20)
    at IncomingMessage.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1168:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

When looking into the TCP stream, I see VSCode gets redirected via port 80 to 443 and then continues encrypted. The connection to the LSP on port 5007 seems to work. Accessing the REST API via browser do work and connecting VSCode to the REST API of my local openHAB instance work, too.

This is my config:
grafik

Tried already port 443 or connecting by IP address.

VSCode openHAB 0.7.0
openHAB 2.5.3

@Confectrician
Copy link
Collaborator

It seems that the local LSP server cant handle the basic auth connection.
IT seems to not get dactivated fully, when remote lsp is active.

Reference:
https://github.com/openhab/openhab-vscode/blob/master/serverJS/src/ItemCompletion/ItemCompletionProvider.js#L153

This seems like a hardcoded url.

@fwolter
Copy link
Member Author

fwolter commented Apr 15, 2020

I just wanted to reproduce the error, but now, everything works. I didn't change anything by intention... Observing it.

@Confectrician
Copy link
Collaborator

Thanks for the Feedback.
I have a guess then.

Maybe we have some cached data that caused trouble.
I recently read from bug reports which seem to solve themselves.
Maybe we should check if we can provide some sort of caching override for settings.

@KHOne23
Copy link

KHOne23 commented Nov 3, 2020

I am faceing the same Problem when i have installed the Amazon Echo Control Binding. When i deinstall it everything works fine. when i reinstall it i am faceing this error

@heimerle
Copy link

@Confectrician basically i am facing the same problem, but i can confirm the hard coded URL problem, when adding /rest/items to the openHab.host config, at least the items occur in VS Code, for things i am still getting the error message "Error while connecting to REST API"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants