Hello,
The exec command by websocket stop working after some release.
Now I am getting:
error: Unexpected server response: 404
And in lxc monitor output:
location: none
metadata:
context: {}
level: debug
message: 'Failure for websocket operation: 43bde241-c9d0-4e47-ba87-ce1a3a4944c9:
Timed out waiting for websockets to connect'
timestamp: "2022-04-28T16:34:52.723720455+02:00"
type: logging
location: none
metadata:
class: websocket
created_at: "2022-04-28T16:34:47.721001378+02:00"
description: Executing command
err: Timed out waiting for websockets to connect
id: 43bde241-c9d0-4e47-ba87-ce1a3a4944c9
location: none
may_cancel: false
metadata:
command:
- top
environment:
FOO: BAR
LANG: C.UTF-8
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
fds:
"0": f5da36ad2297e4fdb24f48fedbdee28c02286dde571c79dff5ad66f66623572a
control: cbf91f3612a116ae7863e5eeb4fdd6fac3a173deeb48245e113928dbe7473a34
interactive: true
resources:
containers:
- /1.0/containers/login
instances:
- /1.0/instances/login
status: Failure
status_code: 400
updated_at: "2022-04-28T16:34:47.721001378+02:00"
project: default
timestamp: "2022-04-28T16:34:52.724471782+02:00"
type: operation
It was working before by this test commands:
lxc query -X POST -d '{"command":["top"],"environment":{"HOME": "/root", "TERM": "xterm", "USER": "root"},"interactive":true,"wait-for-websocket":true}' /1.0/containers/login/exec
wscat -c wss://127.0.0.1:8443/1.0/operations/[ id ]/websocket?secret=[ metadata-fds-0 ] -n
How can I connect to the websocket from wscat or from javascript code? Any suggestions?