Skip to content

Connect using authentication - Timeout in TLS [JIRA: CLIENTS-666] #112

Open
@hytvi

Description

@hytvi

So I was doing my final testing before putting my application in production, and now authenticated connections don't seem to work anymore.

-- /etc/var/riak/error.log

2015-11-23 10:06:41.048 [error] <0.31692.39> gen_fsm <0.31692.39> in state wait_for_tls terminated with reason: {error,{startls_failed,closed}}
2015-11-23 10:06:41.048 [error] <0.31692.39> CRASH REPORT Process <0.31692.39> with 0 neighbours exited with reason: {error,{startls_failed,closed}} in gen_fsm:terminate/7 line 622
2015-11-23 10:06:41.049 [error] <0.330.0> Supervisor riak_api_pb_sup had child undefined started with {riak_api_pb_server,start_link,undefined} at <0.31692.39> exit with reason {error,{startls_failed,closed}} in context child_terminated`

-- connection code

var nodes = [];
hosts.forEach(function (host) {
     var hostPort = host.split(':');

      nodes.push(new Riak.Node({
           remoteAddress: hostPort[0],
            remotePort: hostPort[1],
            auth: {
                user: options.auth.user,
                password: options.auth.password
            },
            connectionTimeout: 1000,
            cork: true
        }));
});

riakClient = new Riak.Client(new Riak.Cluster({nodes: nodes}));

riakClient.ping(function (err) {
            if (err) {
                callback(new Error(err));
            }
            else {
                callback(undefined);
            }
        });
}

--- Application output

error: [RiakConnection] Failed to connect: *ip censored* port: 8087 error: RiakConnection Timed out trying to connect
error: [RiakConnection] Failed to connect: *ip censored* port: 8087 error: RiakConnection Timed out trying to connect
error: [RiakConnection] Failed to connect:  *ip censored* port: 8087 error: RiakConnection Timed out trying to connect
error: [RiakConnection] Failed to connect:  *ip censored* port: 8087 error: RiakConnection Timed out trying to connect
✖ testAuthenticatedConnection

Assertion Message: Could not connect to Riak: Error: No RiakNodes available to execute command.
AssertionError: Could not connect to Riak: Error: No RiakNodes available to execute command.
    at Object.equal (/usr/local/lib/node_modules/nodeunit/lib/types.js:83:39)
    at /*sensored (my_app_dir)*/test/connection.js:39:14
    at Ping.callback (*sensored (my_app_dir)*/lib/RiakHelper/RiakHelper.js:65:21)
    at Ping.CommandBase._callback (*sensored (my_app_dir)*/node_modules/basho-riak-client/lib/commands/commandbase.js:74:19)
    at Ping.CommandBase.onError (*sensored (my_app_dir)*/node_modules/basho-riak-client/lib/commands/commandbase.js:168:10)
    at RiakCluster.execute *sensored (my_app_dir)*/node_modules/basho-riak-client/lib/core/riakcluster.js:212:25)
    at RiakCluster._onRetryCommand (*sensored (my_app_dir)*node_modules/basho-riak-client/lib/core/riakcluster.js:305:10)
    at emitTwo (events.js:87:13)
    at RiakNode.emit (events.js:172:7)
    at /*sensored (my_app_dir)*/node_modules/basho-riak-client/lib/core/riaknode.js:227:30

/usr/local/lib/node_modules/nodeunit/lib/core.js:285
    if (group.setUp) {
             ^

TypeError: Cannot read property 'setUp' of undefined
    at wrapGroup (/usr/local/lib/node_modules/nodeunit/lib/core.js:285:14)
    at Object.exports.runSuite (/usr/local/lib/node_modules/nodeunit/lib/core.js:93:13)
    at /usr/local/lib/node_modules/nodeunit/lib/core.js:125:21
    at /usr/local/lib/node_modules/nodeunit/deps/async.js:513:13
    at iterate (/usr/local/lib/node_modules/nodeunit/deps/async.js:123:13)
    at /usr/local/lib/node_modules/nodeunit/deps/async.js:134:25
    at /usr/local/lib/node_modules/nodeunit/deps/async.js:515:17
    at Immediate._onImmediate (/usr/local/lib/node_modules/nodeunit/lib/types.js:146:17)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Error: No RiakNodes available to execute command

It might be related to issue #104

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions