Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Container connection delayed due to s6-rc: fatal: unable to take locks: Resource busy in v1.0.20210914-ls126 #290

Closed
1 task done
TheDragon44 opened this issue Jul 31, 2023 · 11 comments

Comments

@TheDragon44
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Updated Wireguard container today and getting the above message in the container logs on startup.

I have a script which checks the IP before other containers depending on wireguard startup - those which have network_mode set to service:wireguard

It showed the VPN IP on first check wasn't present, the script then shutdown the depending containers.

By the time I could exec into the wireguard container itself and check the IP by hand it had connected to the expected VPN IP.

I rolled back the WG container to these two versions to check, and these don't show this error in the container logs on startup, and don't have a delay in getting the VPN IP.

v1.0.20210914-ls124
v1.0.20210914-ls125

Expected Behavior

No delay in the container connecting on startup

Steps To Reproduce

Create container with this version

v1.0.20210914-ls126

Environment

Debian 11 using docker-compose from dockers repo

CPU architecture

x86-64

Docker creation

---
version: "3.8"

services:
  wireguard:
    image: lscr.io/linuxserver/wireguard:v1.0.20210914-ls126
    container_name: wireguard
    cap_add:
      - NET_ADMIN
#      - SYS_MODULE
    environment:
      - PUID=104444
      - PGID=104444
      - TZ=Europe/London
    volumes:
      - /mnt/wireguard:/config:rw
      # - /lib/modules:/lib/modules #optional
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1 #needed for client mode
      - net.ipv6.conf.all.disable_ipv6=1
    restart: unless-stopped

Container logs

wireguard  | 2023-07-31T14:14:00.798143288+01:00 [INFO] SIGTERM: Shutting down servers then terminating
wireguard  | 2023-07-31T14:15:39.116829362+01:00 [migrations] started
wireguard  | 2023-07-31T14:15:39.117067180+01:00 [migrations] no migrations found
wireguard  | 2023-07-31T14:15:39.129076294+01:00 usermod: no changes
wireguard  | 2023-07-31T14:15:39.130534405+01:00 ───────────────────────────────────────
wireguard  | 2023-07-31T14:15:39.130555332+01:00 
wireguard  | 2023-07-31T14:15:39.130561082+01:00       ██╗     ███████╗██╗ ██████╗ 
wireguard  | 2023-07-31T14:15:39.130565879+01:00       ██║     ██╔════╝██║██╔═══██╗
wireguard  | 2023-07-31T14:15:39.130569438+01:00       ██║     ███████╗██║██║   ██║
wireguard  | 2023-07-31T14:15:39.130572886+01:00       ██║     ╚════██║██║██║   ██║
wireguard  | 2023-07-31T14:15:39.130576756+01:00       ███████╗███████║██║╚██████╔╝
wireguard  | 2023-07-31T14:15:39.130580757+01:00       ╚══════╝╚══════╝╚═╝ ╚═════╝ 
wireguard  | 2023-07-31T14:15:39.130584427+01:00 
wireguard  | 2023-07-31T14:15:39.130587856+01:00    Brought to you by linuxserver.io
wireguard  | 2023-07-31T14:15:39.130591786+01:00 ───────────────────────────────────────
wireguard  | 2023-07-31T14:15:39.130667863+01:00 
wireguard  | 2023-07-31T14:15:39.130674396+01:00 To support the app dev(s) visit:
wireguard  | 2023-07-31T14:15:39.132065238+01:00 WireGuard: https://www.wireguard.com/donations/
wireguard  | 2023-07-31T14:15:39.132284671+01:00 
wireguard  | 2023-07-31T14:15:39.132291035+01:00 To support LSIO projects visit:
wireguard  | 2023-07-31T14:15:39.132295320+01:00 https://www.linuxserver.io/donate/
wireguard  | 2023-07-31T14:15:39.132299274+01:00 
wireguard  | 2023-07-31T14:15:39.132302591+01:00 ───────────────────────────────────────
wireguard  | 2023-07-31T14:15:39.132306428+01:00 GID/UID
wireguard  | 2023-07-31T14:15:39.132310726+01:00 ───────────────────────────────────────
wireguard  | 2023-07-31T14:15:39.135963523+01:00 
wireguard  | 2023-07-31T14:15:39.135974966+01:00 User UID:    104444
wireguard  | 2023-07-31T14:15:39.135979336+01:00 User GID:    104444
wireguard  | 2023-07-31T14:15:39.135983126+01:00 ───────────────────────────────────────
wireguard  | 2023-07-31T14:15:39.135986959+01:00 
wireguard  | 2023-07-31T14:15:39.162166176+01:00 Uname info: Linux 97cd082d12b8 5.10.0-0.deb10.23-rt-amd64 #1 SMP PREEMPT_RT Debian 5.10.179-1~deb10u1 (2023-05-26) x86_64 GNU/Linux
wireguard  | 2023-07-31T14:15:39.199933131+01:00 **** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****
wireguard  | 2023-07-31T14:15:39.470353180+01:00 **** Client mode selected. ****
wireguard  | 2023-07-31T14:15:39.495920123+01:00 [custom-init] No custom files found, skipping...
wireguard  | 2023-07-31T14:15:39.600468400+01:00 .:53
wireguard  | 2023-07-31T14:15:39.600486492+01:00 CoreDNS-1.10.1
wireguard  | 2023-07-31T14:15:39.600489330+01:00 linux/amd64, go1.20.4, 
wireguard  | 2023-07-31T14:15:40.682698141+01:00 [#] ip link add wg0 type wireguard
wireguard  | 2023-07-31T14:15:40.685223636+01:00 [#] wg setconf wg0 /dev/fd/63
wireguard  | 2023-07-31T14:15:40.718898844+01:00 [#] ip -4 address add x.x.x.x.x dev wg0
wireguard  | 2023-07-31T14:15:40.725098142+01:00 [#] ip link set mtu 1420 up dev wg0
wireguard  | 2023-07-31T14:15:40.768001544+01:00 [#] resolvconf -a wg0 -m 0 -x
wireguard  | 2023-07-31T14:15:40.790084708+01:00 s6-rc: fatal: unable to take locks: Resource busy
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@aptalca
Copy link
Member

aptalca commented Jul 31, 2023

There is a PR upstream to fix this: NetworkConfiguration/openresolv#23

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@Trigus42
Copy link

Trigus42 commented Sep 2, 2023

I have the same issue:

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
WireGuard: https://www.wireguard.com/donations/

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────

Uname info: Linux 7370557647c0 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
**** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****
**** As the wireguard module is already active you can remove the SYS_MODULE capability from your container run/compose. ****
**** Client mode selected. ****
[custom-init] No custom files found, skipping...
**** Disabling CoreDNS ****
Warning: `/config/wg0.conf' is world accessible
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add xxx.xxx.xxx.xxx/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
s6-rc: fatal: unable to take locks: Resource busy
[#] wg set wg0 fwmark 51820
[#] ip -6 route add ::/0 dev wg0 table 51820
Error: IPv6 is disabled on nexthop device.
[#] resolvconf -d wg0 -f
s6-rc: fatal: unable to take locks: Resource busy
[#] ip link delete dev wg0
s6-rc: warning: unable to start service svc-wireguard: command exited 2

@thespad
Copy link
Member

thespad commented Sep 2, 2023

You don't, your issue is

Error: IPv6 is disabled on nexthop device.

@Trigus42
Copy link

Trigus42 commented Sep 2, 2023

Yeah sry I overlooked that. But I still get the error s6-rc: fatal: unable to take locks: Resource busy

@thespad
Copy link
Member

thespad commented Sep 2, 2023

You will, it's an upstream bug with resolvconf that doesn't play nicely with containers, but it doesn't cause any issues other than the messages.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@MrCaringi
Copy link

I have the same issue with last version (arm)

@phamduchongan93
Copy link

This issue still exist on Ubuntu 20.04 lts. I tested the non docker wireguard version and the config wg0.conf work fine. However when mount and run on docker environment the issue appear the same as previous user encounter. As side note, my mullavad vpn provider recommends to apt install openresolv prior launching interface.

@aptalca
Copy link
Member

aptalca commented Oct 8, 2023

Closing this thread due to the irrelevant me too reports

If you're getting the message s6-rc: fatal: unable to take locks: Resource busy, you can safely ignore it. It is a harmless error message due to an erroneous feature added in the upstream openresolv in its later versions. There is an open PR (linked above) to fix it. It is pending maintainer review.

@aptalca aptalca closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

7 participants