Skip to content

install postgresql issue #61

Closed
Closed

Description

@jiangjianxiao

pg_createcluster 9.5 main --start

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

Activity

  1. filipeaguiar commented on Apr 8, 2016

    @filipeaguiar

    I had the same error yesterday. It appears that writing on some folders or creating symlinks are problematic in WSL right now.

  2. jwsloan commented on Apr 14, 2016

    @jwsloan

    Has anyone found a workaround for this?

  3. yjwong commented on Apr 23, 2016

    @yjwong

    Seems like there's no proper System V shared memory support at the moment.

  4. Nilotaviano commented on May 1, 2016

    @Nilotaviano

    No workouronds yet?

  5. mrenigma commented on Jun 7, 2016

    @mrenigma

    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
  6. threebyeight commented on Jun 9, 2016

    @threebyeight

    Still waiting on this.

  7. the-ult commented on Jun 14, 2016

    @the-ult

    One of the things holding me from developing on windows with Ruby.

  8. the-ult commented on Jun 17, 2016

    @the-ult

    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...

  9. the-ult commented on Jun 17, 2016

    @the-ult

    Thanks, didn't think of it that way.
    Gonna try it out.

    Op vr 17 jun. 2016 23:05 schreef SRGOM [email protected]:

    The combination. You don't use postgres as a process, you access it over a
    port so there should be no issues there

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #61 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe/AEo0Vj99_9zBZtrF5rFHiLNe6_bqnT9rks5qMwwOgaJpZM4IC15g
    .

    met vriendelijke groet,
    Arjen

    M 06-51 800 419
    W www.payt.nl

  10. alexfromvl commented on Jun 22, 2016

    @alexfromvl

    I got the same error on a new release - build 14367.rs1_release.160613-1700. Can anyone find a solution?

  11. threebyeight commented on Jun 22, 2016

    @threebyeight

    Someone has to implement that call to the kernel.

  12. glebovsky commented on Jun 22, 2016

    @glebovsky

    Hi!

    Can someone please describe how to connect to postgres on the host, like S (@SRGOM) mentioned?

    Thanks!

  13. jwsloan commented on Jun 22, 2016

    @jwsloan

    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.

  14. glebovsky commented on Jun 22, 2016

    @glebovsky

    S (@SRGOM) Thanks! Just tried it and it works perfectly.

  15. alexfromvl commented on Jun 23, 2016

    @alexfromvl

    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:

    1. Set Postgres for Windows.
    2. Start the server Postgres.
    3. Connect to the database server, as is usually done in the unix;
  16. 60 remaining items

  17. sunilmut commented on Jan 17, 2017

    @sunilmut
    Member

    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.

  18. arjennienhuis commented on Jan 17, 2017

    @arjennienhuis

    #1354 mentioned that. Thanks!

  19. arjennienhuis commented on Jan 29, 2017

    @arjennienhuis

    This doesn't work with 15014. Any idea when the fix will be released?

  20. sunilmut commented on Jan 31, 2017

    @sunilmut
    Member

    Support for SO_ERROR for unix sockets came in 15019. Can you try with that build?

  21. StephanMeijer commented on Jan 31, 2017

    @StephanMeijer

    Same issue here with PostgreSQL 9.3.15.

  22. arjennienhuis commented on Feb 1, 2017

    @arjennienhuis

    I'm still "Initializing updates"... 😞

  23. arjennienhuis commented on Feb 2, 2017

    @arjennienhuis

    everything seems to work on 15025

  24. bhagwandassoni1953 commented on Aug 8, 2021

    @bhagwandassoni1953

    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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions