Can't run tests - fails to connect

23 views
Skip to first unread message

Tim Fox

unread,
May 16, 2022, 10:32:19 AM5/16/22
to Jepsen Talk
Hello All,

I am new to Jesper and trying to work through the tutorial but hitting a wall on trying to run a test for the first time.

I have got all the Jesper nodes running fine using docker compose (following the instructions from the docker directory) on my laptop (MacOS).

But when trying to run `lein run test` it times out and eventually fails with:

clojure.lang.ExceptionInfo: throw+: {:dir "/", :private-key-path nil, :password "root", :username "root", :type :jepsen.control/session-error, :port 22, :strict-host-key-checking false, :host nil, :sudo nil, :dummy false, :message "Error opening SSH session. Verify username, password, and node hostnames are correct.", :session nil}

So presumably I need to specify --username --password --private-key-path etc? I have tried various combinations but couldn't get anything to work. What username is docker expecting? Is it supposed to the username of the user running the demo? This part wasn't clear to me.

Any help greatly appreciated.

Kyle Kingsbury

unread,
May 16, 2022, 12:43:34 PM5/16/22
to ta...@jepsen.io
On Mon, 2022-05-16 at 07:32 -0700, 'Tim Fox' via Jepsen Talk wrote:
> Hello All,
>
> I am new to Jesper and trying to work through the tutorial but
> hitting a wall on trying to run a test for the first time.
>
> I have got all the Jesper nodes running fine using docker compose
> (following the instructions from the docker directory) on my laptop
> (MacOS).
>
> But when trying to run `lein run test` it times out and eventually
> fails with:
>
> clojure.lang.ExceptionInfo: throw+: {:dir "/", :private-key-path nil,
> :password "root", :username "root", :type :jepsen.control/session-
> error, :port 22, :strict-host-key-checking false, :host nil, :sudo
> nil, :dummy false, :message "Error opening SSH session. Verify
> username, password, and node hostnames are correct.", :session nil}

Are you running this command on your OS X laptop, or inside the control
node set up as a part of the docker-compose task? The SSH keys and
hostname resolution for n1, n2, etc are only set up inside that control
node--if you want them to work on your OS X host, you'll need to copy
the SSH keys out, set up hostnames pointing to the docker virtual
interfaces, and so on.

--Kyle

Tim Fox

unread,
May 16, 2022, 12:55:17 PM5/16/22
to Jepsen Talk, ap...@jepsen.io
I'm basically trying to run the tutorial here: https://github.com/jepsen-io/jepsen/blob/main/doc/tutorial/01-scaffolding.md

I created a directory on my laptop and followed the steps until the first `lein run test` which failed.

AIUI, you're saying that this all has to be done from within the control node? Not from a directory on my laptop? I'm a little confused here - the control node can't see the directory on my laptop (outside the container), where I'm developing the test. Trying to wrap my head around how the development model is supposed to work here. 

Kyle Kingsbury

unread,
May 16, 2022, 12:59:37 PM5/16/22
to Tim Fox, Jepsen Talk
On Mon, 2022-05-16 at 09:55 -0700, Tim Fox wrote:
> AIUI, you're saying that this all has to be done from within the
> control node? Not from a directory on my laptop? I'm a little
> confused here - the control node can't see the directory on my laptop
> (outside the container), where I'm developing the test. Trying to
> wrap my head around how the development model is supposed to work
> here. 

You need to have SSH access to the nodes you want to run your test
against. You can set that up on your own laptop, but that's your
responsibility--it'd be a bit dangerous/impolite for the docker scripts
to go mucking around in your SSH config and /etc/hosts, haha.

For convenience, the docker setup also builds a control node in docker
which has SSH access all ready to go--docker start script should have
printed out a message to log in to that node when it completed. If you
want to use that control node, you'll have to get your test code onto
it somehow. I think docker has a thing to mount local directories that
might be handy? I dunno, I don't really use Docker much myself.

Mostly I develop with LXC/VMs, which makes this sort of thing a bit
more straightforward--my local machine is my control node and I have
direct SSH access to the nodes.

--Kyle


JS

unread,
May 16, 2022, 5:01:54 PM5/16/22
to Jepsen Talk, ap...@jepsen.io, Tim Fox
If you
want to use that control node, you'll have to get your test code onto
it somehow. I think docker has a thing to mount local directories that
might be handy?

Jepsen's bin/up --dev will mount ${JEPSEN_ROOT}, which defaults to the directory you cloned Jepsen into.

Mostly I develop with LXC/VMs, which makes this sort of thing a bit
more straightforward--my local machine is my control node and I have
direct SSH access to the nodes.

 Echoing the benefits of LXC.
The nodes with their ports are just there in a standard fashion. E.g. it's easy to connect an Erlang shell and observer to a running system with expected defaults.

Reply all
Reply to author
Forward
0 new messages