[rabbitmq-discuss] [Fwd: erlang-client woes]

Ben Hood 0x6e6562 at gmail.com
Thu Jun 4 16:41:41 BST 2009


Jack,

On Thu, Jun 4, 2009 at 4:01 PM, Jack Moffitt <jack at collecta.com> wrote:
>> So just to be clear, the test_network and test_direct tests pass, but
>> you are encountering problems when running your own code? If so, please
>> post a reproducible test case and I am sure we will be able to track
>> down the cause of the behaviour you are seeing.
>
> No rabbitmq running, make test_direct passes.  Launch rabbitmq, make
> test_network passes.
>
> Then:
>
> sliver:~/Sources/rabbitmq-erlang-client $ ~/rabbitmq/sbin/rabbitmqctl
> list_usersListing users ...
> guest
> jack
> ...done.
>
> And now:
>
> sliver:~/Sources/rabbitmq-erlang-client $ erl -name
> client at sliver.local -pa ebin ~/rabbitmq/ebin
> Erlang R13B (erts-5.7.1) [source] [smp:2:2] [rq:2] [async-threads:0]
> [hipe] [kernel-poll:false]
>
> Eshell V5.7.1  (abort with ^G)
> (client at sliver.local)1> Conn = amqp_connection:start("jack", "hackme").
> ** exception error: no match of right hand side value
>                    {error,{aborted,{no_exists,[user,<<"jack">>]}}}
>     in function  amqp_connection:start/3
>
> And:
>
> (client at sliver.local)3> Conn = amqp_connection:start("jack", "hackme",
> "localhost").
>
> hangs.  If I use "guest", "guest" instead of "jack", "hackme", in the
> network version, it will work.  However, "guest", "guest" does not
> work for the direct version.  It gives the same error as above with
> either username,password pair.

Invoking amqp_connection:start/2 implies that you are trying to use
the direct client.

I suspect that you have not started Rabbit or Mnesia in this VM.

To find this out, tell what the output of which_applications/0 is, e.g.

3> application:which_applications().
[{rabbit,"RabbitMQ","%%VERSION%%"},
 {mnesia,"MNESIA  CXC 138 12","4.4.7"},
 {os_mon,"CPO  CXC 138 46","2.1.8"},
 {sasl,"SASL  CXC 138 11","2.1.5.4"},
 {stdlib,"ERTS  CXC 138 10","1.15.5"},
 {kernel,"ERTS  CXC 138 10","2.12.5"}]

If Rabbit and Mnesia are not there, then the broker instance cannot start.

One way to start these is to have them boot when you start the VM,
i.e. with these args:

erl -pa ebin rabbitmq_server/ebin -mnesia dir <SOME DIR> -s rabbit
-boot start_sasl

Doing this without adding your own user should result in an error like this:

{amqp,access_refused,"login refused for user 'jack'",none}

Which of course would be understandable if the mnesia instance in
<SOME DIR> did not contain that user.

HTH,

Ben




More information about the rabbitmq-discuss mailing list