Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Bug Running postgres on M1 #4

Open
DocWatson opened this issue Jun 1, 2023 · 0 comments
Open

Bug Running postgres on M1 #4

DocWatson opened this issue Jun 1, 2023 · 0 comments

Comments

@DocWatson
Copy link

We run our own version of retool; I recently switched to an m1 macbook and had trouble getting the docker-compose stack to run. I got output that looked something like this:

2023-05-31 11:52:24 runtime: failed to create new OS thread (have 2 already; errno=22)
2023-05-31 11:52:24 fatal error: newosproc
2023-05-31 11:52:24 
2023-05-31 11:52:24 runtime stack:
2023-05-31 11:52:24 runtime.throw(0x4cb21f, 0x9)
2023-05-31 11:52:24     /usr/local/go/src/runtime/panic.go:566 +0x95
2023-05-31 11:52:24 runtime.newosproc(0xc42002a000, 0xc420039fc0)
2023-05-31 11:52:24     /usr/local/go/src/runtime/os_linux.go:160 +0x194
2023-05-31 11:52:24 runtime.newm(0x4d6db8, 0x0)
2023-05-31 11:52:24     /usr/local/go/src/runtime/proc.go:1572 +0x132
2023-05-31 11:52:24 runtime.main.func1()
2023-05-31 11:52:24     /usr/local/go/src/runtime/proc.go:126 +0x36
2023-05-31 11:52:24 runtime.systemstack(0x53ae00)
2023-05-31 11:52:24     /usr/local/go/src/runtime/asm_amd64.s:298 +0x79
2023-05-31 11:52:24 runtime.mstart()
2023-05-31 11:52:24     /usr/local/go/src/runtime/proc.go:1079

Googling around I discovered this was a problem on M1 macs when docker has trouble building a docker image. Interestingly, I already had some postgres containers running on my local machine for other apps. I'm using Rosetta, and I did have the correct docker env variable set to get the docker engine to build an AMD compatible image (for reference, this is DOCKER_DEFAULT_PLATFORM=linux/amd64).

I was able to get retool to run by updating the docker-compose.yml file to simply use the latest postgres. So far, it seems to work okay, but using latest PG without understanding the requirements for retool itself seems a little iffy. My instinct is it should be totally compatible since I don't imagine the Retool app needs to do very intense SQL operations to do its thing, but the version in the compose file is 6 major versions behind, so you never know.

Is there a recommended version of postgres that would make more sense for us to use instead of latest (i.e. 15.3)? I'll report back if I experience any strange bugs and happily test with a recommended version as well. A blurb about M1 compatibility in the Readme might be good too :)

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

No branches or pull requests

1 participant