realm / realm-object-server

Tracking of issues related to the Realm Object Server and other general issues not related to the specific SDK's
https://realm.io
293 stars 42 forks source link

iOS / ROS 3.3 SyncUser.logIn issue #356

Closed ajonno closed 6 years ago

ajonno commented 6 years ago

Goals

login to ROS via iOS using RealmSwift 3.3

Expected Results

successful login

Actual Results

error thrown from the SyncUser.logIn method (note this is currently via HTTP)

image

Note: Realm Studio connects just fine to EC2 http://xx.yyy.ttt.cc:9080 (Contact me via email to get IP address)

2018-04-08 12:08:19.685597+1000 ToDo[5016:3495608] [] nw_socket_connect connectx failed (fd 8, 192.168.0.7:8888 stream, pid: 5016, sanitized url: http://xx.yyy.ttt.cc:9080/auth): [64] Host is down

Steps to Reproduce

I just installed and built (pods etc.) the Realm test project from here: https://github.com/realm/my-first-realm-app/tree/master/ios

in Constants.swift made following changes:

static let MY_INSTANCE_ADDRESS = "xx.yyy.ttt.cc:9080" // <- update this
static let AUTH_URL  = URL(string: "http://\(MY_INSTANCE_ADDRESS)")!

Podfile is this:

# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'

target 'ToDo' do
  use_frameworks!
  pod 'RealmSwift', '~> 3.3.0'
end

I also added the following to info.plist since we we're hitting an HTTP endpoint:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Code Sample

see above. really very little change made to the Realm example project for iOS other than as noted above.

For the server side:

Version of Realm and Tooling

Logs

systemctl status realm-object-server.service realm-object-server.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)
sudo journalctl -u realm-object-server.service -- No entries --
cat /var/log/realm-object-server.log cat: /var/log/realm-object-server.log: No such file or directory
ajonno commented 6 years ago

oky doke so it seems that after restarting ROS - this issue for iOS (only) went away and i could connect to ROS & update the db, get sync, etc

however i really want to understand why, partic given that Droid was working fine both before and after the ROS re-start? hopefully ROS server logs can help with that, let me know what you recommend and ill do some digging.

mgeerling commented 6 years ago

@ajonno , in the email you sent, you said that you were not able to connect to ROS cloud or your self-hosted ROS. It sounds like you've restarted your self-hosted ROS and are not able to connect. Are you able to connect to your cloud instance via iOS now as well?

ajonno commented 6 years ago

hey Matt, good point sorry i forgot about that Realm Cloud piece. I'll try that today and get back to you.

ajonno commented 6 years ago

@mgeerling I tested it out and is working fine on Realm Cloud too. Pretty certain now I mis-configured something, so will close this ticket. Apologies and thanks for the prompt follow up.