From: howardnews@selestial.com
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: pgsql-general@lists.postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
Date: Mon, 01 Aug 2022 12:11:10 +0100
Message-ID: <765a8435ee41406bcc445ab4e17137cf@selestial.com> (raw)
In-Reply-To: <00efda45-309d-57b9-3eed-9ff6ff2080f7@aklaver.com>
References: <ee4efe672cd7b7909c68caf8a82c3ba9@selestial.com>
<8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com>
<55172d40109beb0daee6ad81a97352fe@selestial.com>
<74020545-e16c-8880-bacd-f1c98557d937@aklaver.com>
<8ba4268bb21ba789acbef323b0928f9c@selestial.com>
<00efda45-309d-57b9-3eed-9ff6ff2080f7@aklaver.com>
On 2022-08-01 04:06, Adrian Klaver wrote:
>> 2022-08-01T00:20:18.530Z Connection-1 finer] Created socket
>> [2022-08-01T00:20:18.532Z Connection-1 fine] Opening connection to
>> port 5432 on host localhost
>> 2022-08-01 01:20:18.534308+0100 TestPostgres[10654:120173]
>> dnssd_clientstub ConnectToServer: connect() failed
>
> A search on above error message found:
>
> https://github.com/firebase/firebase-ios-sdk/issues/3033
>
> https://developer.apple.com/forums/thread/67792
>
> https://github.com/emqx/CocoaMQTT/issues/202
>
> all of which point to what Tom Lane mentioned, sandboxing.
>
>> path:/var/run/mDNSResponder Socket:13 Err:-1 Errno:1 Operation not
>> permitted
>> 2022-08-01 01:20:18.535617+0100 TestPostgres[10654:120173]
>> [si_destination_compare] socket(PF_SYSTEM, SOCK_DGRAM,
>> SYSPROTO_CONTROL) failed: Operation not permitted
>> 2022-08-01 01:20:18.535694+0100 TestPostgres[10654:120173]
>> [si_destination_compare] socket(PF_SYSTEM, SOCK_DGRAM,
>> SYSPROTO_CONTROL) failed: Operation not permitted
>> [2022-08-01T00:20:18.537Z Connection-1 severe] Unable to connect
>> socket: Error code: -9989(0x-2705), Operation not permitted
>> [2022-08-01T00:20:18.537Z Connection-1 finer] Closing socket
Hi Adrian,
you & Tom were correct - it was sandbox settings (which was turned
off??) in Xcode which caused the problems. In case anyone else has the
problem, the steps I took to fix the problem in XCode 13.3 were as
follows:
1. Go to the project explorer and select the project.
2. Select the Target under the list of Targets
3. Select the "Signing & Capabilities" Tab/Heading
4. Under the "App Sandbox" settings, select the "Outgoing connections
(client)" checkbox.
5. Note - the "Enable App Sandbox" under Build Settings seems to have no
effect!
Apologies for not finding this myself - This was purely a MacOS / XCode
problem - but many thanks to you all (Adrian, Tom, Rob) for proving yet
again that Postgresql support is the best.
Howard.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: howardnews@selestial.com, adrian.klaver@aklaver.com, robjsargent@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit
In-Reply-To: <765a8435ee41406bcc445ab4e17137cf@selestial.com>
References: <ee4efe672cd7b7909c68caf8a82c3ba9@selestial.com> <8b3c9c27-3a13-1a45-b3de-a995a4cbbf19@gmail.com> <55172d40109beb0daee6ad81a97352fe@selestial.com> <74020545-e16c-8880-bacd-f1c98557d937@aklaver.com> <8ba4268bb21ba789acbef323b0928f9c@selestial.com> <00efda45-309d-57b9-3eed-9ff6ff2080f7@aklaver.com> <765a8435ee41406bcc445ab4e17137cf@selestial.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox