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

Unexpected behavior when running RethinkDB with bind=all #5844

Closed
Baterka opened this issue Sep 1, 2020 · 6 comments
Closed

Unexpected behavior when running RethinkDB with bind=all #5844

Baterka opened this issue Sep 1, 2020 · 6 comments

Comments

@Baterka
Copy link

Baterka commented Sep 1, 2020

Describe the bug
When I start RethinkDB service (https://github.com/rethinkdb/rethinkdb) in WSL2 with bind=all in the config, service is not accessible from Windows Host with error: ReqlDriverError: None of the pools have an opened connection and failed to open a new one.

Not tested on other services. Seems like there is some unexpected behavior when running some service on all interfaces.

To Reproduce
Steps to reproduce the behavior:

  1. Install WSL2 on Windows machine
  2. Install RethinkDB (https://github.com/rethinkdb/rethinkdb)
  3. Set bind=all in the config of RethinkDB
  4. Start service
  5. Try to connect to the server from Windows host (With for example NodeJS module rethinkdbdash)

Expected behavior
Should connect successfully.

System info

  • OS: Windows 10 2004 (Build 19041.450) with latest WSL2 (Debian 9, latest kernel)
  • RethinkDB Version: 2.4.1~0buster (CLANG 7.0.1 (tags/RELEASE_701/final))

Additional context
Related issue on RethinkDB: rethinkdb/rethinkdb#6914

If I remove bind=all from config it works fine. Seems like there is some unexpected behavior when running on all interfaces in WSL2

@therealkenc
Copy link
Collaborator

If in step 5 (or step 2) you've got the the string 'localhost' or '127.0.0.1' in the mix, evens you're looking at a variation of #5706. Have a look at netstat -nl (Linux side) and netstat.exe /an (Windows side) and see what address the RethinkDB port (29015?) is listening. Could possibly coerce a look-see with CLI repro steps.

@therealkenc therealkenc changed the title Unexpected behavior when running service on all interfaces (Tested with rethinkdb) Unexpected behavior when running RethinkDB with bind=all Sep 2, 2020
@therealkenc
Copy link
Collaborator

/dupe #4851 #5298

image

@ghost
Copy link

ghost commented Sep 3, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost closed this as completed Sep 3, 2020
@ghost ghost added the duplicate label Sep 3, 2020
@Baterka
Copy link
Author

Baterka commented Sep 3, 2020

/dupe #4851 #5298

image

Not seems like dupe to me...

The problem is that 8080 works fine and I am able to access RethinkDB admin panel from host by "localhost:8080" url, but I am unable to connect to 28015 server by any driver.

@therealkenc
Copy link
Collaborator

You need to (a) get (quoth) "any driver" to use ipv6 or (b) get RethinkDB to listen on ipv4.

You can oftentimes achieve (a) with avahi-daemon(8) per earlier cited #5706, since it will cough up an ipv6 address given a name, if it is asked nicely. Looks something like: sudo service dbus start and sudo service avahi-daemon start, after editing /etc/avahi/avahi-daemon.conf.

@therealkenc
Copy link
Collaborator

Was mildly enough curious to see if avahi-daemon would take in the scenario, and it does. I needed to configure with ipv4=no and ipv6=yes.

server = 'wsl.local';
addr = '';
require('dns').lookup(server, (err, address, family) => {
    addr = address;
});

r = require('rethinkdb')
conn = r.connect({ host: 'wsl.local', port: 28015 }, (err, conn) => {
  if(err) {
      console.log(err);
      throw err;
  }
  console.log('connected to', server, 'on', addr);
  // r.db('test').tableDrop("foo").run(conn);
  tables = r.dbList().run(conn).then((list) => {
    console.log(list);
  });
});

image

You're effectively hitting rethinkdb/rethinkdb#1897 (message and message). Which like it says over there "[will] usually work for both IPv4 as well as IPv6 interfaces, despite the fact that they are being listed as tcp6". We're not in the "usually" club because #5706.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants