This page looks best with JavaScript enabled

Problems Using the obsutil Command in Containers

 ·  ☕ 1 min read

1. The container’s ulimit is set too low

Error message:

1
2
3
4
5
6
7
CheckpointDir: /root/.obsutil_checkpoint
OutputDir: /root/.obsutil_output

runtime: mlock of signal stack failed: 12
runtime: increase the mlock limit (ulimit -l) or
runtime: update your kernel to 5.3.15+, 5.4.2+, or 5.5+
fatal error: mlock failed
  • Under Docker, you can add the ulimit parameter at startup
1
docker run -it --ulimit memlock=-1 ...
  • Under Kubernetes, the Pod needs to be started in privileged mode
1
2
3
      securityContext:
        privileged: true
        runAsUser: 0

Add the snippet above to the yaml configuration, then add ulimit -c unlimited to the startup script to change the ulimit.

2. Credentials mounted read-only cannot be used

Error message:

1
Error: open /root/.obsutilconfig: read-only file system

This happens because .obsutilconfig credentials are mounted into the container with read-only permissions, while the obsutil command needs write access to the credentials.

So the credentials need to be read and regenerated when the container starts.

1
2
cat /root/.obsutilconfig1 > /root/.obsutilconfig
ulimit -c unlimited

WeChat Official Account
WRITTEN BY
WeChat Official Account