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

Docker + Portainer Agent script stopped working #1258

Open
1 of 2 tasks
burgerga opened this issue Jan 5, 2025 · 7 comments
Open
1 of 2 tasks

Docker + Portainer Agent script stopped working #1258

burgerga opened this issue Jan 5, 2025 · 7 comments

Comments

@burgerga
Copy link

burgerga commented Jan 5, 2025

βœ… Have you read and understood the above guidelines?

yes

πŸ“œ What is the name of the script you are using?

Docker

πŸ“‚ What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/docker.sh)"

πŸ“ Provide a clear and concise description of the issue.

Worked fine a couple of weeks ago (unsure how many weeks), fails with:

...
Would you like to add Portainer? <y/N> 
Would you like to add the Portainer Agent? <y/N> y
 β ΄ Installing Portainer agent 1.6.1 
[ERROR] in line 44: exit code 0: while executing command "$@" > /dev/null 2>&1

βš™οΈ What settings are you using?

  • Default Settings
  • Advanced Settings

πŸ–₯️ Which Linux distribution are you using?

Debian 12

πŸ”„ Steps to reproduce the issue.

  1. Run community script
  2. Answer no to install portainer
  3. Answer yes to install portainer-agent

❌ Paste the full error output (if available).

    ____             __            
   / __ \____  _____/ /_____  _____
  / / / / __ \/ ___/ //_/ _ \/ ___/
 / /_/ / /_/ / /__/ ,< /  __/ /    
/_____/\____/\___/_/|_|\___/_/     
                                   
  βš™οΈ  Using Default Settings on node pve
  πŸ–₯️  Operating System: debian
  🌟  Version: 12
  πŸ“¦  Container Type: Unprivileged
  πŸ’Ύ  Disk Size: 4GB
  🧠  CPU Cores: 2
  πŸ› οΈ  RAM Size: 2048MB
  πŸ†”  Container ID: 104
  πŸš€  Creating a Docker LXC using the above default settings
  
  βœ”οΈ  Using local for Template Storage.
  βœ”οΈ  Using local-lvm for Container Storage.
  βœ”οΈ  Updated LXC Template List
  βœ”οΈ  LXC Container 104 was successfully created.
  βœ”οΈ  Started LXC Container
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  βœ”οΈ  Set up Container OS
  βœ”οΈ  Network Connected: 192.168.2.196 
  βœ”οΈ  IPv4 Internet Connected
  βœ–οΈ  IPv6 Internet Not Connected
  βœ”οΈ  DNS Resolved github.com to 140.82.121.4
  βœ”οΈ  Updated Container OS
  βœ”οΈ  Installed Dependencies
  βœ”οΈ  Installed Docker v27.4.1
Would you like to add Portainer? <y/N> 
Would you like to add the Portainer Agent? <y/N> y
 β ΄ Installing Portainer agent 1.6.1 
[ERROR] in line 44: exit code 0: while executing command "$@" > /dev/null 2>&1

πŸ–ΌοΈ Additional context (optional).

No response

@burgerga
Copy link
Author

burgerga commented Jan 5, 2025

Full error (verbose mode):

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: unable to join session keyring: unable to create session key: disk quota exceeded: unknown.

This is not a script issue, but is an issue when running a large number of unprivileged LXCs. Can be solved by setting a larger number of maxkeys in the proxmox host, for example with echo "20000" > /proc/sys/kernel/keys/maxkeys. See https://discuss.linuxcontainers.org/t/error-with-docker-inside-lxc-container/922 for details.

@burgerga burgerga closed this as completed Jan 5, 2025
@cricalix
Copy link

cricalix commented Jan 5, 2025

This is not a script issue, but is an issue when running a large number of unprivileged LXCs. Can be solved by setting a larger number of maxkeys in the proxmox host, for example with echo "20000" > /proc/sys/kernel/keys/maxkeys. See https://discuss.linuxcontainers.org/t/error-with-docker-inside-lxc-container/922 for details.

Seems like something the scripting could do as a pre-flight check; it checks OS, usage as root, etcetera already. The default is 2000 (on my node at least, Proxmox 8), so you must have quite a few containers :)

@burgerga burgerga reopened this Jan 5, 2025
@burgerga
Copy link
Author

burgerga commented Jan 5, 2025

Yeah, that would probably be nice to check. And I have 40 LXCs, I didn't think that would be too many...

@cricalix
Copy link

cricalix commented Jan 5, 2025

This is not a script issue, but is an issue when running a large number of unprivileged LXCs. Can be solved by setting a larger number of maxkeys in the proxmox host, for example with echo "20000" > /proc/sys/kernel/keys/maxkeys. See https://discuss.linuxcontainers.org/t/error-with-docker-inside-lxc-container/922 for details.

Seems like something the scripting could do as a pre-flight check; it checks OS, usage as root, etcetera already. The default is 2000 (on my node at least, Proxmox 8), so you must have quite a few containers :)

Oh, here's why. Every container uses about 30 - sample size of two containers; one from ubuntu.sh, the other from docker.sh.

At 40 containers, you're using at minimum, 1200.

grep 100000: /proc/key-users (or cat /proc/key-users) would tell you how many you're using.

@cricalix
Copy link

cricalix commented Jan 5, 2025

Oh, here's why. Every container uses about 30 - sample size of two containers; one from ubuntu.sh, the other from docker.sh.

At 40 containers, you're using at minimum, 1200.

grep 100000: /proc/key-users (or cat /proc/key-users) would tell you how many you're using.

Though, alpine container only seems to use one key. So it's going to be a function of the base OS of the container. Regardless, it seems like something the scripting should do. Let me see what I can offer up as a PR.

@burgerga
Copy link
Author

burgerga commented Jan 5, 2025

Awesome!

And it also seems I needed to increase max-bytes :O

root@pve:~# grep 100000: /proc/key-users 
100000:  1017 1017/1017 1017/20000 19629/20000

@cricalix cricalix mentioned this issue Jan 5, 2025
7 tasks
@MickLesk
Copy link
Member

MickLesk commented Jan 6, 2025

Merged to "dev_maxkeys" for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants