Thread: postmaster became multithreaded during startup
Hi, all, I am experiencing a startup failure on OS X 10.11.3, with PostgreSQL = 9.5.1 that I installed using Homebrew. Here's the full error: $ postgres -d 5 -D db DEBUG: postgres: PostmasterMain: initial environment dump: DEBUG: ----------------------------------------- DEBUG: TERM_PROGRAM=3DiTerm.app DEBUG: SHELL=3D/bin/bash DEBUG: TERM=3Dxterm-256color DEBUG: TMPDIR=3D/var/folders/3r/vzj1r6_918qghdqk517g55bcg3gy47/T/= DEBUG: = Apple_PubSub_Socket_Render=3D/private/tmp/com.apple.launchd.39PGlvUVAG/Ren= der DEBUG: USER=3Dpmw DEBUG: = SSH_AUTH_SOCK=3D/private/tmp/com.apple.launchd.QFbewTSIsA/Listeners DEBUG: __CF_USER_TEXT_ENCODING=3D0x1E37F887:0x0:0x0 DEBUG: = PATH=3D/Users/pmw/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin DEBUG: PWD=3D/Users/pmw/my-data DEBUG: = JAVA_HOME=3D/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Hom= e DEBUG: LANG=3Den_US.UTF-8 DEBUG: MEMDEF_POLICY=3DCCCCCCCCCCCCCAAAAAAAACC:C DEBUG: ITERM_PROFILE=3DDefault DEBUG: XPC_FLAGS=3D0x0 DEBUG: XPC_SERVICE_NAME=3D0 DEBUG: SHLVL=3D1 DEBUG: COLORFGBG=3D7;0 DEBUG: HOME=3D/Users/pmw DEBUG: ITERM_SESSION_ID=3Dw0t0p0 DEBUG: LOGNAME=3Dpmw DEBUG: _=3D/usr/local/bin/postgres DEBUG: OLDPWD=3D/Users/pmw DEBUG: PGSYSCONFDIR=3D/usr/local/etc/postgresql DEBUG: LC_COLLATE=3Den_US.UTF-8 DEBUG: LC_CTYPE=3Den_US.UTF-8 DEBUG: LC_MESSAGES=3Den_US.UTF-8 DEBUG: LC_MONETARY=3DC DEBUG: LC_NUMERIC=3DC DEBUG: LC_TIME=3DC DEBUG: ----------------------------------------- DEBUG: invoking IpcMemoryCreate(size=3D148488192) DEBUG: SlruScanDirectory invoking callback on pg_notify/0000 DEBUG: removing file "pg_notify/0000" DEBUG: dynamic shared memory system will support 288 segments DEBUG: created dynamic shared memory control segment 1804289383 (2316 = bytes) DEBUG: max_safe_fds =3D 982, usable_fds =3D 1000, already_open =3D 8 FATAL: postmaster became multithreaded during startup HINT: Set the LC_ALL environment variable to a valid locale. DEBUG: shmem_exit(1): 0 before_shmem_exit callbacks to make DEBUG: shmem_exit(1): 4 on_shmem_exit callbacks to make DEBUG: cleaning up dynamic shared memory control segment with ID = 1804289383 DEBUG: proc_exit(1): 2 callbacks to make DEBUG: exit(1) DEBUG: shmem_exit(-1): 0 before_shmem_exit callbacks to make DEBUG: shmem_exit(-1): 0 on_shmem_exit callbacks to make DEBUG: proc_exit(-1): 0 callbacks to make $ locale LANG=3D"en_US.UTF-8" LC_COLLATE=3D"en_US.UTF-8" LC_CTYPE=3D"en_US.UTF-8" LC_MESSAGES=3D"en_US.UTF-8" LC_MONETARY=3D"en_US.UTF-8" LC_NUMERIC=3D"en_US.UTF-8" LC_TIME=3D"en_US.UTF-8" LC_ALL=3D"en_US.UTF-8" Now that my LC_* variables are correct, I am stumped. Any ideas? --=20 Philip=
Philip White <philip@mailworks.org> writes: > I am experiencing a startup failure on OS X 10.11.3, with PostgreSQL 9.5.1 that I installed using Homebrew. > ... > FATAL: postmaster became multithreaded during startup > HINT: Set the LC_ALL environment variable to a valid locale. Hm. The HINT is reflecting the one known cause of this problem, but perhaps you've stumbled across a new one :-(. The other theory that comes to mind is that maybe Homebrew's build of Postgres has modified things in a way that breaks for you. Neither thought leads to any quick fixes. The best idea I can suggest is to strace the postmaster and try to identify where it's cloning an additional thread. OS X doesn't have strace that I know of, but googling suggests you can get similar results with dtruss. If you run with -d 5 as you did here, the debug printouts (which should be captured by dtruss too) will provide landmarks to help identify where it goes wrong. Please post back with the dtruss log (and pg_config output might be helpful too) and we'll see if we can make sense of it. regards, tom lane
On Wed, Mar 16, 2016 at 01:53:57PM -0700, Philip White wrote: > FATAL: postmaster became multithreaded during startup > HINT: Set the LC_ALL environment variable to a valid locale. > $ locale > LANG="en_US.UTF-8" > LC_COLLATE="en_US.UTF-8" > LC_CTYPE="en_US.UTF-8" > LC_MESSAGES="en_US.UTF-8" > LC_MONETARY="en_US.UTF-8" > LC_NUMERIC="en_US.UTF-8" > LC_TIME="en_US.UTF-8" > LC_ALL="en_US.UTF-8" > > Now that my LC_* variables are correct, I am stumped. Any ideas? What is the output of "env | grep -E '^(LC|LANG)'"? "locale" command output tells us the effective setting for each locale category, but it doesn't tell us which environment variables or other sources provided those settings.
On Sat, Mar 19, 2016 at 02:22:59AM -0400, Noah Misch wrote: > On Wed, Mar 16, 2016 at 01:53:57PM -0700, Philip White wrote: > > FATAL: postmaster became multithreaded during startup > > HINT: Set the LC_ALL environment variable to a valid locale. > > > $ locale > > LANG="en_US.UTF-8" > > LC_COLLATE="en_US.UTF-8" > > LC_CTYPE="en_US.UTF-8" > > LC_MESSAGES="en_US.UTF-8" > > LC_MONETARY="en_US.UTF-8" > > LC_NUMERIC="en_US.UTF-8" > > LC_TIME="en_US.UTF-8" > > LC_ALL="en_US.UTF-8" > > > > Now that my LC_* variables are correct, I am stumped. Any ideas? > > What is the output of "env | grep -E '^(LC|LANG)'"? "locale" command output > tells us the effective setting for each locale category, but it doesn't tell > us which environment variables or other sources provided those settings. Ping.