Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1utTNj-007vvA-18 for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Sep 2025 15:57:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1utTNh-004NJI-7D for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Sep 2025 15:57:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1utTNg-004NJA-VA for pgsql-bugs@lists.postgresql.org; Tue, 02 Sep 2025 15:57:13 +0000 Received: from fs-srv-03.fs-ipnet.de ([5.9.20.133]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1utTNd-000CLu-2s for pgsql-bugs@lists.postgresql.org; Tue, 02 Sep 2025 15:57:13 +0000 Received: from venus.esw.cps-net.de (p50970a24.dip0.t-ipconnect.de [80.151.10.36]) by fs-srv-03.fs-ipnet.de (Postfix) with ESMTPSA id B54542216BD for ; Tue, 2 Sep 2025 17:57:04 +0200 (CEST) Received: from [10.0.0.155] (mfe-2025.esw.cps-net.de [10.0.0.155]) by venus.esw.cps-net.de (Postfix) with ESMTPSA id B9B4920010F for ; Tue, 2 Sep 2025 17:57:05 +0200 (CEST) Message-ID: Date: Tue, 2 Sep 2025 17:57:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18459: running pg_ctl.exe from inside a program running as a Windows service returns "error code 6" To: pgsql-bugs@lists.postgresql.org References: <18459-ae3443805592f4bc@postgresql.org> From: Martin Fernau Content-Language: de-DE, en-US Autocrypt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jcLwHh9h1RFSKP6j/pr3D7Bf9E 7aBuQcP57GQxv4e0Y4I4KfDCBWmNqe4IgOb5byJX5rL/oCndkprTNrpFLcitqjfMFP9kxeaR MbXVAPqX/7b/o+VUofYs7oaaneN8tN2YNo9sR/LfubXEBJcCrSopHvEUyjhcmWfdd5Lc2gzD QXuHABEBAAHCwawEGAEKACAWIQT+5F10DdNV9a50RevrP1lKLt7hTQUCZZ5ekwIbLgFACRDr P1lKLt7hTcB0IAQZAQoAHRYhBEbi/yNzWuz8K+9Vs+Ev/lEtw5T3BQJlnl6TAAoJEOEv/lEt w5T3NrQIAJJs+oP4tMTuxdNbuz9/zGzFoiVD42453BThW9xG7mDPIzlOLEh5OVOCPc23+qVa pNvW+KQw32OHGEa1prHcQ3yTIdpmcDKQSH6dNHBQlusksx5fY82oSWfq0jtDJvwPfVTj7ReN WLgX38mAv9Xe/Q+CPaMpACUcO6VJ6++cLs4bMnznc9U+3WSSyrYBKwW+ngvqYKxY30AqFQEf M2wJ56fOqFwEYBk1jiNJs76/tihNzYO7T0vmkBH7SP6kONb2L8mSX5JiS76G2zui0udEn4R2 rgw1QW33G/cK4dOOx6/qJznldT7cfhjv5a8dXqZrDfIL/2FdR97O48vwwBLWQCXzqAf/UAD6 FLlte+cF7MJGG46+RMjMzWzdiPMFeuOBcVgEdUSFQWfpVh+2BIBAwt8q7teVko3qozSm9Ivb 9TmegJSSVGyhgRRkH9fAwcZski1iBvvcD5SctxizoVVnnaollH/qGTSclxzCgqJs5HRHKXtM WBGoS3eAdFJJYDLJkstW7/zl5TQf/3WAhe+qAY/PNCJUt1SqYEEy28bwqh7WZtmkEWwWQs5B 2euP3v3t9uGGVf/9O6k8UR9NeVL8JvQv5fw9DJEaae6wvZMMWu74PJyr+6s9SqLSsBx7kGqf KpyXekY2N1Ijr5qZWOPzxBHXddhkCTrCi5YKGf5scvt+5Yu9Lw== Organization: FERNAUSOFT GmbH In-Reply-To: <18459-ae3443805592f4bc@postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I know this is an old thread – but were you ever able to find a solution? I'm facing exactly the same issue and can't figure out the root cause. The odd thing is that our software has been running fine for years in this exact setup, but it suddenly started to fail on one single machine. Postgres just won’t start (exit code 6) when launched from within our Windows service (Java process). However, it starts perfectly fine if I run it manually from the command line using the SYSTEM account. I'm really clueless at this point… Regards, Martin Am 09.05.24 um 20:28 schrieb PG Bug reporting form: > The following bug has been logged on the website: > > Bug reference: 18459 > Logged by: Rick Frank > Email address: rfrank@riministreet.com > PostgreSQL version: 15.3 > Operating system: Windows > Description: > > We have a program written in Go that launches postgressql. Postgres starts > as a separate process, but under control of our program. This works fine > running the program interactively with our program in a folder under > “C:\Program Files”. But Postgres won’t start when we run our program as a > Windows service, even if the postgres programs and database are in a > different folder. If we have our program in any folder except “C:\Program > Files”, it works running as a service. > > I tried with the service running under "Local System" and with a named > Administrator account; same error each time. I made sure that all users have > Full Control permissions to the folder where Postgres resides. Postgres > programs and data are in the same folder, in "C:\ProgramData" folder. > > The program is using a Go package called embedded-postgres. That package > starts Postgres using pg_ctl.exe. Here is the error that pg_ctl.exe > returns: > "pg_ctl: could not start server: error code 6" > > I can’t find any info saying what this message means. Any ideas what this > means? >