Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oITKP-0003RT-ND for pgsql-general@arkaria.postgresql.org; Mon, 01 Aug 2022 11:11:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oITKO-00032U-0m for pgsql-general@arkaria.postgresql.org; Mon, 01 Aug 2022 11:11:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oITKN-00032L-J8 for pgsql-general@lists.postgresql.org; Mon, 01 Aug 2022 11:11:15 +0000 Received: from mail-falcon.ukwebsolutionsdirect.com ([193.189.75.23]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oITKK-0002HU-UN for pgsql-general@lists.postgresql.org; Mon, 01 Aug 2022 11:11:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=selestial.com; s=default; h=Content-Transfer-Encoding:Content-Type: Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YxVZiAD3aKRGLKK6YyUY8+gtIGoScdcX/UuoSj5BDXA=; b=Dj1wmRHswgzlZSUXHuSyDLh6jL 17C5LLRYjeLXLmPkChdIAIiUQA+xGoOPufnPybCaIlh32kzV+Vy/RgWcPjfU9tA/cN31i0jVaie4R dXOPWXQFv/uprEUjaYh1dBofhAYCLpNEITEzeKNTc/68pT/uRD7tBLMYxjzUiz9UgXpnmshneMazl 2NoRubohMcU34DBs0uCzOPs0LMQxE/OXl172Q0ofFRrlbIL3tyGuV+rYOt6K9K9WmpSYSZsQ712ms NGVgrcAdUYpChrBe/eElPB0QV+DqaH4UZ8GYnfr97JN06+aVXnMUhQMhcAkP5msasMGHb5/qY6yvV b88QeRRQ==; Received: from [::1] (port=48764 helo=falcon.ukwebsolutionsdirect.com) by falcon.ukwebsolutionsdirect.com with esmtpa (Exim 4.95) (envelope-from ) id 1oITKJ-009ziy-0M; Mon, 01 Aug 2022 12:11:11 +0100 MIME-Version: 1.0 Date: Mon, 01 Aug 2022 12:11:10 +0100 From: howardnews@selestial.com To: Adrian Klaver Cc: Rob Sargent , pgsql-general@lists.postgresql.org, Tom Lane Subject: Re: Connecting to postgres on OSX from Swift using PostgresClientKit In-Reply-To: <00efda45-309d-57b9-3eed-9ff6ff2080f7@aklaver.com> References: <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> User-Agent: Roundcube Webmail/1.5.2 Message-ID: <765a8435ee41406bcc445ab4e17137cf@selestial.com> X-Sender: howardnews@selestial.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - falcon.ukwebsolutionsdirect.com X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - selestial.com X-Get-Message-Sender-Via: falcon.ukwebsolutionsdirect.com: authenticated_id: howardnews@selestial.com X-Authenticated-Sender: falcon.ukwebsolutionsdirect.com: howardnews@selestial.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.