Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start (installed with brew): previous_upgrade_failed #257

Closed
fenec opened this issue Aug 7, 2015 · 5 comments
Closed

Unable to start (installed with brew): previous_upgrade_failed #257

fenec opened this issue Aug 7, 2015 · 5 comments
Labels
mailing list material This belongs to the mailing list (rabbitmq-users on Google Groups)
Milestone

Comments

@fenec
Copy link

fenec commented Aug 7, 2015

rabbitmq-server

##########  Logs: /usr/local/var/log/rabbitmq/rabbit@localhost.log
  ######  ##        /usr/local/var/log/rabbitmq/rabbit@localhost-sasl.log
  ##########
              Starting broker...

BOOT FAILED
===========

Error description:
   {could_not_start,rabbit,
                    {previous_upgrade_failed,{rabbit,start,[normal,[]]}}}

Log files (may contain more information):
   /usr/local/var/log/rabbitmq/rabbit@localhost.log
   /usr/local/var/log/rabbitmq/rabbit@localhost-sasl.log

{"init terminating in do_boot",{could_not_start,rabbit,{previous_upgrade_failed,{rabbit,start,[normal,[]]}}}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

It was 3.5.2, uninstalled it and upgraded to 3.5.2. Still the same error.

@michaelklishin
Copy link
Member

previous_upgrade_failed suggests RabbitMQ previously couldn't upgrade its database. Since this is a Homebrew-provisioned node, you can simply remove the database directory and the node will start.

Please ask questions on rabbitmq-users in the future.

@michaelklishin michaelklishin added the mailing list material This belongs to the mailing list (rabbitmq-users on Google Groups) label Aug 7, 2015
@fenec
Copy link
Author

fenec commented Aug 7, 2015

@michaelklishin thanks for quick help!

in case of anyone finding this, database dir for brew install is here:
/usr/local/var/lib/rabbitmq/mnesia

source: https://www.rabbitmq.com/relocate.html

@dumbbell dumbbell added this to the n/a milestone Sep 11, 2015
@jpmckinney
Copy link

In case anyone else finds this useful...

TLDR: Ensure /opt/homebrew/var/log/rabbitmq/std_error.log and /opt/homebrew/var/log/rabbitmq/std_out.log are owned by your user, not root.


brew services was showing rabbitmq as "error" status.

brew services start rabbitmq was producing:

Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/USERNAME/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist` exited with 5.

Running sudo brew services start rabbitmq per the above produced:

Warning: Taking root:admin ownership of some rabbitmq paths:
  /opt/homebrew/Cellar/rabbitmq/3.9.11/sbin
  /opt/homebrew/Cellar/rabbitmq/3.9.11/sbin/rabbitmq-server
  /opt/homebrew/opt/rabbitmq
  /opt/homebrew/opt/rabbitmq/sbin
  /opt/homebrew/var/homebrew/linked/rabbitmq
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: rabbitmq must be run as non-root to start at user login!
==> Successfully started `rabbitmq` (label: homebrew.mxcl.rabbitmq)

brew services now showed rabbitmq as "stopped" status.

Running sudo brew services start rabbitmq again yielded the warnings as above, but instead of a success message, showed:

/Library/LaunchDaemons/homebrew.mxcl.rabbitmq.plist: service already bootstrapped
Bootstrap failed: 37: Operation already in progress
Error: Failure while executing; `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.rabbitmq.plist` exited with 37.

Using restart instead of start brought back the success message, but services still showed as stopped.

Uninstalling and re-installing had no effect.

I looked in the plist file at /opt/homebrew/Cellar/rabbitmq/3.9.11/homebrew.mxcl.rabbitmq.plist and noted the error and output paths /opt/homebrew/var/log/rabbitmq/std_error.log and /opt/homebrew/var/log/rabbitmq/std_out.log

Opening those files I saw a "No home for cookie file" error. I did have a ~/.erlang.cookie file. Deleting it made no difference.

In the end, it turns out those two log files were owned by root (not sure why!), and apparently were not cleaned up during uninstall. Setting their ownership to my user allowed RabbitMQ to start.

@michaelklishin
Copy link
Member

@jpmckinney this suggests at some point the node was started as root, which is also why it did not find the cookie file (as you probably don't have it for root)

@jenstroeger
Copy link

previous_upgrade_failed suggests RabbitMQ previously couldn't upgrade its database. Since this is a Homebrew-provisioned node, you can simply remove the database directory and the node will start.

In my case it’s a MacPorts installation and required

rm -fr /opt/local/var/lib/rabbitmq/mnesia

after which starting the server worked (see also ticket #65617):

sudo rabbitmq-server start --detached

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mailing list material This belongs to the mailing list (rabbitmq-users on Google Groups)
Projects
None yet
Development

No branches or pull requests

5 participants