rabbitmq-server won't run (3.3.3)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

rabbitmq-server won't run (3.3.3)

Kyle O'Donnell
Hi,

I just updated to rabbitmq-server 3.3.3 and running ./rabbitmq-server start no longer works.  If I run bash rabbitmq-server start it works fine.

It looks like the following was added in this release, can someone tell me why if this was on purpose?

rabbitmq 3.3.3
$ head -1 rabbitmq-server
#!/bin/sh -e

On rabbitmq 3.0.4:
$ head -1 rabbitmq-server
#!/bin/sh

Thanks,
Kyle


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: rabbitmq-server won't run (3.3.3)

Simon MacMullen-2
On 17/06/2014 2:21PM, Kyle O'Donnell wrote:
> Hi,
>
> I just updated to rabbitmq-server 3.3.3 and running ./rabbitmq-server start no longer works.  If I run bash rabbitmq-server start it works fine.

Hmm, what is /bin/sh on your system? And why are you giving it the
command line flag "start"? - that's not necessary.

> It looks like the following was added in this release, can someone tell me why if this was on purpose?
>
> rabbitmq 3.3.3
> $ head -1 rabbitmq-server
> #!/bin/sh -e
>
> On rabbitmq 3.0.4:
> $ head -1 rabbitmq-server
> #!/bin/sh

It was added on purpose. "-e" means "halt on error", by default sh will
carry on even if something fails. We've had cases where that means
something that should be a comprehensible failure is instead made rather
less comprehensible.

But damn, if that's causing a breakage for you that's not great news.
Are you seeing an error message?

Cheers, Simon

--
Simon MacMullen
RabbitMQ, Pivotal
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: rabbitmq-server won't run (3.3.3)

Kyle O'Donnell
I can't remember where I saw 'start' my mistake, but the same applies whether I use 'start' or not.

I'm running ubuntu 12.04 (x86_64) by the way.

# apt-file search /bin/sh |grep " /bin"
dash: /bin/sh
# dpkg -l dash
ii  dash                        0.5.7-2ubuntu2              POSIX-compliant shell

There are no errors printed to the console:
$ ./rabbitmq-server
$ echo $?
2

I added #!/bin/sh -ex and ran it again and didn't see anything obvious:

./rabbitmq-server
++ dirname ./rabbitmq-server
+ . ./rabbitmq-env
++ SCRIPT_PATH=./rabbitmq-server
++ '[' -h ./rabbitmq-server ']'
+++ dirname ./rabbitmq-server
++ SCRIPT_DIR=.
++ RABBITMQ_HOME=./..
++ '[' x = xs4-test-q001 ']'
++ NODENAME=rabbit@s4-test-q001
++ . ./rabbitmq-defaults
+++ SYS_PREFIX=
+++ ERL_DIR=
+++ CLEAN_BOOT_FILE=start_clean
+++ SASL_BOOT_FILE=start_sasl
+++ CONFIG_FILE=/etc/rabbitmq/rabbitmq
+++ LOG_BASE=/var/log/rabbitmq
+++ MNESIA_BASE=/var/lib/rabbitmq/mnesia
+++ ENABLED_PLUGINS_FILE=/etc/rabbitmq/enabled_plugins
+++ PLUGINS_DIR=./../plugins
+++ CONF_ENV_FILE=/etc/rabbitmq/rabbitmq-env.conf
++ SERVER_ERL_ARGS='+K true +A30 +P 1048576   -kernel inet_default_connect_options [{nodelay,true}]'
++ '[' -f /etc/rabbitmq/rabbitmq.conf ']'
++ '[' -f /etc/rabbitmq/rabbitmq-env.conf ']'
++ true
++ '[' -f ./../etc/rabbitmq-env.conf ']'
++ . ./../etc/rabbitmq-env.conf
+++ RABBITMQ_BASE=/x/s/rabbitmq-server
+++ RABBITMQ_MNESIA_BASE=/x/s/rabbitmq-server/var/lib/mnesia
+++ RABBITMQ_LOG_BASE=/x/s/rabbitmq-server/var/log
+++ RABBITMQ_NODENAME=rabbit
+++ RABBITMQ_CONFIG_FILE=/x/s/rabbitmq-server/etc/rabbitmq
+++ RABBITMQ_NODE_PORT=35672
+++ RABBITMQ_DIST_PORT=35672
+++ RABBITMQ_PLUGINS_DIR=/x/s/rabbitmq-server/plugins
+++ RABBITMQ_ENABLED_PLUGINS_FILE=/x/s/rabbitmq-server/etc/enabled_plugins
+ DEFAULT_NODE_IP_ADDRESS=auto
+ DEFAULT_NODE_PORT=5672
+ '[' x = x ']'
+ RABBITMQ_NODE_IP_ADDRESS=
+ '[' x = x35672 ']'
+ '[' x = x ']'
+ '[' x '!=' x35672 ']'
+ RABBITMQ_NODE_IP_ADDRESS=auto
+ '[' x '!=' xauto ']'
+ '[' x = x35672 ']'
+ '[' x = x35672 ']'
+ '[' x = x35672 ']'
+ '[' x = x35672 ']'
+ '[' x = xrabbit ']'
+ '[' x = x ']'
+ RABBITMQ_SERVER_ERL_ARGS='+K true +A30 +P 1048576   -kernel inet_default_connect_options [{nodelay,true}]'
+ '[' x = x/x/s/rabbitmq-server/etc/rabbitmq ']'
+ '[' x = x/x/s/rabbitmq-server/var/log ']'
+ '[' x = x/x/s/rabbitmq-server/var/lib/mnesia ']'
+ '[' x = x ']'
+ RABBITMQ_SERVER_START_ARGS=
+ '[' x = x ']'
+ RABBITMQ_MNESIA_DIR=
+ '[' x = x ']'
+ RABBITMQ_MNESIA_DIR=/x/s/rabbitmq-server/var/lib/mnesia/rabbit
+ '[' x = x ']'
+ RABBITMQ_PID_FILE=
+ '[' x = x ']'
+ RABBITMQ_PID_FILE=/x/s/rabbitmq-server/var/lib/mnesia/rabbit.pid
+ '[' x = x ']'
+ RABBITMQ_PLUGINS_EXPAND_DIR=
+ '[' x = x ']'
+ RABBITMQ_PLUGINS_EXPAND_DIR=/x/s/rabbitmq-server/var/lib/mnesia/rabbit-plugins-expand
+ '[' x = x/x/s/rabbitmq-server/etc/enabled_plugins ']'
+ '[' x = x/x/s/rabbitmq-server/plugins ']'
+ '[' x = x ']'
+ RABBITMQ_LOGS=
+ '[' x = x ']'
+ RABBITMQ_LOGS=/x/s/rabbitmq-server/var/log/rabbit.log
+ '[' x = x ']'
+ RABBITMQ_SASL_LOGS=
+ '[' x = x ']'
+ RABBITMQ_SASL_LOGS=/x/s/rabbitmq-server/var/log/rabbit-sasl.log
+ RABBITMQ_START_RABBIT=
+ '[' x = x ']'
+ RABBITMQ_START_RABBIT=' -noinput'
+ '[' x = x ']'
+ RABBITMQ_START_RABBIT=' -noinput -s rabbit boot '
+ case "$(uname -s)" in
++ uname -s
+ detached=
+ '[' ']'
++ dirname /x/s/rabbitmq-server/var/lib/mnesia/rabbit.pid
+ mkdir -p /x/s/rabbitmq-server/var/lib/mnesia
+ echo 26755
+ RABBITMQ_EBIN_ROOT=./../ebin
+ RABBITMQ_CONFIG_FILE=/x/s/rabbitmq-server/etc/rabbitmq
+ RABBITMQ_DIST_PORT=35672
+ erl -pa ./../ebin -boot start_clean -noinput -hidden -s rabbit_prelaunch -sname rabbitmqprelaunch26755 -extra rabbit


----- Original Message -----
From: "Simon MacMullen" <[hidden email]>
To: "Discussions about RabbitMQ" <[hidden email]>, "Kyle O'Donnell" <[hidden email]>
Sent: Tuesday, June 17, 2014 9:41:41 AM
Subject: Re: [rabbitmq-discuss] rabbitmq-server won't run (3.3.3)

On 17/06/2014 2:21PM, Kyle O'Donnell wrote:
> Hi,
>
> I just updated to rabbitmq-server 3.3.3 and running ./rabbitmq-server start no longer works.  If I run bash rabbitmq-server start it works fine.

Hmm, what is /bin/sh on your system? And why are you giving it the
command line flag "start"? - that's not necessary.

> It looks like the following was added in this release, can someone tell me why if this was on purpose?
>
> rabbitmq 3.3.3
> $ head -1 rabbitmq-server
> #!/bin/sh -e
>
> On rabbitmq 3.0.4:
> $ head -1 rabbitmq-server
> #!/bin/sh

It was added on purpose. "-e" means "halt on error", by default sh will
carry on even if something fails. We've had cases where that means
something that should be a comprehensible failure is instead made rather
less comprehensible.

But damn, if that's causing a breakage for you that's not great news.
Are you seeing an error message?

Cheers, Simon

--
Simon MacMullen
RabbitMQ, Pivotal
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: rabbitmq-server won't run (3.3.3)

Simon MacMullen-2
On 17/06/2014 2:52PM, Kyle O'Donnell wrote:
> + RABBITMQ_DIST_PORT=35672
> + erl -pa ./../ebin -boot start_clean -noinput -hidden -s rabbit_prelaunch -sname rabbitmqprelaunch26755 -extra rabbit

Damn, I think it's tripping over the test for inet_dist_listen_min /
inet_dist_listen_max. Which come to think of it did use a non-zero
return code. Damn.

Well, that's a bug. Thank you for reporting it. As a workaround you
could do one of:

* Remove -e from the script
* Just use RABBITMQ_DIST_PORT and remove inet_dist_listen_min /
inet_dist_listen_max from your config; they're not needed these days

Cheers, Simon

--
Simon MacMullen
RabbitMQ, Pivotal
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: rabbitmq-server won't run (3.3.3)

dkent
In reply to this post by Kyle O'Donnell
I know exactly why this happens (after a long troubleshooting session.)  it's line 91 of rabbit_prelaunch.erl:
-> rabbit_misc:quit(?DIST_PORT_CONFIGURED)
If the script detects inet_dist_listen_min and inet_dist_listen_max are set, it will exit with DIST_PORT_CONFIGURED, which has a value of 2.  In fact, you can cause the crash and immediately perform "echo $?" from the command line and you'll see the proper code being returned.  In the case of a 0 value, -e (errfail) is not invoked and the rabbitmq-server script may continue. However, that will cause the port to be set to 25672 by rabbitmq-server. You can confirm this with "epmd -names".  In short, rabbit_prelaunch.erl will disrupt rabbitmq-server on any non-zero exit code.

One way to fix this and still keep -e is to add " && :" to the end of the call to ${ERL_DIR}erl on line 98 of rabbitmq-server.  This is one of the operator expressions that will defeat errfail and the exit code will survive.  This is how I have my script running now.  I want to be able to set this inter-node port and keep my firewall ports grouped by value and consistent.

If this is truly a deprecated option, please let us know.
Reply | Threaded
Open this post in threaded view
|

Re: rabbitmq-server won't run (3.3.3)

Michael Klishin-2
 On 24 June 2014 at 17:06:55, dkent ([hidden email]) wrote:

> > One way to fix this and still keep -e is to add " && :" to the end of  
> the
> call to ${ERL_DIR}erl on line 98 of rabbitmq-server. This is  
> one of the
> operator expressions that will defeat errfail and the exit code  
> will
> survive. This is how I have my script running now. I want to be able  
> to
> set this inter-node port and keep my firewall ports grouped by  
> value and
> consistent.

This and one more similar issue were fixed in 3.3.4.
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: rabbitmq-server won't run (3.3.3)

dkent
Great, thanks! (It works, btw)

-----Original Message-----
From: Michael Klishin [mailto:[hidden email]]
Sent: Tuesday, June 24, 2014 6:08 AM
To: dkent; Discussions about RabbitMQ
Subject: Re: [rabbitmq-discuss] rabbitmq-server won't run (3.3.3)

 On 24 June 2014 at 17:06:55, dkent ([hidden email]) wrote:
> > One way to fix this and still keep -e is to add " && :" to the end
> > of
> the
> call to ${ERL_DIR}erl on line 98 of rabbitmq-server. This is one of
> the operator expressions that will defeat errfail and the exit code
> will survive. This is how I have my script running now. I want to be
> able to set this inter-node port and keep my firewall ports grouped by
> value and consistent.

This and one more similar issue were fixed in 3.3.4.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss