question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot connect to CoilMQ: "Failed to connect at web socket level"

See original GitHub issue

I’m using STOMP for interaction between android device and raspberry pi. As a server I have Coilmq STOMP server this installed on RPi4 and successfully tested with stomp.py - a python library of STOMP client.

By using krossbow STOMP client library I receive “GET” command only with URL and headers which doesn’t have STOMP initial commands (STOMP or CONNECT) but instead it looks like WEB STOMP version:

b'GET /queue/camera HTTP/1.1\r\nHost: 172.18.5.38:61613\r\nAccept-Charset: UTF-8\r\nAccept: */*\r\nUpgrade: websocket\r\nConnection: upgrade\r\nSec-WebSocket-Key: ZDEzNzIyYzEwOGU5MDdkNw==\r\nSec-WebSocket-Version: 13\r\nUser-Agent: Ktor client\r\n\r\n'

And because of this I’m unable to connect to the server… Android log info:

Failure(org.hildan.krossbow.stomp.WebSocketConnectionException: Failed to connect at web socket level to ws://172.18.5.38:61613/queue/cam)

The coilmq log shorted info:

Exception occurred during processing of request from ('172.18.4.14', 17474)
Traceback (most recent call last):
...
  File "/usr/local/lib/python3.9/dist-packages/coilmq/util/frames.py", line 51, in parse_headers
    return preamble_lines[0], OrderedDict([l.split(':') for l in preamble_lines[1:]])
ValueError: too many values to unpack (expected 2)

On the other hand, when I run python STOMP client, there is STOMP command and the message looks like:

b'STOMP\naccept-version:1.1\nlogin:admin\npasscode:password\n\n\x00'

And after that I’m successfully connected to the server.

Stomp client have been build on KtorWebSocketClient as in official documentation and using that I attempted to connect via local network.

Any Idea what I’m doing wrong? Thank you!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
joffrey-bioncommented, Sep 14, 2022

That’s heartwarming, thanks! I try to do my best, and this kind of message really motivates me to do more!

I hope you’ll find a nice alternative for this use case. Have a good one!

1reaction
EugeneSidcommented, Sep 14, 2022

Now everything became clear thanks to you. I think I’d looking for some other solution for CoilMQ communication. I really appreciate your help and I’ll keep monitoring krossbow updates at least because we are using it in our main project and it works well. Also I really like how quick and good support are. Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket connection failed. Error in browser console, since ...
I'm using nginx as reverse proxy with letsencrypt. grafana log file: t=2021-10-28T13:43:05+0000 lvl=info msg="Request Completed" logger ...
Read more >
Can I catch the "can't establish a connection" error for a failed ...
Adding try {} catch(e) {} to my code, both when connecting the socket and closing it - no change. Any ideas on how...
Read more >
WebSocket connection fails in WatchOS9 - Apple Developer
Socket connection doesn't work on real devices for watchOS 9. It was working well on WatchOS 7 & WatchOS 8. Is this a...
Read more >
Troubleshooting connection issues | Socket.IO
Problem: the socket is not able to connect​. Possible explanations: You are trying to reach a plain WebSocket server; The server is not ......
Read more >
26. WebSocket Support - Spring
This part of the reference documentation covers Spring Framework's support for WebSocket-style messaging in web applications including use of STOMP as an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found