Docker:运行时/cgo:pthread_create失败:资源暂时不可用

yv5phkfx  于 2023-02-11  发布在  Docker
关注(0)|答案(4)|浏览(1344)

我写了一个docker-compose.yml,它在我的本地ubuntu18.04系统上运行。我在我的ubuntu18.04 lts服务器上运行了同样的yml,并在标题中得到了错误消息。我试图增加进程的TasksMax,但它不起作用。我还在/etc/systemd/system.conf中设置了DefaultTasksMax = infinity。
一些产出:
systemctl show-p任务最大Docker:
任务最大值=无穷大
系统状态对接器|grep任务:

└─50-TasksMax.conf  (This line is not showing up on my local 
                     machine)
Tasks: 53

这是导致我的点,我仍然没有使配置正确。
以下是执行docker-compose up-d时的Docker输出:

ERROR: for wordpress-cert  Cannot start service wordpress-cert: b'OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \\"process_linux.go:413: running prestart hook 0 caused \\\\\\"error running hook: exit status 2, stdout: , stderr: runtime/cgo: pthread_create failed: Resource temporarily unavailable\\\\\\\\nSIGABRT: abort\\\\\\\\nPC=0x7f5cd5db7e97 m=0 sigcode=18446744073709551610\\\\\\\\n\\\\\\\\ngoroutine 0 [idle]:\\\\\\\\nruntime: unknown pc 0x7f5cd5db7e97\\\\\\\\nstack: frame={sp:0x7ffe59e1f6c0, fp:0x0} stack=[0x7ffe59620d50,0x7ffe59e1fd80)\\\\\\\\n00007ffe59e1f5c0:  [...] ffffffffffffffff  ffffffffffffffff \\\\\\\\nruntime: unknown pc 0x7f5cd5db7e97\\\\\\\\nstack: frame={sp:0x7ffe59e1f6c0, fp:0x0} stack=[0x7ffe59620d50,0x7ffe59e1fd80)\\\\\\\\n00007ffe59e1f5c0:  [...] ffffffffffffffff  ffffffffffffffff \\\\\\\\n\\\\\\\\ngoroutine 1 [runnable, locked to thread]:\\\\\\\\ngithub.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).Register(0xc0005e3b00, 0x55922583c640, 0xc000760b90, 0x0, 0x0)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus/registry.go:298 +0x1e6\\\\\\\\ngithub.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0xc0005e3b00, 0xc00075d000, 0x1, 0x1)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus/registry.go:403 +0x78\\\\\\\\ngithub.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus.MustRegister(...)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus/registry.go:152\\\\\\\\ngithub.com/docker/docker/vendor/github.com/docker/go-metrics.Register(...)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/docker/go-metrics/register.go:8\\\\\\\\ngithub.com/docker/docker/builder/dockerfile.init.0()\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/builder/dockerfile/metrics.go:43 +0x2d3\\\\\\\\n\\\\\\\\ngoroutine 20 [syscall]:\\\\\\\\nos/signal.signal_recv(0x559222e8e556)\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/sigqueue.go:139 +0x9e\\\\\\\\nos/signal.loop()\\\\\\\\n\\\\\\\\t/usr/local/go/src/os/signal/signal_unix.go:23 +0x24\\\\\\\\ncreated by os/signal.init.0\\\\\\\\n\\\\\\\\t/usr/local/go/src/os/signal/signal_unix.go:29 +0x43\\\\\\\\n\\\\\\\\nrax    0x0\\\\\\\\nrbx    0x7f5cd6165840\\\\\\\\nrcx    0xffffffffffffffff\\\\\\\\nrdx    0x0\\\\\\\\nrdi    0x2\\\\\\\\nrsi    0x7ffe59e1f6c0\\\\\\\\nrbp    0x559224b7603d\\\\\\\\nrsp    0x7ffe59e1f6c0\\\\\\\\nr8     0x0\\\\\\\\nr9     0x7ffe59e1f6c0\\\\\\\\nr10    0x8\\\\\\\\nr11    0x246\\\\\\\\nr12    0x5592271bd1f0\\\\\\\\nr13    0x11\\\\\\\\nr14    0x559224b1c640\\\\\\\\nr15    0x0\\\\\\\\nrip    0x7f5cd5db7Creating nextcloud-cert             ... error
unknown'

ERROR: for nextcloud-cert  Cannot start service nextcloud-cert: b'OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \\"process_linux.go:413: running prestart hook 0 caused \\\\\\"error running hook: exit status 2, stdout: , stderr: runtime/cgo: pthread_create failed: Resource temporarily unavailable\\\\\\\\nSIGABRT: abort\\\\\\\\nPC=0x7f2376cbce97 m=0 sigcode=18446744073709551610\\\\\\\\n\\\\\\\\ngoroutine 0 [idle]:\\\\\\\\nruntime: unknown pc 0x7f2376cbce97\\\\\\\\nstack: frame={sp:0x7fff898f4ad0, fp:0x0} stack=[0x7fff890f6070,0x7fff898f50a0)\\\\\\\\n00007fff898f49d0:  [...] 00007fff898f4b40  0000564eca7254a3 <runtime.persistentalloc1+515> [...] \\\\\\\\nruntime: unknown pc 0x7f2376cbce97\\\\\\\\nstack: frame={sp:0x7fff898f4ad0, fp:0x0} stack=[0x7fff890f6070,0x7fff898f50a0)\\\\\\\\n00007fff898f49d0:  [...] \\\\\\\\n\\\\\\\\ngoroutine 1 [running]:\\\\\\\\nruntime.systemstack_switch()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:311 fp=0xc00006e798 sp=0xc00006e790 pc=0x564eca774450\\\\\\\\nruntime.main()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/proc.go:130 +0x67 fp=0xc00006e7e0 sp=0xc00006e798 pc=0x564eca747cd7\\\\\\\\nruntime.goexit()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc00006e7e8 sp=0xc00006e7e0 pc=0x564eca776551\\\\\\\\n\\\\\\\\nrax    0x0\\\\\\\\nrbx    0x7f237706a840\\\\\\\\nrcx    0xffffffffffffffff\\\Creating wordpress-it-mueller      ... error
rsp    0x7fff898f4ad0\\\\\\\\nr8     0x0\\\\\\\\nr9     0x7fff898f4ad0\\\\\\\\nr10    0x8\\\\\\\\nr11    0x246\\\\\\\\nr12    0x564ed04ff990\\\\\\\\nr13    0x11\\\\\\\\nr14    0x564ecc404640\\\\\\\\nr15    0x0\\\\\\\\nrip    0x7f2376cbce97\\\\\\\\nrflags 0x246\\\\\\\\ncs     0x33\\\\\\\\nfs     0x0\\\\\\\\ngs  Creating wordpress-cert-it-mueller ... done

ERROR: for wordpress-it-mueller  Cannot start service wordpress-it-mueller: b'OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \\"process_linux.go:413: running prestart hook 0 caused \\\\\\"error running hook: exit status 2, stdout: , stderr: runtime/cgo: pthread_create failed: Resource temporarily unavailable\\\\\\\\nSIGABRT: abort\\\\\\\\nPC=0x7f3d844b2e97 m=0 sigcode=18446744073709551610\\\\\\\\n\\\\\\\\ngoroutine 0 [idle]:\\\\\\\\nruntime: unknown pc 0x7f3d844b2e97\\\\\\\\nstack: frame={sp:0x7ffeff965720, fp:0x0} stack=[0x7ffeff166cc0,0x7ffeff965cf0)\\\\\\\\n00007ffeff965620:  [...] ffffffffffffffff  ffffffffffffffff \\\\\\\\nruntime: unknown pc 0x7f3d844b2e97\\\\\\\\nstack: frame={sp:0x7ffeff965720, fp:0x0} stack=[0x7ffeff166cc0,0x7ffeff965cf0)\\\\\\\\n00007ffeff965620:   [...] ffffffffffffffff  ffffffffffffffff \\\\\\\\n\\\\\\\\ngoroutine 1 [running]:\\\\\\\\nruntime.systemstack_switch()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:311 fp=0xc00006e798 sp=0xc00006e790 pc=0x55a7e9792450\\\\\\\\nruntime.main()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/proc.go:130 +0x67 fp=0xc00006e7e0 sp=0xc00006e798 pc=0x55a7e9765cd7\\\\\\\\nruntime.goexit()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc00006e7e8 sp=0xc00006e7e0 pc=0x55a7e9794551\\\\\\\\n\\\\\\\\nrax    0x0\\\\\\\\nrbx    0x7f3d84860840\\\\\\\\nrcx    0xffffffffffffffff\\\\\\\\nrdx    0x0\\\\\\\\nrdi    0x2\\\\\\\\nrsi    0x7ffeff965720\\\\\\\\nrbp    0x55a7eb47c03d\\\\\\\\nrsp    0x7ffeff965720\\\\\\\\nr8     0x0\\\\\\\\Creating nextcloud                  ... done
    0x11\\\\\\\\nr14    0x55a7eb422640\\\\\\\\nr15    0x0\\\\\\\\nrip    0x7f3d844b2e97\\\\\\\\nrflags 0x246\\\\\\\\ncs     0x33\\\\\\\\nfs     0x0\\\\\\\\ngs     0x0\\\\\\\\n\\\\\\"\\"": unknown'

ERROR: for wordpress-cert  Cannot start service wordpress-cert: b'OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \\"process_linux.go:413: running prestart hook 0 caused \\\\\\"error running hook: exit status 2, stdout: , stderr: runtime/cgo: pthread_create failed: Resource temporarily unavailable\\\\\\\\nSIGABRT: abort\\\\\\\\nPC=0x7f5cd5db7e97 m=0 sigcode=18446744073709551610\\\\\\\\n\\\\\\\\ngoroutine 0 [idle]:\\\\\\\\nruntime: unknown pc 0x7f5cd5db7e97\\\\\\\\nstack: frame={sp:0x7ffe59e1f6c0, fp:0x0} stack=[0x7ffe59620d50,0x7ffe59e1fd80)\\\\\\\\n00007ffe59e1f5c0:  [...] ffffffffffffffff  ffffffffffffffff \\\\\\\\nruntime: unknown pc 0x7f5cd5db7e97\\\\\\\\nstack: frame={sp:0x7ffe59e1f6c0, fp:0x0} stack=[0x7ffe59620d50,0x7ffe59e1fd80)\\\\\\\\n00007ffe59e1f5c0:  [...]ffffffffffffffff  ffffffffffffffff \\\\\\\\n\\\\\\\\ngoroutine 1 [runnable, locked to thread]:\\\\\\\\ngithub.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).Register(0xc0005e3b00, 0x55922583c640, 0xc000760b90, 0x0, 0x0)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus/registry.go:298 +0x1e6\\\\\\\\ngithub.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0xc0005e3b00, 0xc00075d000, 0x1, 0x1)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus/registry.go:403 +0x78\\\\\\\\ngithub.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus.MustRegister(...)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/prometheus/client_golang/prometheus/registry.go:152\\\\\\\\ngithub.com/docker/docker/vendor/github.com/docker/go-metrics.Register(...)\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/vendor/github.com/docker/go-metrics/register.go:8\\\\\\\\ngithub.com/docker/docker/builder/dockerfile.init.0()\\\\\\\\n\\\\\\\\t/go/src/github.com/docker/docker/builder/dockerfile/metrics.go:43 +0x2d3\\\\\\\\n\\\\\\\\ngoroutine 20 [syscall]:\\\\\\\\nos/signal.signal_recv(0x559222e8e556)\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/sigqueue.go:139 +0x9e\\\\\\\\nos/signal.loop()\\\\\\\\n\\\\\\\\t/usr/local/go/src/os/signal/signal_unix.go:23 +0x24\\\\\\\\ncreated by os/signal.init.0\\\\\\\\n\\\\\\\\t/usr/local/go/src/os/signal/signal_unix.go:29 +0x43\\\\\\\\n\\\\\\\\nrax    0x0\\\\\\\\nrbx    0x7f5cd6165840\\\\\\\\nrcx    0xffffffffffffffff\\\\\\\\nrdx    0x0\\\\\\\\nrdi    0x2\\\\\\\\nrsi    0x7ffe59e1f6c0\\\\\\\\nrbp    0x559224b7603d\\\\\\\\nrsp    0x7ffe59e1f6c0\\\\\\\\nr8     0x0\\\\\\\\nr9     0x7ffe59e1f6c0\\\\\\\\nr10    0x8\\\\\\\\nr11    0x246\\\\\\\\nr12    0x5592271bd1f0\\\\\\\\nr13    0x11\\\\\\\\nr14    0x559224b1c640\\\\\\\\nr15    0x0\\\\\\\\nrip    0x7f5cd5db7e97\\\\\\\\nrflags 0x246\\\\\\\\ncs     0x33\\\\\\\\nfs     0x0\\\\\\\\ngs     0x0\\\\\\\\n\\\\\\"\\"": unknown'

ERROR: for nextcloud-cert  Cannot start service nextcloud-cert: b'OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \\"process_linux.go:413: running prestart hook 0 caused \\\\\\"error running hook: exit status 2, stdout: , stderr: runtime/cgo: pthread_create failed: Resource temporarily unavailable\\\\\\\\nSIGABRT: abort\\\\\\\\nPC=0x7f2376cbce97 m=0 sigcode=18446744073709551610\\\\\\\\n\\\\\\\\ngoroutine 0 [idle]:\\\\\\\\nruntime: unknown pc 0x7f2376cbce97\\\\\\\\nstack: frame={sp:0x7fff898f4ad0, fp:0x0} stack=[0x7fff890f6070,0x7fff898f50a0)\\\\\\\\n00007fff898f49d0:  [...]00007fff898f4ae8  00000000ffffffff \\\\\\\\n00007fff898f4af0:  00007fff898f4b40  0000564eca7254a3 <runtime.persistentalloc1+515> \\\\\\\\n00007fff898f4b00:  0000564ece51d0f0  0000000000000000 [...] \\\\\\\\nruntime: unknown pc 0x7f2376cbce97\\\\\\\\nstack: frame={sp:0x7fff898f4ad0, fp:0x0} stack=[0x7fff890f6070,0x7fff898f50a0)\\\\\\\\n00007fff898f49d0:  [...] 00007fff898f4ae8  00000000ffffffff \\\\\\\\n00007fff898f4af0:  00007fff898f4b40  0000564eca7254a3 <runtime.persistentalloc1+515> \\\\\\\\n00007fff898f4b00:  0000564ece51d0f0  0000000000000000 [...] \\\\\\\\n\\\\\\\\ngoroutine 1 [running]:\\\\\\\\nruntime.systemstack_switch()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:311 fp=0xc00006e798 sp=0xc00006e790 pc=0x564eca774450\\\\\\\\nruntime.main()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/proc.go:130 +0x67 fp=0xc00006e7e0 sp=0xc00006e798 pc=0x564eca747cd7\\\\\\\\nruntime.goexit()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc00006e7e8 sp=0xc00006e7e0 pc=0x564eca776551\\\\\\\\n\\\\\\\\nrax    0x0\\\\\\\\nrbx    0x7f237706a840\\\\\\\\nrcx    0xffffffffffffffff\\\\\\\\nrdx    0x0\\\\\\\\nrdi    0x2\\\\\\\\nrsi    0x7fff898f4ad0\\\\\\\\nrbp    0x564ecc45e03d\\\\\\\\nrsp    0x7fff898f4ad0\\\\\\\\nr8     [...]  0x0\\\\\\\\ngs     0x0\\\\\\\\n\\\\\\"\\"": unknown'

ERROR: for wordpress-it-mueller  Cannot start service wordpress-it-mueller: b'OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \\"process_linux.go:413: running prestart hook 0 caused \\\\\\"error running hook: exit status 2, stdout: , stderr: runtime/cgo: pthread_create failed: Resource temporarily unavailable\\\\\\\\nSIGABRT: abort\\\\\\\\nPC=0x7f3d844b2e97 m=0 sigcode=18446744073709551610\\\\\\\\n\\\\\\\\ngoroutine 0 [idle]:\\\\\\\\nruntime: unknown pc 0x7f3d844b2e97\\\\\\\\nstack: frame={sp:0x7ffeff965720, fp:0x0} stack=[0x7ffeff166cc0,0x7ffeff965cf0)\\\\\\\\n00007ffeff965620:[...] ffffffffffffffff  ffffffffffffffff \\\\\\\\nruntime: unknown pc 0x7f3d844b2e97\\\\\\\\nstack: frame={sp:0x7ffeff965720, fp:0x0} stack=[0x7ffeff166cc0,0x7ffeff965cf0)\\\\\\\\n00007ffeff965620:  [...] ffffffffffffffff  ffffffffffffffff \\\\\\\\n\\\\\\\\ngoroutine 1 [running]:\\\\\\\\nruntime.systemstack_switch()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:311 fp=0xc00006e798 sp=0xc00006e790 pc=0x55a7e9792450\\\\\\\\nruntime.main()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/proc.go:130 +0x67 fp=0xc00006e7e0 sp=0xc00006e798 pc=0x55a7e9765cd7\\\\\\\\nruntime.goexit()\\\\\\\\n\\\\\\\\t/usr/local/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc00006e7e8 sp=0xc00006e7e0 pc=0x55a7e9794551\\\\\\\\n\\\\\\\\nrax    0x0\\\\\\\\nrbx    0x7f3d84860840\\\\\\\\nrcx    0xffffffffffffffff\\\\\\\\nrdx    0x0\\\\\\\\nrdi    0x2\\\\\\\\nrsi    0x7ffeff965720\\\\\\\\nrbp    0x55a7eb47c03d\\\\\\\\nrsp    0x7ffeff965720\\\\\\\\nr8     0x0\\\\\\\\nr9     0x7ffeff965720\\\\\\\\nr10    0x8\\\\\\\\nr11    0x246\\\\\\\\nr12    0x55a7ee582990\\\\\\\\nr13    0x11\\\\\\\\nr14    0x55a7eb422640\\\\\\\\nr15    0x0\\\\\\\\nrip    0x7f3d844b2e97\\\\\\\\nrflags 0x246\\\\\\\\ncs     0x33\\\\\\\\nfs     0x0\\\\\\\\ngs     0x0\\\\\\\\n\\\\\\"\\"": unknown'
ERROR: Encountered errors while bringing up the project.

任何我可能做错的想法都非常感谢!

bqujaahr

bqujaahr1#

我在strato的v-server上也遇到了这个问题。看起来他们取消了硬限制,现在允许更改任务限制:https://www.strato.de/faq/server/prozesse-vs-threads-bei-linux-v-servern/
为了解决这个错误,我只是在/etc/systemd/system.conf中添加了以下行并重新启动

DefaultTasksMax=1000
pgky5nke

pgky5nke2#

问题是服务器提供商Strato对他们的虚拟服务器有一个硬性的进程限制。我配置正确,但我没有想到会有这样的限制。它花了我这么多时间...你不应该对你的提供商廉价,我已经吸取了教训。

qybjjes1

qybjjes13#

一个解决方案:
注解和修改:
/etc/systemd/登录. conf用户任务最大值
然后:
sudo systemctl守护进程-重新加载
sudo systemctl守护进程-重新执行
sudo服务systemd-登录重新启动

vjrehmav

vjrehmav4#

我有同样的问题与grafana代理,我已经添加了security_opt选项来解决它:

version: "3"
services:
  agent:
    image: grafana/agent:latest
    security_opt:
      - seccomp:unconfined
    volumes:
      - ./agent/config:/etc/agent-config
    entrypoint:
      - /bin/agent
      - -config.file=/etc/agent-config/agent.yaml
      - -metrics.wal-directory=/tmp/agent/wal
      - -enable-features=integrations-next
      - -config.expand-env
      - -config.enable-read-api

    ports:
      - "12345:12345"

相关问题