question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

issue with "runtime: failed to create new OS thread (have 2 already; errno=22) fatal error: newosproc"

See original GitHub issue

First, i’m using Apple Silicon M1 mac and i think this issue is related to it. When i do docker-compose up -d, build is ok but container exited immediately.

WARNING: /etc/nginx/dhparam/dhparam.pem was not found. A pre-generated dhparam.pem will be used for now while a new one
is being generated in the background.  Once the new dhparam.pem is in place, nginx will be reloaded.
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0x884500, 0x9)
	/usr/local/go1.6/src/runtime/panic.go:530 +0x90
runtime.newosproc(0xc820026000, 0xc820035fc0)
	/usr/local/go1.6/src/runtime/os1_linux.go:149 +0x18c
runtime.newm(0x932358, 0x0)
	/usr/local/go1.6/src/runtime/proc.go:1513 +0x135
runtime.main.func1()
	/usr/local/go1.6/src/runtime/proc.go:125 +0x2c
runtime.systemstack(0xa8e800)
	/usr/local/go1.6/src/runtime/asm_amd64.s:291 +0x79
runtime.mstart()
	/usr/local/go1.6/src/runtime/proc.go:1048

goroutine 1 [running]:
runtime.systemstack_switch()
	/usr/local/go1.6/src/runtime/asm_amd64.s:245 fp=0xc820020770 sp=0xc820020768
runtime.main()
	/usr/local/go1.6/src/runtime/proc.go:126 +0x62 fp=0xc8200207c0 sp=0xc820020770
runtime.goexit()
	/usr/local/go1.6/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8200207c8 sp=0xc8200207c0

This is a log from container.

  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./ssl:/etc/nginx/certs
      - ./nginx_custom.conf:/etc/nginx/conf.d/nginx_custom.conf:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro

And this is a docker-compose.yml code.

Anyone has any idea? Please let me know.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:37
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
ninanungcommented, Jan 21, 2021

Hi guys I think this repository is not being managed well. This PR opened few days ago, but not merged yet. So i forked from PR owner’s repo and tested it. It kinda work for me. Container is running, but there may be side effects.

I copied his repo and built a image(link here). Can test it if you want to. I’m still on it, so let me know if someone solve this issue.

3reactions
berndschimmercommented, Mar 14, 2021

Use https://hub.docker.com/r/ninanung/nginx-proxy from ninahung - this works perfectly. And my other issue with the wrongly bound volumes was also solved with the latest docker tech preview.

Read more comments on GitHub >

github_iconTop Results From Across the Web

failed to create new OS thread (have 2 already; errno=22) with ...
runtime : failed to create new OS thread (have 2 already; errno=22) fatal error: newosproc runtime stack: runtime.throw(0x524da0, ...
Read more >
Failed to create new OS thread (have 2 already; errno=22)
I run mysql docker in my M1 (arm64) and I got the same error when I try to build a ...
Read more >
Failed to create new OS thread - Docker Community Forums
While trying to start docker-compose i am getting this error: ERROR: for ... failed to create new OS thread (have 2 already; errno=22)...
Read more >
can't start mariadb on MacOS
But I have a hypothesis why my issue occurs. First, here's the error returned: mariadb_1 | runtime: failed to create new OS thread...
Read more >
failed to create new OS thread (have 6 already; errno=11) fatal ...
go run run.go -- bigalg.go exit status 2 # command-line-arguments runtime: failed to create new OS thread (have 6 already; errno=11) fatal error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found