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

initdb fails on macos #261

Open
jayvdb opened this issue Jun 24, 2024 · 3 comments
Open

initdb fails on macos #261

jayvdb opened this issue Jun 24, 2024 · 3 comments

Comments

@jayvdb
Copy link
Collaborator

jayvdb commented Jun 24, 2024

On Mac we are seeing

2024-06-24 09:49:14.845 AEST [24328] FATAL:  could not create shared memory segment: No space left on device
2024-06-24 09:49:14.845 AEST [24328] DETAIL:  Failed system call was shmget(key=128053537, size=56, 03600).
2024-06-24 09:49:14.845 AEST [24328] HINT:  This error does *not* mean that you have run out of disk space.  It occurs either if all available shared memory IDs have been taken, in which case you need to raise the SHMMNI parameter in your kernel, or because the system's overall limit for shared memory has been reached.
        The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing contents of data directory "/Users/xxxx/projects/xxx/tmp_pg/cRwAExKc"

The fix appears to be to increase kern.sysv.shmmax and maybe kern.sysv.shmall also.

Possibly we can workaround this by adding params to the initdb invocation to indicate that a less production-like setup is acceptable.

@Electron100
Copy link
Owner

Sorry, I'm not quite following the scope here (and I have no Apple hardware to try it out). This is occurring intermittently? Or on all Macs all of the time? Or one Mac all of the time?

Is this specific to the way Butane is invoking Postgres in some way, or does a manual invocation of Postgres initdb hit the same problem on this system?

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jun 26, 2024

I've got a rarely used Mac Intel, so might be able to reproduce it in order to get more specifics.

I'm told it is a permanent problem until those kern params are set. Very likely the same error would occur if initdb was invoked the same way on the command line.

@RobertoMaurizzi
Copy link

I remember having this problem years ago setting up my Django dev environment on a Mac and fixing it as explained above. It's however a "problem" between Apple security restrictions for "regular" users and how you run PostgreSQL on an Apple system (usually, as your own user with the PostgreSQL app).
I'd expect similar behavior on modern Linux distros if you set up and run PostgreSQL as a regular user.

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