Can not start bash on a container

Hi i have launched a new container its running but i can not execute bash in the container. getting below error. w1 is my container name

lxc exec w1 bash

Error: TIOCGPTPEER required but not available

What LXD version on what distro from what kind of package?

I am running on lxd via snap and my lxd version is 4.7
driver: lxc
driver_version: 4.0.5
firewall: xtables
kernel: Linux
kernel_architecture: x86_64
kernel_features:
netnsid_getifaddrs: “false”
seccomp_listener: “false”
seccomp_listener_continue: “false”
shiftfs: “false”
uevent_injection: “false”
unpriv_fscaps: “false”
kernel_version: 4.9.0-12-amd64
lxc_features:
cgroup2: “true”
devpts_fd: “true”
mount_injection_file: “true”
network_gateway_device_route: “true”
network_ipvlan: “true”
network_l2proxy: “true”
network_phys_macvlan_mtu: “true”
network_veth_router: “true”
pidfd: “true”
seccomp_allow_deny_syntax: “true”
seccomp_notify: “true”
seccomp_proxy_send_notify_fd: “true”
os_name: Debian GNU/Linux
os_version: “9”
project: default
server: lxd
server_clustered: false
server_name: dev-api
server_pid: 5566
server_version: “4.7”

Hello. I have the same problem with lxc. It has running state but I can’t get into bash with the same error message.
lxc info:

  • architectures:
    • x86_64
    • i686
  • driver: lxc
  • driver_version: 4.0.5
  • kernel: Linux
  • kernel_architecture: x86_64
  • kernel_version: 4.4.0-142-generic
  • os_name: Ubuntu
  • os_version: “16.04”
  • server: lxd
  • server_clustered: false
  • server_version: “4.7”

@aushakov does restarting the container help?

@brauner could 4.0.5 have changed this?

Confirmed and it’s easy enough to reproduce…

root@snap-debian-stretch:~# snap install lxd
lxd 4.7 from Canonical✓ installed
root@snap-debian-stretch:~# lxd init --auto
root@snap-debian-stretch:~# lxc launch images:alpine/edge a
Creating a
Starting a                                  
root@snap-debian-stretch:~# lxc exec a sh
Error: TIOCGPTPEER required but not available
root@snap-debian-stretch:~# uname -a
Linux snap-debian-stretch 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 GNU/Linux

@brauner we need this fixed ASAP

Actually this is coming from LXD in OpenPtyInDevpts, somehow the fallback case isn’t being hit.

Also annoyingly this wasn’t caught by our CI on Debian as it only hits the interactive case and we can’t do interactive testing non-interactively…

We’ll sort it out ASAP and cherry-pick the fix to the snap.

1 Like

The fix took a little while to land but is now in the stable snap.
snap refresh should fix things.

2 Likes

Thank you for fast response!

Thank You so much @stgraber

Hi
one more question i have , can we stop auto update of lxd or try something else. since me and my team did not done any update on our end and then issue occurred in my environment . Also i did not do any snap refresh or reinstalling of my lxd and surprisingly issue was fixed automatically without any intervention from my side.

Hi
one more question i have , can we stop auto update of lxd or try something else. since me and my team did not done any update on our end and then issue occurred in my environment . Also i did not do any snap refresh or reinstalling of my lxd and surprisingly issue was fixed automatically without any intervention from my side.

Please can you have a look at Managing the LXD snap as that covers some of the ways you can manage snap updates.

sure i will check it out thanks.