Reconnecting to container exec hostAccess socket

I’m attempting to execute long-running commands using the container execute API and also use it’s returned websocket for reading stdout/stderr output.

I’m trying to run backup scripts this way since some services (gitlab) and also some lesser known databases require you to run the script from within the container running the service/database itself which means that container exec is my only option here (a separate start-once service connecting to the service/db over the network and running commands is not an option)

Now; all is good until the connection is lost (timeout, lost internet connection, earthquake, you name it).
When I try to reconnect to the still running command to read it’s output I can’t find a way of doing that without also executing the command again. (Not really a good thing to do when database backup is already in progress)

Is there a way to reconnect to the hostAccess websocket from the container exec call without also running the command again?

Nope… Consider writing the output to a file/fifo and then copying that file out on completion.

That’s essentially what implementing reconnect would have to do, buffer unbounded output for unbounded time in the hopes that the client eventually comes back.

Got it, thanks!
I also guess there aren’t any endpoints I could use to see a list of all the ongoing processess that are currently being executed by rancher?

FYI; I replied to the email notification I got but it seems like that never reached back to the forum?