[lxc-users] Error: websocket: close 1006 (abnormal closure): unexpected EOF

Fajar A. Nugraha list at fajar.net
Fri Sep 20 03:23:00 UTC 2019


On Fri, Sep 20, 2019 at 4:14 AM Tomasz Chmielewski <mangoo at wpkg.org> wrote:
>
> Ubuntu 18.04, lxd installed from snap.
>
> Very often, a "lxc shell container" or "lxc exec container some-command"
> session gets interrupted with:
>
> Error: websocket: close 1006 (abnormal closure): unexpected EOF
>
>
> I suppose this happens when lxd snap gets auto-updated (i.e. today, from
> lxd ver 3.17, rev. 11964 to rev. 11985).
>
>
> This is quite annoying and leads to various errors, including data loss:
>
> - some long-running jobs within "lxc shell container" console get
> interrupted when this happens
>
> - script/jobs/builds running as "lxc exec container some-command" also
> get interrupted when this happens
>
>
> Is there a way to prevent this?

If you're asking "how to make your jobs run uninterrupted", AFAIK the
best way might be either:
- use ssh (with keys) to connect from the host, or
- wrap your jobs with something that can run in the background.

For example, using "screen" and "script", you can do something like
lxc exec my-container -- screen -dmS my-program-1 script -f
/path/to/my-program-1.log -c "/path/to/my-long-running-program.sh arg1
arg2"

you can attach to its session using "screen -r my-program-1" (e.g. in
case you need to interefere or type some input manually), and all
output will be logged in my-program-1.log


If you're asking 'how to keep "lxc exec session running when lxd is
restarted", then it's not possible.

If you're asking 'how to prevent snapd from auto-updating lxd", then
AFAIK there's no official way to do this permanently. It's unlikely it
will be implemented either, due to snap design. The closest hack you
can get is probably
https://discuss.linuxcontainers.org/t/disable-snap-auto-refresh-immediately/5333

You could probably also try
https://discuss.linuxcontainers.org/t/disable-snap-auto-refresh-immediately/5333/6
and use something like "snap install lxd --channel=3.17/stable". That
should at least lock you to lxd-3.17, limiting restarts to bug fix
only, and not automatically updating to 3.18+.

-- 
Fajar


More information about the lxc-users mailing list