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

Websocket Error #3121

Open
notmarshmllow opened this issue Jan 8, 2025 · 6 comments
Open

Websocket Error #3121

notmarshmllow opened this issue Jan 8, 2025 · 6 comments
Assignees
Labels

Comments

@notmarshmllow
Copy link

notmarshmllow commented Jan 8, 2025

While trying to host the Caldera v4.2.0 on my Ubuntu 22.04 Cloud Server, I am facing the following websocket error -

2025-01-08 16:17:40 - INFO  (app_svc.py:116 load) Enabled plugin: compass
2025-01-08 16:17:40 - INFO  (app_svc.py:116 load) Enabled plugin: atomic
2025-01-08 16:17:40 - INFO  (app_svc.py:116 load) Enabled plugin: fieldmanual
2025-01-08 16:17:40 - INFO  (app_svc.py:116 load) Enabled plugin: access
2025-01-08 16:17:41 - INFO  (app_svc.py:116 load) Enabled plugin: sandcat
2025-01-08 16:17:41 - INFO  (app_svc.py:116 load) Enabled plugin: response
2025-01-08 16:17:41 - INFO  (app_svc.py:116 load) Enabled plugin: training
2025-01-08 16:17:41 - INFO  (app_svc.py:116 load) Enabled plugin: stockpile
2025-01-08 16:17:41 - INFO  (app_svc.py:116 load) Enabled plugin: debrief
2025-01-08 16:17:41 - INFO  (app_svc.py:116 load) Enabled plugin: manx
2025-01-08 16:17:41 - INFO  (logging.py:92 log) Creating SSH listener on 0.0.0.0, port 8022
2025-01-08 16:17:41 - INFO  (server.py:741 start) serving on 0.0.0.0:2222
2025-01-08 16:17:54 - INFO  (hook.py:58 build_docs) Docs built successfully.
2025-01-08 16:17:54 - ERROR (event_svc.py:69 handle_exceptions) WebSocket error: received 1011 (internal error); then sent 1011 (internal error)
Traceback (most recent call last):
  File "/home/ubuntu/caldera/app/service/event_svc.py", line 65, in handle_exceptions
    return await awaitable
  File "/usr/local/lib/python3.10/dist-packages/websockets/asyncio/connection.py", line 458, in send
    async with self.send_context():
  File "/usr/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File "/usr/local/lib/python3.10/dist-packages/websockets/asyncio/connection.py", line 933, in send_context
    raise self.protocol.close_exc from original_exc
websockets.exceptions.ConnectionClosedError: received 1011 (internal error); then sent 1011 (internal error)
@elegantmoose
Copy link
Contributor

Unfortunately we have migrated to Caldera v5 and dont actively support v4.2.

FWIW, that error message is just about useless but looks like an upstream issue with a dependency. Check your websockets module version. We did have to update it at some point, currently we are pegged to 11.0.3. (https://github.com/mitre/caldera/blob/master/requirements.txt#L9C1-L9C19)

@elegantmoose
Copy link
Contributor

Update: Im seeing this on v5 too, although not affecting functionality (that I can see so far).

@clenk

@elegantmoose
Copy link
Contributor

According to docs [1], this would be caused by "poor network connectivity" or "too much traffic". As the websocket that is used in the event service (of Caldera) is all local message sending, Im inclined to think this is a websockets implementation bug. It seems the current fix all is to remove the keep alive/ping feature by disabling. I dont think this would cause issues in Caldera but I need @clenk to confirm.

https://websockets.readthedocs.io/en/stable/faq/common.html#what-does-connectionclosederror-sent-1011-internal-error-keepalive-ping-timeout-no-close-frame-received-mean

@elegantmoose
Copy link
Contributor

@notmarshmllow what websockets version are you using?

@notmarshmllow
Copy link
Author

I don't know which websocket version I am using. However, after working around I somehow managed to fix the issue last week. I can now run Caldera.

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

No branches or pull requests

2 participants