[Calendar and Contacts Server] #421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment
#421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment ----------------------------------+----------------------------------------- Reporter: donaldinos@… | Owner: wsanchez@… Type: Defect | Status: new Priority: 5: Not set | Milestone: CalendarServer-3.x Component: Calendar Server | Severity: Crash/data loss Keywords: | Radar: ----------------------------------+----------------------------------------- This issue occurs on execute ./run from command line on FreeBSD 8 2011-03-14 16:37:37+0100 [-] Unhandled Error Traceback (most recent call last): File "/usr/local/lib/python2.6/site- packages/twisted/internet/_baseprocess.py", line 60, in maybeCallProcessEnded proto.processEnded(Failure(reason)) File "/usr/local/src/AppleCalendarServer/CalendarServer/txdav/base/datastore/subpostgres.py", line 153, in processEnded self.deferred.callback(''.join(self.output)) File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 318, in callback self._startRunCallbacks(result) File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 424, in _startRunCallbacks self._runCallbacks() --- <exception caught here> --- File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 441, in _runCallbacks self.result = callback(self.result, *args, **kw) File "/usr/local/src/AppleCalendarServer/CalendarServer/txdav/base/datastore/subpostgres.py", line 407, in doCreate raise RuntimeError("Unable to initialize postgres database: %s" % (result,)) exceptions.RuntimeError: Unable to initialize postgres database: The files belonging to this database system will be owned by user "XXXXXX". This user must also own the server process. The database cluster will be initialized with locale C. creating directory /usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster ... ok creating subdirectories ... ok selecting default max_connections ... 10 selecting default shared_buffers/max_fsm_pages ... 400kB/20000 creating configuration files ... ok creating template1 database in /usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster/base/1 ... FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=1, size=1818624, 03600). HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 1818624 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10). The PostgreSQL documentation contains more information about shared memory configuration. child process exited with exit code 1 initdb: removing data directory "/usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster" -- Ticket URL: <http://trac.calendarserver.org/ticket/421> Calendar and Contacts Server </> HTTP/WebDAV/CalDAV Server
#421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment ----------------------------------+----------------------------------------- Reporter: donaldinos@… | Owner: wsanchez@… Type: Defect | Status: new Priority: 5: Not set | Milestone: CalendarServer-3.x Component: Calendar Server | Severity: Crash/data loss Keywords: | Radar: ----------------------------------+----------------------------------------- Description changed by wsanchez@…: Old description:
This issue occurs on execute ./run from command line on FreeBSD 8
2011-03-14 16:37:37+0100 [-] Unhandled Error Traceback (most recent call last): File "/usr/local/lib/python2.6/site- packages/twisted/internet/_baseprocess.py", line 60, in maybeCallProcessEnded proto.processEnded(Failure(reason)) File "/usr/local/src/AppleCalendarServer/CalendarServer/txdav/base/datastore/subpostgres.py", line 153, in processEnded self.deferred.callback(''.join(self.output)) File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 318, in callback self._startRunCallbacks(result) File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 424, in _startRunCallbacks self._runCallbacks() --- <exception caught here> --- File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 441, in _runCallbacks self.result = callback(self.result, *args, **kw) File "/usr/local/src/AppleCalendarServer/CalendarServer/txdav/base/datastore/subpostgres.py", line 407, in doCreate raise RuntimeError("Unable to initialize postgres database: %s" % (result,)) exceptions.RuntimeError: Unable to initialize postgres database: The files belonging to this database system will be owned by user "XXXXXX". This user must also own the server process.
The database cluster will be initialized with locale C.
creating directory /usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster ... ok creating subdirectories ... ok selecting default max_connections ... 10 selecting default shared_buffers/max_fsm_pages ... 400kB/20000 creating configuration files ... ok creating template1 database in /usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster/base/1 ... FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=1, size=1818624, 03600). HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 1818624 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10). The PostgreSQL documentation contains more information about shared memory configuration. child process exited with exit code 1 initdb: removing data directory "/usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster"
New description: This issue occurs on execute ./run from command line on FreeBSD 8 {{{ 2011-03-14 16:37:37+0100 [-] Unhandled Error Traceback (most recent call last): File "/usr/local/lib/python2.6/site- packages/twisted/internet/_baseprocess.py", line 60, in maybeCallProcessEnded proto.processEnded(Failure(reason)) File "/usr/local/src/AppleCalendarServer/CalendarServer/txdav/base/datastore/subpostgres.py", line 153, in processEnded self.deferred.callback(''.join(self.output)) File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 318, in callback self._startRunCallbacks(result) File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 424, in _startRunCallbacks self._runCallbacks() --- <exception caught here> --- File "/usr/local/lib/python2.6/site- packages/twisted/internet/defer.py", line 441, in _runCallbacks self.result = callback(self.result, *args, **kw) File "/usr/local/src/AppleCalendarServer/CalendarServer/txdav/base/datastore/subpostgres.py", line 407, in doCreate raise RuntimeError("Unable to initialize postgres database: %s" % (result,)) exceptions.RuntimeError: Unable to initialize postgres database: The files belonging to this database system will be owned by user "XXXXXX". This user must also own the server process. The database cluster will be initialized with locale C. creating directory /usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster ... ok creating subdirectories ... ok selecting default max_connections ... 10 selecting default shared_buffers/max_fsm_pages ... 400kB/20000 creating configuration files ... ok creating template1 database in /usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster/base/1 ... FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=1, size=1818624, 03600). HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 1818624 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10). The PostgreSQL documentation contains more information about shared memory configuration. child process exited with exit code 1 initdb: removing data directory "/usr/local/src/AppleCalendarServer/CalendarServer/data/Data/Database/cluster" }}} -- -- Ticket URL: <http://trac.calendarserver.org/ticket/421#comment:1> Calendar and Contacts Server </> HTTP/WebDAV/CalDAV Server
#421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment ----------------------------------+----------------------------------------- Reporter: donaldinos@… | Owner: dre@… Type: Defect | Status: new Priority: 3: Important | Milestone: CalendarServer-3.x Component: Calendar Server | Severity: Crash/data loss Keywords: | Radar: ----------------------------------+----------------------------------------- Changes (by wsanchez@…): * owner: wsanchez@… => dre@… * priority: 5: Not set => 3: Important -- Ticket URL: <http://trac.calendarserver.org/ticket/421#comment:2> Calendar and Contacts Server </> HTTP/WebDAV/CalDAV Server
#421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment ----------------------------------+----------------------------------------- Reporter: donaldinos@… | Owner: dre@… Type: Defect | Status: new Priority: 3: Important | Milestone: CalendarServer-3.x Component: Calendar Server | Severity: Crash/data loss Keywords: | Radar: ----------------------------------+----------------------------------------- Comment(by dre@…): Hello, Different OSes have different defaults for shared memory settings. Here's a link to the postgres documentation around shared memory and how it is configured on various OSes: http://www.postgresql.org/docs/9.0/interactive /kernel-resources.html I don't have any FreeBSD stuff set up at the moment so I can't test this, but you should be able to raise shmall, shmmax, and semmap as shown in the documentation. You may have to experiment a bit to find suitable values. Please let us know what works for you. Since changing these settings requires superuser access, this isn't something that Calendar Server could or should do for you automatically. The end result of this could be that we simply improve our documentation to make sure users know to set shared memory settings appropriately. Cheers, -dre -- Ticket URL: <http://trac.calendarserver.org/ticket/421#comment:3> Calendar and Contacts Server </> HTTP/WebDAV/CalDAV Server
#421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment ----------------------------------+----------------------------------------- Reporter: donaldinos@… | Owner: dre@… Type: Defect | Status: new Priority: 3: Important | Milestone: CalendarServer-3.x Component: Calendar Server | Severity: Crash/data loss Keywords: | Radar: ----------------------------------+----------------------------------------- Comment(by wsanchez@…): Hrm, so that's not usually the sort of this we can adjust unless we are root, so I don't know that we can fix this in the run script; developers may need to do this on their own. Perhaps, though, we can detect it and emit some instructional info, like when there is no `caldavd-dev.plist`. -- Ticket URL: <http://trac.calendarserver.org/ticket/421#comment:4> Calendar and Contacts Server </> HTTP/WebDAV/CalDAV Server
#421: Create PostgreSQL DB on run CalendarServer - could not create shared memory segment ----------------------------------+----------------------------------------- Reporter: donaldinos@… | Owner: dre@… Type: Defect | Status: new Priority: 3: Important | Milestone: Later Component: Calendar Server | Severity: Crash/data loss Keywords: | Radar: ----------------------------------+----------------------------------------- Changes (by wsanchez@…): * milestone: CalendarServer-3.x => Later -- Ticket URL: <http://trac.calendarserver.org/ticket/421#comment:5> Calendar and Contacts Server </> HTTP/WebDAV/CalDAV Server
participants (1)
-
Calendar and Contacts Server