You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating new cluster 9.5/main ...
config /etc/postgresql/9.5/main
data /var/lib/postgresql/9.5/main
locale en_US.UTF-8
FATAL: could not create shared memory segment: Invalid argument
DETAIL: Failed system call was shmget(key=1, size=56, 03600).
HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter, or possibly that it is less than your kernel's SHMMIN parameter.
The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/9.5/main"
Error: initdb failed
sysctl -w kernel.shmmax=1
sysctl: cannot stat /proc/sys/kernel/shmmax: No such file or directory
Reacted by Huiming Teo, arjennienhuis, Per-Victor Persson, Jeff Trawick, adamacus, Jacob Rastad, Jess, Lekontsev Vitalii, Andrea Fomera, Robert Hunt and 57 more
Reacted by arjennienhuis, Eugene Baranov, Hamza Faran, Raphael D. Pinheiro, Kevin, Dylan Katz, Claudionor O., Valerii Myronov, Skylar, Nicholas Koh and 5 more
Reacted by Abhimanyu Aryan, adityaprodduturu, dtracers and Subhash
Same issue here with build 14352.rs1_release.160522-1930. Any fixes on this yet? It's the final piece of the puzzle for my workflow!
Output below:
rob@DESKTOP-NQ3AL5E:~$ sudo apt-get install postgresql postgresql-common
[sudo] password for rob:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libossp-uuid16 libxslt1.1 os-prober
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
postgresql-9.3 postgresql-client-9.3 postgresql-client-common
Suggested packages:
oidentd ident-server locales-all postgresql-doc-9.3
The following NEW packages will be installed:
postgresql postgresql-9.3 postgresql-client-9.3 postgresql-client-common
postgresql-common
0 upgraded, 5 newly installed, 0 to remove and 40 not upgraded.
Need to get 0 B/3,603 kB of archives.
After this operation, 15.2 MB of additional disk space will be used.
Preconfiguring packages .../n] y
E: Can not write log (Is /dev/pts mounted?) - openpty (2: No such file or directory)
Selecting previously unselected package postgresql-client-common.
(Reading database ... 32749 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_154ubuntu1_all.deb ...
Unpacking postgresql-client-common (154ubuntu1) ...
Selecting previously unselected package postgresql-client-9.3.
Preparing to unpack .../postgresql-client-9.3_9.3.13-0ubuntu0.14.04_amd64.deb ...
Unpacking postgresql-client-9.3 (9.3.13-0ubuntu0.14.04) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../postgresql-common_154ubuntu1_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (154ubuntu1) ...
Selecting previously unselected package postgresql-9.3.
Preparing to unpack .../postgresql-9.3_9.3.13-0ubuntu0.14.04_amd64.deb ...
Unpacking postgresql-9.3 (9.3.13-0ubuntu0.14.04) ...
Selecting previously unselected package postgresql.
Preparing to unpack .../postgresql_9.3+154ubuntu1_all.deb ...
Unpacking postgresql (9.3+154ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up postgresql-client-common (154ubuntu1) ...
Setting up postgresql-client-9.3 (9.3.13-0ubuntu0.14.04) ...
update-alternatives: using /usr/share/postgresql/9.3/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-common (154ubuntu1) ...
Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for ureadahead (0.100.0-16) ...
Setting up postgresql-9.3 (9.3.13-0ubuntu0.14.04) ...
Creating new cluster 9.3/main ...
config /etc/postgresql/9.3/main
data /var/lib/postgresql/9.3/main
locale C
FATAL: could not create shared memory segment: Function not implemented
DETAIL: Failed system call was shmget(key=1, size=48, 03600).
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/9.3/main"
Error: initdb failed
Error: could not create default cluster. Please create it manually with
pg_createcluster 9.3 main --start
or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.3/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
Setting up postgresql (9.3+154ubuntu1) ...
rob@DESKTOP-NQ3AL5E:~$ sudo pg_createcluster 9.3 main --start
Creating new cluster 9.3/main ...
config /etc/postgresql/9.3/main
data /var/lib/postgresql/9.3/main
locale en_US.UTF-8
FATAL: could not create shared memory segment: Function not implemented
DETAIL: Failed system call was shmget(key=1, size=48, 03600).
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/9.3/main"
Error: initdb failed
One of the things holding me from developing on windows with Ruby.
Reacted by Josiah Johnson, Kurt Mueller, fipso, dirtshell, Francesco Nunez Alessi, Teoni Valois, Arjen van der Ende, Alex Gusev, zernie, Theo Browne and 36 more
So you don't get an error while installing postgres on WSL?
Which version of postgres are you using?
Or do you mean the combination of postgres on Windows and Ruby on WSL works great?
I thought programs on Windows are not accessible from WSL.
So I figured, the same would go for a rails server using postgres...
S (@SRGOM) Thank you. When installing Postgres on Windows normally. You can consider this alternative, until they make proper implementation in bash.
Recipe for those who have problems:
Set Postgres for Windows.
Start the server Postgres.
Connect to the database server, as is usually done in the unix;
Reacted by Haywirez, Ashhar Hasan, Allan Freitas, Sergey Tsvetkov, Abhimanyu Aryan, Aquiles Cohen and Tanmay Jaiswal
arjennienhuis - Thanks for collecting the trace and dissecting it out. Makes the analysis very easy. Good news is that the support for SO_ERROR for unix socket was recently added (thanks Ben Hillis (@benhillis)), but the fix is only available in our dev branch. It is making it's way to the release branch.
postgres@localhost:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "C". The default database encoding has accordingly been set to "SQL_ASCII". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /usr/local/pgsql/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 20 selecting default shared_buffers ... 400kB selecting default time zone ... UTC creating configuration files ... ok running bootstrap script ... 2021-08-08 10:34:47.950 UTC [31924] FATAL: could not create shared memory segment: Operation not permitted 2021-08-08 10:34:47.950 UTC [31924] DETAIL: Failed system call was shmget(key=1081392, size=56, 03600). child process exited with exit code 1 initdb: removing contents of data directory "/usr/local/pgsql/data"
Activity
filipeaguiar commentedon Apr 8, 2016
I had the same error yesterday. It appears that writing on some folders or creating symlinks are problematic in WSL right now.
jwsloan commentedon Apr 14, 2016
Has anyone found a workaround for this?
yjwong commentedon Apr 23, 2016
Seems like there's no proper System V shared memory support at the moment.
Nilotaviano commentedon May 1, 2016
No workouronds yet?
mrenigma commentedon Jun 7, 2016
Same issue here with build 14352.rs1_release.160522-1930. Any fixes on this yet? It's the final piece of the puzzle for my workflow!
Output below:
threebyeight commentedon Jun 9, 2016
Still waiting on this.
the-ult commentedon Jun 14, 2016
One of the things holding me from developing on windows with Ruby.
the-ult commentedon Jun 17, 2016
So you don't get an error while installing postgres on WSL?
Which version of postgres are you using?
Or do you mean the combination of postgres on Windows and Ruby on WSL works great?
I thought programs on Windows are not accessible from WSL.
So I figured, the same would go for a rails server using postgres...
the-ult commentedon Jun 17, 2016
Thanks, didn't think of it that way.
Gonna try it out.
Op vr 17 jun. 2016 23:05 schreef SRGOM [email protected]:
M 06-51 800 419
W www.payt.nl
alexfromvl commentedon Jun 22, 2016
I got the same error on a new release - build 14367.rs1_release.160613-1700. Can anyone find a solution?
threebyeight commentedon Jun 22, 2016
Someone has to implement that call to the kernel.
glebovsky commentedon Jun 22, 2016
Hi!
Can someone please describe how to connect to postgres on the host, like S (@SRGOM) mentioned?
Thanks!
jwsloan commentedon Jun 22, 2016
I am successfully connecting my Rails app running in WSL to Postgres on Windows. I don't recall doing anything special to make that happen.
glebovsky commentedon Jun 22, 2016
S (@SRGOM) Thanks! Just tried it and it works perfectly.
alexfromvl commentedon Jun 23, 2016
S (@SRGOM) Thank you. When installing Postgres on Windows normally. You can consider this alternative, until they make proper implementation in bash.
Recipe for those who have problems:
60 remaining items
sunilmut commentedon Jan 17, 2017
arjennienhuis - Thanks for collecting the trace and dissecting it out. Makes the analysis very easy. Good news is that the support for
SO_ERRORfor unix socket was recently added (thanks Ben Hillis (@benhillis)), but the fix is only available in our dev branch. It is making it's way to the release branch.arjennienhuis commentedon Jan 17, 2017
#1354 mentioned that. Thanks!
arjennienhuis commentedon Jan 29, 2017
This doesn't work with 15014. Any idea when the fix will be released?
sunilmut commentedon Jan 31, 2017
Support for
SO_ERRORfor unix sockets came in 15019. Can you try with that build?StephanMeijer commentedon Jan 31, 2017
Same issue here with PostgreSQL
9.3.15.arjennienhuis commentedon Feb 1, 2017
I'm still "Initializing updates"... 😞
arjennienhuis commentedon Feb 2, 2017
everything seems to work on 15025
bhagwandassoni1953 commentedon Aug 8, 2021
postgres@localhost:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "C". The default database encoding has accordingly been set to "SQL_ASCII". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /usr/local/pgsql/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 20 selecting default shared_buffers ... 400kB selecting default time zone ... UTC creating configuration files ... ok running bootstrap script ... 2021-08-08 10:34:47.950 UTC [31924] FATAL: could not create shared memory segment: Operation not permitted 2021-08-08 10:34:47.950 UTC [31924] DETAIL: Failed system call was shmget(key=1081392, size=56, 03600). child process exited with exit code 1 initdb: removing contents of data directory "/usr/local/pgsql/data"