Hello fellow LXC/LXD users!
Since only recently I experience the follow problem: when either adding a new proxy device to running container or when starting a container with proxy devices already attached it fails with following error messages.
First a brief description of my setup:
- Host OS: Ubuntu 18.04.5 LTS
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
$ lxc info
lxc info
config:
core.https_address: 123.123.123.12:8443
core.trust_password: true
api_extensions:
- storage_zfs_remove_snapshots
- container_host_shutdown_timeout
- container_stop_priority
- container_syscall_filtering
- auth_pki
- container_last_used_at
- etag
- patch
- usb_devices
- https_allowed_credentials
- image_compression_algorithm
- directory_manipulation
- container_cpu_time
- storage_zfs_use_refquota
- storage_lvm_mount_options
- network
- profile_usedby
- container_push
- container_exec_recording
- certificate_update
- container_exec_signal_handling
- gpu_devices
- container_image_properties
- migration_progress
- id_map
- network_firewall_filtering
- network_routes
- storage
- file_delete
- file_append
- network_dhcp_expiry
- storage_lvm_vg_rename
- storage_lvm_thinpool_rename
- network_vlan
- image_create_aliases
- container_stateless_copy
- container_only_migration
- storage_zfs_clone_copy
- unix_device_rename
- storage_lvm_use_thinpool
- storage_rsync_bwlimit
- network_vxlan_interface
- storage_btrfs_mount_options
- entity_description
- image_force_refresh
- storage_lvm_lv_resizing
- id_map_base
- file_symlinks
- container_push_target
- network_vlan_physical
- storage_images_delete
- container_edit_metadata
- container_snapshot_stateful_migration
- storage_driver_ceph
- storage_ceph_user_name
- resource_limits
- storage_volatile_initial_source
- storage_ceph_force_osd_reuse
- storage_block_filesystem_btrfs
- resources
- kernel_limits
- storage_api_volume_rename
- macaroon_authentication
- network_sriov
- console
- restrict_devlxd
- migration_pre_copy
- infiniband
- maas_network
- devlxd_events
- proxy
- network_dhcp_gateway
- file_get_symlink
- network_leases
- unix_device_hotplug
- storage_api_local_volume_handling
- operation_description
- clustering
- event_lifecycle
- storage_api_remote_volume_handling
- nvidia_runtime
- candid_authentication
- candid_config
- candid_config_key
- usb_optional_vendorid
api_status: stable
api_version: "1.0"
auth: trusted
public: false
auth_methods:
- tls
environment:
addresses:
- 123.123.123.12:8443
architectures:
- x86_64
- i686
certificate: |
-----BEGIN CERTIFICATE-----
(REDACTED)
-----END CERTIFICATE-----
certificate_fingerprint: fb96c36fa9943ecb90898f69c725be08d1f2c08195c0b9b4ac613b5aadc2add7
driver: lxc
driver_version: 3.0.3
kernel: Linux
kernel_architecture: x86_64
kernel_version: 4.15.0-139-generic
server: lxd
server_pid: 2465
server_version: 3.0.3
storage: btrfs
storage_version: 4.15.1
server_clustered: false
server_name: caroline
project: ""
$ lxc version
Client version: 3.0.3
Server version: 3.0.3
Steps to reproduce:
- Create new container
- Add proxy device listening on host port
$ lxc launch ubuntu:20.04 proxy-test
$ lxc config device add proxy-test http proxy listen=tcp:0.0.0.0:8000 connect=tcp:127.0.0.1:80 bind=host
Error: Error occurred when starting proxy device: Failed to run: /usr/lib/lxd/lxd forkproxy 2465 tcp:0.0.0.0:8000 24302 tcp:127.0.0.1:80 /var/log/lxd/proxy-test/proxy.http.log /var/lib/lxd/devices/proxy-test/proxy.http:
$ lxc info --show-log proxy-test
Name: proxy-test
Remote: unix://
Architecture: x86_64
Created: 2021/03/23 11:13 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 24302
Ips:
eth0: inet 10.73.42.161 veth70RX3J
eth0: inet6 fe80::216:3eff:fe22:bdff veth70RX3J
lo: inet 127.0.0.1
lo: inet6 ::1
Resources:
Processes: 62
CPU usage:
CPU usage (in seconds): 14
Memory usage:
Memory (current): 380.96MB
Memory (peak): 425.89MB
Network usage:
eth0:
Bytes received: 22.91kB
Bytes sent: 35.19kB
Packets received: 320
Packets sent: 544
lo:
Bytes received: 4.41kB
Bytes sent: 4.41kB
Packets received: 47
Packets sent: 47
Log:
lxc proxy-test 20210323111332.853 WARN conf - conf.c:lxc_setup_devpts:1616 - Invalid argument - Failed to unmount old devpts instance
$ sudo cat /var/log/lxd/proxy-test/proxy.http.log
Failed setns to container user namespace: Invalid argument
Broken pipe - Failed to send file descriptor
Error: Failed to send file descriptor via abstract unix socket
lxc config show proxy-test --expanded
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20210319)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: "20210319"
image.version: "18.04"
volatile.base_image: a1225cfdd3d11210f647fd457b610773c4e8f2304427c3b5283b639d7923c69f
volatile.eth0.hwaddr: 00:16:3e:39:fa:46
volatile.idmap.base: "0"
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.power: RUNNING
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""
I hope the information provided sufficient for someone debugging the problem, if not – please ask
Best regards
Constantin