Closed jchannon closed 11 years ago
also tried:
IConnection connection = new RethinkDb.Connection();
connection.AuthorizationKey = "mykey";
connection.EndPoints = new EndPoint[] { new IPEndPoint(IPAddress.Parse("192.241.199.61"), 49268), };
connection.Connect();
Hi Jonathan,
Can you describe what happens in more detail than "can't connect"? Do you get an exception, and if so, what does it say? Regarding your first example, putting "http://" into the DnsEndPoint constructor is a mistake that would prevent this from working correctly.
Hi,
It just hangs on the Connect line.
Thanks
Is the port you're using the same port that you would use to connect in a web browser (eg. http://shared1.rethinkdbcloud.com:49268/)? If so, it's the port of the web interface, and not the correct port for any RethinkDB client to connect to. That seems like a likely cause of a hang on Connect().
Hi Guys,
I'm on the RethinkDB Cloud team and have confirmed with jchannon that he can connect with the same credentials using the Javascript client. The free instances are currently running RethinkDB 1.7.2 (updating new instances to 1.9 late tonight), maybe it has an issue connecting to older instances?
Hi!
Here's the code that works in node.js
r = require('rethinkdb');
var connection = null;
r.connect( {host: 'shared1.rethinkdbcloud.com', port: 49268, authKey:'mykey'}, function(err, conn) {
if (err) throw err;
console.log('connected')
connection = conn;
})
Hm, I can't see any reason why we wouldn't be compatible with RethinkDB 1.7 still, mostly. Some queries might not work correctly, but I can't see anything that would affect connecting. Is that auth key really "mykey"? Can I attempt to reproduce and debug this issue with that connection information?
No its not "mykey", shall I email it to you?
The auth key is not actually "mykey". I will spin up an instance for you to reproduce/debug with and will delete the instance later tonight. Gimme 1 min and I'll post the credentials you will need to connect.
Here's an instance for you to try and I have confirmed it works with the Python client.
host: shared1.rethinkdbcloud.com port: 49269 auth key: ZXNF8A47H72V
using async code it results in this - I assume after a timeout
RethinkDb.RethinkDbNetworkException: Failed to resolve a connectable address.
at RethinkDb.Connection.c__async0.MoveNext()
I was able to run unit tests successfully against the database connection provided by @ConceitedCode (port 49269); although there are a few errors due to the incompatibility with RethinkDB 1.7, the connection worked just fine.
Against @jchannon's database (port 49268), I can't even establish a network connection with telnet
, so this is probably why the Connect() method appears to hang:
[mfenniak@ux32vd apislice]$ telnet shared1.rethinkdbcloud.com 49269
Trying 192.241.199.61...
Connected to shared1.rethinkdbcloud.com.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
[mfenniak@ux32vd apislice]$ telnet shared1.rethinkdbcloud.com 49268
Trying 192.241.199.61...
^C
Well that's strange. @jchannon, Do you mind double checking that you are still able to connect using the Javascript client?
Connection failed :(
Doesn't look like it's on the client side. The instance @jchannon is trying to connect to has crashed for some reason. Thanks for the help @mfenniak.
@jchannon, I'll restart the instance for you and investigate why it crashed.
I'm guessing all the attempts to connect to it crashed it!
@mfenniak what would be your code recommendation on connecting?
Please re-open if the issue persists in some similar way, I'm glad to help out.
@jchannon, by the way, the code I'd recommend to create the database connection (back to your first two posts) would be this:
var connection = ConfigConnectionFactory.Instance.Get("testCluster");
connection.Connect(); // or await connection.ConnectAsync();
Plus an App.config/Web.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="rethinkdb" type="RethinkDb.Configuration.RethinkDbClientSection, RethinkDb"/>
</configSections>
<rethinkdb>
<clusters>
<cluster name="testCluster" authorizationKey="mykey">
<endpoints>
<endpoint address="shared1.rethinkdbcloud.com" port="12345"/>
</endpoints>
</cluster>
</clusters>
</rethinkdb>
</configuration>
Also, FYI, rethinkdb-net shouldn't have hung when attempting to connect. We have an outstanding issue (#62) relating to Connect not timing out properly as configured.
I don't think the free instance is in a cluster so I assume that web.config approach would fail!
Thanks for the help
It will work. The "cluster" option in the config file just allows you to specify multiple endpoints. If you only specify one, it will only connect to one.
Just to let you know I created a new instance and tested it with node and all ok.
Tested with C# and failed
var connection = ConfigConnectionFactory.Instance.Get("testCluster");
connection.Connect(); // or await connection.ConnectAsync();
var result = connection.Run(Query.DbCreate("movies"));
<configSections>
<section name="rethinkdb" type="RethinkDb.Configuration.RethinkDbClientSection, RethinkDb"/>
</configSections>
<rethinkdb>
<clusters>
<cluster name="testCluster" authorizationKey="7WNTV6OMSEEW">
<endpoints>
<endpoint address="shared1.rethinkdbcloud.com" port="49275"/>
</endpoints>
</cluster>
</clusters>
</rethinkdb>
I've written a test program to connect to the new port 49275 database as you've indicated. It works for me. Can you please download this source archive, build it, and give it a try?
That connects fine!
Odd
My attempt was in a ASP.Net application
Confirm, I can connect using latest pull as well.
KG
On Tue, Sep 17, 2013 at 10:05 AM, Jonathan Channon <notifications@github.com
wrote:
That connects fine!
Odd
My attempt was in a ASP.Net application
— Reply to this email directly or view it on GitHubhttps://github.com/mfenniak/rethinkdb-net/issues/129#issuecomment-24595425 .
I'm using nuget and Asp.Net
I just used Mathieu's build and was able to connect, as well.
Let me try and run as an ASP.net application instead of a console app.
KG
On Tue, Sep 17, 2013 at 10:18 AM, Jonathan Channon <notifications@github.com
wrote:
I'm using nuget and Asp.Net
— Reply to this email directly or view it on GitHubhttps://github.com/mfenniak/rethinkdb-net/issues/129#issuecomment-24596525 .
Try using nuget and not the git repo
The build that Mathieu sent out uses v.0.4 of the rethinkdb-net driver from nuget. That's what I used the second time and was able to connect from his console app. My apologies for not clarifying.
I will use the same nuget package in this test web application.
Sorry for adding to confusion.
KG
On Tue, Sep 17, 2013 at 10:23 AM, Jonathan Channon <notifications@github.com
wrote:
Try using nuget and not the git repo
— Reply to this email directly or view it on GitHubhttps://github.com/mfenniak/rethinkdb-net/issues/129#issuecomment-24596980 .
There may be a problem with the nuget package; it has a dependency on "any version" of protobuf-net, but dropping the newest version in-place doesn't seem to work. This did cause me a runtime failure that I was able to get around by installing an explicit version of protobuf-net; however, it's not a Connect() failure as documented here, it was an assembly loading problem.
I'm going to go ahead and push a new version of the nuget package to fix this problem.
I've reproduced the reported issue under ASP.NET on Windows. It doesn't seem specific to rethinkdbcloud.com, so I've opened a new issue for it, #130, that I am populating with information right now.
Thanks christ! Thought I was going mental :smile: If you need a hand let me know!
I thought you were going mental too, if that helps you feel any better. ;-) It's a weird issue, and the rethinkdbcloud.com involvement was a red herring that threw the investigation off. Thanks for reporting this and sticking with us to get a good diagnosis of the environment needed to reproduce it; whatever it is is a serious problem standing in the way of using rethinkdb-net in a web application.
I've created a free instance on rethinkdbcloud.com but can't connect using the below code. Is something wrong?