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
When I use wscat -c wss://socket.domain.tld/api --auth someuser:somepassword it works perfectly as long as I keep the program on the foreground. But as soon as I try to background it either using nohup or & the wscat crashes. How can I fix this?
The error that I'm getting is this one:
events.js:174
throw er; // Unhandled 'error' event
^
Error: EBADF: bad file descriptor, read
Emitted 'error' event at:
at lazyFs.read (internal/fs/streams.js:165:12)
at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17)
The text was updated successfully, but these errors were encountered:
I'm currently encountering an issue with the execution of a Bash script within a GitHub workflow. The script is intended to make a WebSocket request using wscat. Here's the relevant snippet of the script:
#!/bin/bash
# Function to run WebSocket request
function runWebSocketTest() {
local alert=$1
local url="wss://localhost/api/core/v1/alerts/incoming?api_key=${API_KEY}"
wscat --no-check -c "$url" -x "$alert"
}
function getTriggeredAlertsCount() {
local count=$(docker exec postgres-1 psql -U test -d testdb -t -c "SELECT COUNT(*) FROM public.alerts;")
echo "$count"
}
runWebSocketTest "$ALERT_1"
runWebSocketTest "$ALERT_1"
count=$(getTriggeredAlertsCount)
echo "Triggered alerts count: $count"
When I run this script manually on the GitHub runner, the wscat command executes properly and inserts an alert into the database. However, when the same script is executed from the GitHub workflow, it seems that the wscat command does not execute, resulting in no data being inserted into the database.
Upon investigation, it appears that the GitHub workflow runs this script in the background, potentially causing the wscat command not to execute as expected.
I would appreciate any suggestions or insights on how to resolve this issue.
When I use wscat -c wss://socket.domain.tld/api --auth someuser:somepassword it works perfectly as long as I keep the program on the foreground. But as soon as I try to background it either using nohup or & the wscat crashes. How can I fix this?
The error that I'm getting is this one:
The text was updated successfully, but these errors were encountered: