What is causing this Flutter Firestore error on macOS? - flutter

I'm trying to create a simple document in my Firestore database when a user presses submit. It works when the app is run on iOS but this is what I see when I run it on macOS:
2022-03-20 19:39:47.333823-0700 globe_artist[62624:775059] Connection 12: received failure notification
2022-03-20 19:39:47.333872-0700 globe_artist[62624:775059] Connection 12: failed to connect 1:1, reason -1
2022-03-20 19:39:47.333901-0700 globe_artist[62624:775059] Connection 12: encountered error(1:1)
2022-03-20 19:39:47.337548-0700 globe_artist[62624:775059] Task <3286828D-3FE8-44EB-9E85-C164E1B00836>.<1> HTTP load failed, 0/0 bytes (error code: 1 [1:1])
2022-03-20 19:39:47.338184-0700 globe_artist[62624:775059] Task <3286828D-3FE8-44EB-9E85-C164E1B00836>.<1> finished with error [1] Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <3286828D-3FE8-44EB-9E85-C164E1B00836>.<1>, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=1, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <3286828D-3FE8-44EB-9E85-C164E1B00836>.<1>"
), _NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0, ipv4, dns}
2022-03-20 19:40:19.959305-0700 globe_artist[62624:775842] [] nw_path_evaluator_create_flow_inner NECP_CLIENT_ACTION_ADD_FLOW A50B5D10-DA1B-457F-9F74-3EAC1A8BA7A6 [1: Operation not permitted]
2022-03-20 19:40:19.959890-0700 globe_artist[62624:775842] [connection] nw_endpoint_flow_setup_channel [C13.1 142.250.217.106:443 in_progress channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] failed to request add nexus flow

Related

URLSessionWebSocketTask sometimes only connects after some retries

I don't have a consistent reproduction path. I am creating a plain URLSessionWebSocketTask and try to connect to my server running on localhost.
Sometimes it won't connect instant, but after a few tries it succeed. I don't get any connecting logging on the server side when the error loggings appear in the app.
These are the logs:
[tcp] tcp_input [C9.1.1:2] flags=[R.] seq=0, ack=2805414308, win=0 state=SYN_SENT rcv_nxt=0, snd_una=2805414307
[tcp] tcp_input [C9.1.1:2] flags=[R.] seq=0, ack=2805414308, win=0 state=SYN_SENT rcv_nxt=0, snd_una=2805414307
Connection 9: received failure notification
Connection 9: failed to connect 1:61, reason -1
Connection 9: encountered error(1:61)
Task <F324C4E7-092F-479B-98C2-5FFE835A8C6A>.<10> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
Task <F324C4E7-092F-479B-98C2-5FFE835A8C6A>.<10> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSErrorFailingURLStringKey=http://mac-studio.local:3012/, NSErrorFailingURLKey=http://mac-studio.local:3012/, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalWebSocketTask <F324C4E7-092F-479B-98C2-5FFE835A8C6A>.<10>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalWebSocketTask <F324C4E7-092F-479B-98C2-5FFE835A8C6A>.<10>, NSLocalizedDescription=Could not connect to the server.}
[tcp] tcp_input [C10.1.1:2] flags=[R.] seq=0, ack=836765050, win=0 state=SYN_SENT rcv_nxt=0, snd_una=836765049
[tcp] tcp_input [C10.1.1:2] flags=[R.] seq=0, ack=836765050, win=0 state=SYN_SENT rcv_nxt=0, snd_una=836765049
It retries every second to connect. After the 10th attempt or so, it is connected and remains connected without any problems. Sometimes I do not have any problem and it connect instant.
Is there any property I can use to make sure it will try to connect somewhat longer?

Flutter integration tests, with FlutterFire, unable to connect when trying to run for Firebase Test Lab

I have a Flutter app (using version 2.5.1) that
Runs on a simulator
Run on a physical iOS device
Runs when I distribute it using TestFlight
Has integration tests, that run just fine on the simulator.
The app uses Flutterfire and the integration tests uses parts of the app that use Flutterfire.
However, when I follow these instructions in order to create something that can eventually be distributed to Firebase Test Lab, I stumble on the penultimate step:
xcodebuild test-without-building -xctestrun "build/ios_integ/Build/Products/Runner_iphoneos15.0-arm64-armv7.xctestrun" -destination id=<MYDEVICEID>
The app deploys to the physical device, and starts to run, but seems to fail to connect to any Firebase back-ends.
The logs have errors that look like those below.
Any pointers as to how I can fix this will be much appreciated!
Test Suite 'All tests' started at 2021-09-23 18:50:58.044
Test Suite 'RunnerTests.xctest' started at 2021-09-23 18:50:58.045
Test Suite 'RunnerTests' started at 2021-09-23 18:50:58.045
Test Case '-[RunnerTests testIntegrationTest]' started.
2021-09-23 18:50:58.047998+0100 Runner[404:7739] flutter: 00:00 +0: Porridge (setUpAll)
2021-09-23 18:50:58.049466+0100 Runner[404:7739] flutter: 00:00 +1: Porridge Create User
2021-09-23 18:50:58.052143+0100 Runner[404:7734] 8.6.0 - [Firebase/Analytics][I-ACS023007] Analytics v.8.6.0 started
2021-09-23 18:50:58.052457+0100 Runner[404:7734] 8.6.0 - [Firebase/Analytics][I-ACS023008] To disable debug logging set the following
application argument: -noFIRAnalyticsDebugEnabled
2021-09-23 18:50:58.062413+0100 Runner[404:7730] [connection] nw_socket_handle_socket_event [C1.1:2] Socket SO_ERROR [61: Connection r
efused]
2021-09-23 18:50:58.062759+0100 Runner[404:7730] [connection] nw_socket_handle_socket_event [C1.2:2] Socket SO_ERROR [61: Connection r
efused]
2021-09-23 18:50:58.063110+0100 Runner[404:7730] Connection 1: received failure notification
2021-09-23 18:50:58.063199+0100 Runner[404:7730] Connection 1: failed to connect 1:61, reason -1
2021-09-23 18:50:58.063314+0100 Runner[404:7730] Connection 1: encountered error(1:61)
2021-09-23 18:50:58.063936+0100 Runner[404:7730] Task <0B92B415-FE63-4467-8248-8FB5B411688A>.<1> HTTP load failed, 0/0 bytes (error co
de: -1004 [1:61])
2021-09-23 18:50:58.064589+0100 Runner[404:7730] Task <0B92B415-FE63-4467-8248-8FB5B411688A>.<1> finished with error [-1004] Error Dom
ain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x281c31890
{Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErr
orFailingURLSessionTaskErrorKey=LocalDataTask <0B92B415-FE63-4467-8248-8FB5B411688A>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <0B92B415-FE63-4467-8248-8FB5B411688A>.<1>"
), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://localhost:9099/www.googleapis.com/identi
tytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyCHkqtqAXDFllu7SmuwSw8_pudpAn-dzdM, NSErrorFailingURLKey=http://localhost:9099/www.go
ogleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=AIzaSyCHkqtqAXDFllu7SmuwSw8_pudpAn-dzdM, _kCFStreamErrorDomainKey=1}
2021-09-23 18:50:58.065318+0100 Runner[404:7739] flutter: [firebase_auth/network-request-failed] Network error (such as timeout, interrupted connection or unreachable host) has occurred.
2021-09-23 18:50:58.065511+0100 Runner[404:7739] flutter: #0 MethodChannelFirebaseAuth.createUserWithEmailAndPassword (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:272)
...etc....

Safari Extension Fails to perform URLSession Tasks with error: failed path:/var/run/mDNSResponder Operation not permitted

Hi guys I attempts to make RESTful call when toolbar item is click.
then it fails to connect to the internet with the following error in log.
[default] Unable to load Info.plist exceptions (eGPUOverrides)
The extension's toolbar item was clicked
dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:5 Err:-1 Errno:1 Operation not permitted
Error: Optional(Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x600003e3c4b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, NSErrorFailingURLStringKey=https://some_valid_url, NSErrorFailingURLKey=https://some_valid_url, _kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, NSLocalizedDescription=A server with the specified hostname could not be found.})
[] nw_resolver_create_dns_service_locked [C1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
TIC TCP Conn Failed [1:0x60000051d200]: 10:-72000 Err(-65563)
Task <D9356F42-2832-426A-9FE6-C37C0A22F954>.<1> HTTP load failed (error code: -1003 [10:-72000])
Task <D9356F42-2832-426A-9FE6-C37C0A22F954>.<1> finished with error - code: -1003
Program ended with exit code: 0
So then I tried:
Turn on App sandbox and tick both incoming and outgoing connection
Does not work, same error
Turn off App sandbox
Extension disappears in safari preferences
No response when I click "Open in Safari Extensions Preferences"
My config:
Xcode: Version 10.1 (10B61)
Mac: Mojave 10.14.2(18C54)
Safari: 12.0.2(14606.3.4)
Any ideas?
You may need to enable Incoming and Outgoing connections on the app Sandbox to let your requests go thru.

Network connection was lost error

I am trying to connect into realm object server from an app developed with swift on macos
When I try to connect, I get this error "Network connection was lost", but I can open the realm server from the browser without a problem.. btw, this problem happened recently, it was working correctly few weeks ago
let credentials = SyncCredentials.usernamePassword(username: username, password: password)
SyncUser.logIn(with: credentials, server: serverurl) {
user, error in
if let u = user {
onCompletion(syncUser: u, error: nil)
} else if let error = error {
onCompletion(syncUser: nil, error: error)
} else {
onCompletion(syncUser: nil, error: nil)
}
}
Here, user is always nil and the error description is Network connection was lost
This happens with both a local server and one hosted on digitalocean
Server version 1.8.3
xcode console log
2018-01-15 12:46:07.077741+0300 Oncobase[8138:9497304]
ApplePersistence=NO 2018-01-15 12:46:07.207859+0300
Oncobase[8138:9497813] dnssd_clientstub ConnectToServer: connect()->
No of tries: 1 2018-01-15 12:46:08.218889+0300 Oncobase[8138:9497813]
dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
2018-01-15 12:46:09.228932+0300 Oncobase[8138:9497813]
dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
2018-01-15 12:46:10.239595+0300 Oncobase[8138:9497813]
dnssd_clientstub ConnectToServer: connect() failed
path:/var/run/mDNSResponder Socket:16 Err:-1 Errno:1 Operation not
permitted 2018-01-15 12:46:10.239850+0300 Oncobase[8138:9497813] []
nw_resolver_create_dns_service_locked
DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2018-01-15 12:46:10.240322+0300 Oncobase[8138:9497813] TIC TCP Conn
Failed [1:0x600000163300]: 10:-72000 Err(-65563) 2018-01-15
12:46:10.257327+0300 Oncobase[8138:9497796] Task
.<1> HTTP load failed (error
code: -1003 [10:-72000]) 2018-01-15 12:46:10.257548+0300
Oncobase[8138:9497796] Task .<1>
finished with error - code: -1003 2018-01-15 12:46:23.852072+0300
Oncobase[8138:9497838] [] nw_socket_connect connectx failed (fd 16,
127.0.0.1:9080 stream, pid: 8138, sanitized url: http://127.0.0.1:9080/auth): [1] Operation not permitted 2018-01-15
12:46:23.852142+0300 Oncobase[8138:9497838] []
nw_socket_get_input_frames recvmsg(fd 16, 1024 bytes): [57] Socket is
not connected 2018-01-15 12:46:23.852284+0300 Oncobase[8138:9497838]
TIC TCP Conn Failed [2:0x600000169b40]: 1:57 Err(57) 2018-01-15
12:46:23.852618+0300 Oncobase[8138:9497838] Task
<91597B31-6AB4-41BB-A5A6-C32525BC8A67>.<2> HTTP load failed (error
code: -1005 [1:57]) 2018-01-15 12:46:23.853839+0300
Oncobase[8138:9497798] Task <91597B31-6AB4-41BB-A5A6-C32525BC8A67>.<2>
finished with error - code: -1005
Edit 1: I have just enabled sandboxing to be able to upload the app into apple app store.. could this be the issue? any workaround?
It seems sandboxing was the real problem
I had to enable Ingoing Connections and Outgoing Connections with sandboxing for this to work
You have to off the "App Sandbox".
Go to: xcode Project-> Capabilities -> App SandBoxScreenShot

Getting 500 Internal server error from application deployed on IHS and WAS server

Web based application intermittently throwing '500 Internal Server Error'. This application is deployed on WAS 8.0 server with IHS and WAS servers hosted on different machines. Please find below the TRACE level plugin logs at IHS end.
DEBUG: ws_common: websphereExecute: Wrote the request; reading the response (timeout 900)
DETAIL: lib_htresponse: htresponseRead: Reading the response: 64040a70 TRACE: lib_rio: Blocking for read, waiting 900
DEBUG: lib_rio.c line 896 : Read failed, rc=104
DEBUG: lib_htresponse: htresponseSetError: Setting the error to: |READ_FAILED|(1, Line: 713)
DEBUG: ws_common: websphereExecute: Failed to read from an old stream; probably Keep-Alive timeout fired
DEBUG: ws_transport: transportStreamDequeue: Checking for existing stream from the queue
DEBUG: lib_stream: destroyStream: Destroying the stream
DEBUG: lib_rio: rclose: socket 13 closed
STATS: ws_server: serverSetFailoverStatus: Server xxxxx : pendingRequests 0 failedRequests 7 affinityRequests 57 totalRequests 51.
ERROR: ws_common: websphereHandleRequest: Failed to execute the transaction to 'xxxxx' on host 'yyyyy'; will try another one
ERROR: ws_common: websphereWriteRequestReadResponse: Failed to find an app server to handle this request
ERROR: ESI: getResponse: failed to get response: rc = 10 DEBUG: ESI: esiHandleRequest: failed to get response
DEBUG: ESI: esiRequestUrlStackDestroy
DEBUG: ESI: cacheURL: '/site/index'
DETAIL: ESI: esiRequestPopUrl: '/site/index'
DEBUG: ESI: esiUrlDestroy: '/site/index'
ERROR: [://site/index] ws_common: websphereHandleRequest: Failed to handle request rc=10
DEBUG: ws_common: websphereCloseConnection
DETAIL: ws_common: websphereEndRequest: Ending the request
Please help me to get the issue resolved. Thanks in advance
rc=104 is the linux return code indicating that the socket was reset by the partner address so you need to look at the application server for errors.