Snorby / snorby

Ruby On Rails Application For Network Security Monitoring
Other
1k stars 226 forks source link

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' #415

Closed romans8 closed 8 years ago

romans8 commented 8 years ago

$ RAILS_ENV=production bundle exec rake snorby:setup (in /var/www/html/snorby)

[Hash Here]

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

[datamapper] Finished auto_upgrade! for :default repository 'name_here'

[X] Error: Unable to start the Snorby worker process.

  1. The MySql server is on another box. It looks like it finds it because of the [datamapper] - let me know if I am wrong.
  2. Nothing spitting out in /var/log/mysqld.log
  3. Nothing in /var/log/messages
  4. I had to manually add empty files including mysql.sock to whittle down the errors.
  5. I also had to run the following to get the Mime errors to go away.
  6. The database has already been used and is working with another Snorby instance but I want to now to migrate Snorby onto another machine. The database.yml file is the same on the working machine as it is on the new machine that is creating this error.
  7. I have visited the old thread and tried putting the IP in the my.cnf file but to no success.

sed -i 's/(^._)(Mime::Type.register.application\/pdf.$)/\1if Mime::Type.lookup_byextension(:pdf) != "application\/pdf"\n\1 \2\n\1end/' vendor/cache/ruby/../bundler/gems/ezprint-/lib/ezprint/railtie.rb sed -i 's/(^.)(Mime::Type.register.application\/pdf.$)/\1if Mime::Type.lookup_byextension(:pdf) != "application\/pdf"\n\1 \2\n\1end/' vendor/cache/ruby/../gems/actionpack-_/lib/action_dispatch/http/mimetypes.rb sed -i 's/(^.)(Mime::Type.register.application\/pdf.$)/\1if Mime::Type.lookup_byextension(:pdf) != "application\/pdf"\n\1 \2\n\1end/' vendor/cache/ruby/../gems/railties-*/guides/source/action_controller_overview.textile

romans8 commented 8 years ago

This looks like it was because the external DB was already created when running --trace I was getting the error after it was trying to setup the DB when running rake snorby:setup. It looks like rake snorby:update worked but now I need to work through permission and will research and submit a new ticket based on that.