Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS - FirebaseDatabase ConnectToServer: connect() failed #3033

Closed
bobmosh opened this issue May 18, 2019 · 7 comments
Closed

macOS - FirebaseDatabase ConnectToServer: connect() failed #3033

bobmosh opened this issue May 18, 2019 · 7 comments
Assignees
Labels
api: database macOS Issues or feature requests for macOS.

Comments

@bobmosh
Copy link

bobmosh commented May 18, 2019

Hey guys,
I'm running into an issue with Firebase for macOS.

  • Xcode version: 10.2.1
  • Firebase SDK version: ~> 6.0
  • Firebase Component: Database
  • Component version: 6.0

The problem I'm running into is that while I am able to call FirebaseApp.configure() in my app, Database.database().reference gives me this output to the console:

2019-05-18 20:25:40.710707+0200 Ambience[13823:520408] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
2019-05-18 20:25:41.714530+0200 Ambience[13823:520408] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
2019-05-18 20:25:42.714807+0200 Ambience[13823:520408] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
2019-05-18 20:25:43.720178+0200 Ambience[13823:520408] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:5 Err:-1 Errno:1 Operation not permitted
2019-05-18 20:25:43.720489+0200 Ambience[13823:520408] [] nw_resolver_create_dns_service_locked [C1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2019-05-18 20:25:43.721079+0200 Ambience[13823:520701] [] nw_connection_get_connected_socket [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-05-18 20:25:43.721125+0200 Ambience[13823:520701] TCP Conn 0x6000037000c0 Failed : error 0:-65563 [-65563]

The issue occurs whenever I try to get the reference of the database or if I try goOnline(). Any ideas of how to solve this?

Here's the only code from Firebase that I have in my project.

FirebaseApp.configure()
Database.database().reference()
@bobmosh bobmosh changed the title FirebaseDatabase ConnectToServer: connect() failed macOS - FirebaseDatabase ConnectToServer: connect() failed May 18, 2019
@morganchen12
Copy link
Contributor

Are you able to access the database without errors when running the database quickstart?

@morganchen12 morganchen12 self-assigned this May 18, 2019
@bobmosh
Copy link
Author

bobmosh commented May 18, 2019

Hey @morganchen12 sorry I should have been more clear. I am trying the version for macOS, the iOS connection works just fine. Have just created my partner app for iOS and it works like a charm. My macOS application however can not access the database.

@Jaycyn
Copy link

Jaycyn commented May 19, 2019

It might be issue 2248

Just for reference, check out some other info on issue 3032 which may or may not help - the info applies to both Firebase Realtime Database and Firestore initializing. Once we made the changes per that thread things worked much more consistently.

@bobmosh
Copy link
Author

bobmosh commented May 19, 2019

Hey @visdyn that's a good point. Issue 3032 I had looked at before and tried working with Firestore as well. Issue 2248 was new to me, but unfortunately (or fortunately) my CocoaPods install added the -ObjC flags properly and that was no issue at all. My Database reference is also not null as you can see in the screenshot I attached.

Bildschirmfoto 2019-05-19 um 18 32 17

Still tapping in the dark here what is going wrong. My Database is as open as can be, so access should not be an issue.

Thanks for the help so far though. I'm starting to wrap my head around how things work with firebase.

@morganchen12 morganchen12 added the macOS Issues or feature requests for macOS. label May 19, 2019
@bobmosh
Copy link
Author

bobmosh commented May 20, 2019

Little update: Still no successful connection from my macOS app. Have coded a simple WebApp using straight JS and it can - just like my iOS client - successfully access the Database. So access to the database and rules etc. should not be the issue.

Is there a previous version I could try to install? If so, how could I do that?

@bobmosh
Copy link
Author

bobmosh commented May 20, 2019

Another quick little update, I tried out installing using CocoaPods from branch 'release-6.1.0', 'release-5.20.0', 'release-5.15.0' as well as 'fcm-iid-macos' and 'tvOS_master'. None of these worked and they all produced the same issue. The issue I described in the first post.

@bobmosh
Copy link
Author

bobmosh commented May 20, 2019

Oh, don't mind me. I found out what was going wrong. The keyword is "sandboxing"! For some reason never thought of this to be the issue.

To get this working simply deactivate sandboxing for your target (or allow outgoing/incoming network connections). Oh my I feel so stupid right now for banging my head against the wall for days because I forgot to disable a single switch.

Bildschirmfoto 2019-05-20 um 17 50 15

If anyone ever finds this in the archive, please try sandboxing first. :)

@bobmosh bobmosh closed this as completed May 20, 2019
@firebase firebase locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: database macOS Issues or feature requests for macOS.
Projects
None yet
Development

No branches or pull requests

4 participants