Closed jasondborneman closed 6 months ago
The plot thickens. I tried an alternate client (wscat) and.. it's behaving similarly. Ended too fast and doing no output when it runs on GitHub Action runner ubuntu-latest
.
Something about running websocket commands from a github action runner must be causing this. Open to any areas to poke into or 💡 ideas of why this might be the case. I know this isn't necessarily a bug in websocat
now that I've dug further but sorta at my wit's end 😬
Forward finished
What is being fed to stdin in CI scenario? Maybe it's /dev/null
or something like that? This should be the difference between interactive run and CI run and can affect both clients.
Are you sending any WebSocket messages or only receiving them? If you want WebSocket to only receive the messages, use something like this:
websocat $websocketUrl -H "Authorization: Bearer $ACCESS_TOKEN" -U -n -v
i.e. "unidirectional-reverse" and "do not sent close message" options.
Forward finished
What is being fed to stdin in CI scenario? Maybe it's
/dev/null
or something like that? This should be the difference between interactive run and CI run and can affect both clients.Are you sending any WebSocket messages or only receiving them? If you want WebSocket to only receive the messages, use something like this:
websocat $websocketUrl -H "Authorization: Bearer $ACCESS_TOKEN" -U -n -v
i.e. "unidirectional-reverse" and "do not sent close message" options.
Just receiving messages. I'll try that out, thanks!
I think that did it! Thanks so much for the suggestion. I was tearing my hair out! 😄
When I run
websocat
locally (OSX), it's working great. But we need it as part of a GitHub CI process to kick off a websocket call that starts some integration testing. When it runs on the GitHub Actionubuntu-latest
it almost behaves as if it's ending the connection before it receives a message (or perhaps when it receives the first message??)websocat $websocketUrl -H "Authorization: Bearer $ACCESS_TOKEN" -E -v
is how we're kicking this off. The websocket url in question is awss://
and a bit long running (>60s) so it sends a message every 30s to let us know it's processing.Mac OSX output (with -E -v):
GitHub Action Runner using ubuntu-latest (with -E -v):
As you can see, when it works it Receives a
WebSocket close message
, saysReverse finished
and things end. But when does not work on ubuntu-latest it connects to ws, then after a bit saysForward finished
and ends the connection.This is how I'm installing
websocat
on theubunti-latest
:a line that checks
websocat --version
says it's running 1.12.0. Tried 1.11.0 as well with the same result.Watching the service that actually runs stuff, the connection is clearly getting through and kicking our process off. Even tried running this against something faster on the backend that returns a message to the websocket earlier than 30s. In both cases we get the same behavior - no messages sent to standard out beyond the -v logging messages.
Any ideas that could help would be greatly appreciated.