You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
THTTPException: Received a response with a bad HTTP status code: 400 #90
THTTPException: Received a response with a bad HTTP status code: 400
at exports.HttpConnection.responseCallback (/workspace/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js:173:26)
at ClientRequest.connection.responseCallback (/workspace/node_modules/@databricks/sql/dist/connection/connections/HttpConnection.js:67:30)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:513:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
at TLSSocket.socketOnData (node:_http_client:534:22)
at TLSSocket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
the credentials are right because I'm refactoring the code that uses odbc + simbaspark driver and it works with the same credentials.
Hi @deugene! Can you please share credentials you use (or even better - the whole code snippet)? Obviously, you can hide sensitive parts like PAT. I just want to make sure everything is okay with your code in general before I try other ideas. Thank you!
I found the reason!)) The path must start with "/"!
But in databricks docs they have this line:
...
The HTTP Path value for http_path is similar to the following: for a cluster, sql/protocolv1/o/1234567890123456/1234-567890-abcdefgh; ...
and in cluster settings HTTP Path also doesn't have a trailing /. I think it would be a good idea to handle paths both with and without a trailing / :slightly_smiling_face:
Hi @deugene! We already did fix this, but looks it got lost somehow (#27). I'll double-check it ASAP, thank you for reporting!
Upd.: yes, I accidentally removed that feature during one of refactoring 🤦♂️
By the way, I have an off-topic question. Do I really have to do the following:
const client = await databricks.connect(connection);
each time I make a request?
Or can I do it once on app init and just open/close sessions to make a new request?
Yes, the idea is that you have a connection for each set of host+path+PAT, and then just open session(s) and do requests. You can even have a single session - no need to open a new one for each new request (but of course you may open as much sessions as you need).
@deugene I restored a feature I mentioned above (#91), it will become available with next release. Meanwhile, since you have a workaround, I'll close this issue. Feel free to re-open it, or open another one if you have other questions. Thank you!
Activity
kravets-levko commentedon Nov 7, 2022
Hi @deugene! Can you please share credentials you use (or even better - the whole code snippet)? Obviously, you can hide sensitive parts like PAT. I just want to make sure everything is okay with your code in general before I try other ideas. Thank you!
deugene commentedon Nov 7, 2022
Hi, @kravets-levko! Thank you for your quick response! Yep, sure. It looks something like this:
deugene commentedon Nov 7, 2022
By the way, I have an off-topic question. Do I really have to do the following:
each time I make a request?
Or can I do it once on app init and just open/close sessions to make a new request?
deugene commentedon Nov 7, 2022
I found the reason!)) The path must start with "/"!
But in databricks docs they have this line:
and in cluster settings HTTP Path also doesn't have a trailing /. I think it would be a good idea to handle paths both with and without a trailing / :slightly_smiling_face:
kravets-levko commentedon Nov 7, 2022
Hi @deugene! We already did fix this, but looks it got lost somehow (#27). I'll double-check it ASAP, thank you for reporting!
Upd.: yes, I accidentally removed that feature during one of refactoring 🤦♂️
Yes, the idea is that you have a connection for each set of host+path+PAT, and then just open session(s) and do requests. You can even have a single session - no need to open a new one for each new request (but of course you may open as much sessions as you need).
kravets-levko commentedon Nov 8, 2022
@deugene I restored a feature I mentioned above (#91), it will become available with next release. Meanwhile, since you have a workaround, I'll close this issue. Feel free to re-open it, or open another one if you have other questions. Thank you!