Search code examples
ubunturealmrealm-mobile-platform

Realm Object Server on Digital Ocean using Ubuntu Server


I am using Realm Object Server running on Digital Ocean the lowest option ($5/month) on Ubuntu server. I keep getting connection refused errors; and I don't know if the error is from DO or ROS.

I am no expert on Ubuntu; therefore, I went in and cleared all the logs from /var/log and tried to reconnect. When there are large records to sync I keep getting the following error (on iOS, the client side):

2017-07-05 18:55:46.983543+0300 Torba[1783:2024434] Sync: Connection[1]: Resolving '207.154.251.37:9080'
2017-07-05 18:55:46.986087+0300 Torba[1783:2024434] Sync: Connection[1]: Connecting to endpoint '207.154.251.37:9080' (1/1)
2017-07-05 18:55:47.045242+0300 Torba[1783:2024434] Sync: Connection[1]: Failed to connect to endpoint '207.154.251.37:9080': Connection refused
2017-07-05 18:55:47.045387+0300 Torba[1783:2024434] Sync: Connection[1]: Failed to connect to '207.154.251.37:9080': All endpoints failed
2017-07-05 18:55:47.125378+0300 Torba[1783:2024434] Sync: Connection[3]: Resolving '207.154.251.37:9080'
2017-07-05 18:55:47.126805+0300 Torba[1783:2024434] Sync: Connection[3]: Connecting to endpoint '207.154.251.37:9080' (1/1)
2017-07-05 18:55:47.178626+0300 Torba[1783:2024434] Sync: Connection[3]: Failed to connect to endpoint '207.154.251.37:9080': Connection refused
2017-07-05 18:55:47.178830+0300 Torba[1783:2024434] Sync: Connection[3]: Failed to connect to '207.154.251.37:9080': All endpoints failed
2017-07-05 18:55:49.677104+0300 Torba[1783:2024434] Sync: Connection[1]: Resolving '207.154.251.37:9080'
2017-07-05 18:55:49.678640+0300 Torba[1783:2024434] Sync: Connection[1]: Connecting to endpoint '207.154.251.37:9080' (1/1)
2017-07-05 18:55:49.727078+0300 Torba[1783:2024434] Sync: Connection[1]: Failed to connect to endpoint '207.154.251.37:9080': Connection refused
2017-07-05 18:55:49.727283+0300 Torba[1783:2024434] Sync: Connection[1]: Failed to connect to '207.154.251.37:9080': All endpoints failed

On the ubuntu side, after clearing all the logs, there is one log created again when I try to connect to the server, appport.log, here are the contents:

ERROR: apport (pid 32499) Wed Jul  5 15:55:15 2017: called for pid 32448, signal 6, core limit 18446744073709551615
ERROR: apport (pid 32499) Wed Jul  5 15:55:15 2017: ignoring implausibly big core limit, treating as unlimited
ERROR: apport (pid 32499) Wed Jul  5 15:55:15 2017: executable: /usr/lib/realm-object-server-developer/node/bin/node (command line "/usr/lib/realm-object-server-developer/node/bin/node /usr/bin/realm-object-server -c /etc/realm/configuration.yml")
ERROR: apport (pid 32499) Wed Jul  5 15:55:15 2017: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 32499) Wed Jul  5 15:55:15 2017: apport: report /var/crash/_usr_lib_realm-object-server-developer_node_bin_node.999.crash already

From the logs I can't figure out if the error is on the Realm side or the Digital Ocean side. Can anybody help, any ideas?


Solution

  • After reading the logs carefully, I found out that Realm Object Server was crashing. I don't know why yet, but now I know the problem is with the ROS.

    * EDIT * The app was crashing due to not enough memory. By increasing the server's memory everything started work as expected.

    Jul 05 15:55:33 torba-test systemd[1]: realm-object-server.service: Main process exited, code=killed, status=6/ABRT
    Jul 05 15:55:33 torba-test systemd[1]: realm-object-server.service: Unit entered failed state.
    Jul 05 15:55:33 torba-test systemd[1]: realm-object-server.service: Failed with result 'signal'.
    Jul 05 15:55:34 torba-test systemd[1]: realm-object-server.service: Service hold-off time over, scheduling restart.
    Jul 05 15:55:34 torba-test systemd[1]: Stopped Realm Object Server.