question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error printed in the output upon successful opening file

See original GitHub issue

Goals

Open synced realm via Realm.open()

Expected Results

No errors

Actual Results

The promise returns a user object but an error message is printed in the console:

ERROR: Connection[1]: Failed to connect to endpoint '::1:9080': Connection refused
Connection[1]: Connected to endpoint '127.0.0.1:9080' (from '127.0.0.1:63925')

Steps to Reproduce

Running a Node.js app on a macOS laptop, nothing special. The source is below:

Code Sample

const HOST_PORT = 'localhost:9080';
const RW_USER = 'user1@realm';
const RW_PASS = 'password';
const FILE_NAME = 'test_259';

'use strict';

const Realm = require('realm');

const PersonSchema = {
  name: 'Person',
  properties: {
    id: {type: 'string'},
    name: {type: 'string'}
  }
};

Realm.Sync.User.login('http://'+HOST_PORT+'/', RW_USER, RW_PASS)
.then(user => {
  console.log("SUCCESS LOGIN: connected...");

  Realm.open({
    sync: {
      user: user,
      url: 'realm://'+HOST_PORT+'/~/'+FILE_NAME
    },
    schema: [PersonSchema],
    schemaVersion: 1
  })
  .then(realm => {
    console.log("SUCCESS OPEN: file created...");
  })
})

Version of Realm and Tooling

  • Realm JS SDK Version: realm: latest on npm
  • Node or React Native: Node.js
  • Client OS & Version: macOS 10.12.6

To clarify a bit more: The API works as expected, except for printing out an error message in the console. I’d recommend If there is no actual error avoid confusing the developers, and in case there is an actual error - the open file API shouldn’t work.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bdashcommented, Nov 27, 2017

I wrote up an issue against the underlying sync component as I believe that’s where this is determined.

0reactions
sync-by-unito[bot]commented, May 26, 2021

➤ Brian Munkholm commented:

Closing as this is relating to the now deprecated sync solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: printing txt file in c++ only print "0" - Stack Overflow
I am just trying to print this simple txt file. It opens correctly because it is successful per the code, but I am...
Read more >
Opening a file for reading which if fail, error messages ...
a very simple 'exception handling' when opening file for reading. There is no testfileio.txt at the root of C drive at the beginning....
Read more >
You receive error messages when opening an Office document
This issue occurs when you open a file from a mapped drive, a UNC path, or a URL (web address). Cause. This issue...
Read more >
Error Handling in C | Scaler Topics
This article by Scaler Topics defines different types of errors that we encounter while performing operations of file handling in C.
Read more >
C Programming - File Input/Output
Check to make sure the file was successfully opened by checking to see if the variable == NULL. If it does, an error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found