Following the deployment guide but cannot install mconf #4

Closed
mbdevpl opened this Issue Aug 12, 2013 · 3 comments

Comments

Projects
None yet
2 participants

mbdevpl commented Aug 12, 2013

Hello, I have installed two systems, on both I want to install mconf. They are Debian 7.1 (wheezy) and Ubuntu 12.04.2

I am following the steps from this guide:
https://github.com/mconf/mconf-web/wiki/Mconf-Web-Deployment-Manual

and on both systems the environment is like this:

mconf@mconf-debian-virtual:~/mconf-web/current$ which rvm && which gem && which bundle && which rails && which passenger
mconf@mconf-VirtualBox:~/mconf-web/current$ which rvm && which gem && which bundle && which rails && which passenger
/usr/local/rvm/bin/rvm
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/gem
/usr/local/rvm/gems/ruby-1.9.2-p290@global/bin/bundle
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/bin/rails
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/bin/passenger

More info about environment in debian:

mconf@mconf-debian-virtual:~/mconf-web/current$ gem -v && bundle -v && rvm -v && rvm list && rvm gemset list
1.8.25
Bundler version 1.0.18

rvm 1.21.17 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]


rvm rubies

=* ruby-1.9.2-p290 [ x86_64 ]

# => - current
# =* - current && default
#  * - default


gemsets for ruby-1.9.2-p290 (found in /usr/local/rvm/gems/ruby-1.9.2-p290)
   (default)
   global
=> mconf

And environment in ubuntu:

mconf@mconf-VirtualBox:~$ rvm -v

rvm 1.21.19 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

mconf@mconf-VirtualBox:~$ rvm gemset list

gemsets for ruby-1.9.2-p290 (found in /usr/local/rvm/gems/ruby-1.9.2-p290)
   (default)
   global
=> mconf

mconf@mconf-VirtualBox:~$ rvm list

rvm rubies

=* ruby-1.9.2-p290 [ i686 ]

# => - current
# =* - current && default
#  * - default

mconf@mconf-VirtualBox:~$ gem -v
1.8.25
mconf@mconf-VirtualBox:~$ bundle -v
Bundler version 1.0.18

I've downgraded rubygems because at current version there was some conflict with old version of bundler, i.e. "bundle install" step failed with current version of rubygems. The workaround seemed to resolve the issue, so I moved on.

The problem starts at step "5. Application configurations". I've adjusted database and setup configuration files, and proceeded to this step:

RAILS_ENV=production bundle exec rake setup:db

The problem is that no matter what I do, I cannot get the scripts to create the mconf administrator account. My configuration files are quite default, except db passwords and default admin name/email/pass, but according to the guide they may be default at this step of the installation.

I can connect to the database, and I've checked that I have correct privileges. I've set the correct password in the database.yml.

mysql> show grants for current_user;
+--------------------------------------------------------------------------------------------------------------+
| Grants for mconf@localhost                                                                                   |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mconf'@'localhost' IDENTIFIED BY PASSWORD '*17B73D5AE439BC7F9A1117F4784FED68BB9B1852' |
| GRANT ALL PRIVILEGES ON `mconf_production`.* TO 'mconf'@'localhost'                                          |
| GRANT ALL PRIVILEGES ON `mconf_test`.* TO 'mconf'@'localhost'                                                |
| GRANT ALL PRIVILEGES ON `mconf_development`.* TO 'mconf'@'localhost'                                         |
+--------------------------------------------------------------------------------------------------------------+
4 rows in set (0.00 sec)

rake setup:db creates tables in the database (I've checked) and prints lots of success information, but after these lines:

* Create the administrator account
  login: admin
  email: admin@default.com
  password: admin
  fullname: Mconf Admin

... I have three results:

  • if I comment out the admin account creation lines (157 to 169 in /db/seeds.rb), the script finishes, but I have no users in the database, so it is not the right solution ;)
  • without commenting out, with arel 2.0.5: ruby hanged and used 100% cpu for a long long time, so I killed it after 15 minutes. this version of arel I've installed manually, and also I've reverted rails to 3.0.7 and several other modules so that they depend on arel 2.0.5, but in short: it didn't work. When I killed ruby the trace points to approximately the same lines as attached below.
  • and with arel 2.0.10 (current version): there is an error:
rake aborted!
undefined method `name' for nil:NilClass
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:56:in `block in visit_Arel_Nodes_InsertStatement'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:55:in `map'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:55:in `visit_Arel_Nodes_InsertStatement'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/visitor.rb:15:in `visit'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/visitor.rb:5:in `accept'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:18:in `block in accept'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/connection_adapters/abstract/connection_pool.rb:111:in `with_connection'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/visitors/to_sql.rb:16:in `accept'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/tree_manager.rb:20:in `to_sql'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/arel-2.0.10/lib/arel/select_manager.rb:217:in `insert'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/relation.rb:14:in `insert'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/persistence.rb:281:in `create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/timestamp.rb:47:in `create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:277:in `block in create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:414:in `_run_create_callbacks'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:277:in `create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/persistence.rb:257:in `create_or_update'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:273:in `block in create_or_update'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:429:in `_run_save_callbacks'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:273:in `create_or_update'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/persistence.rb:40:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/validations.rb:43:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:240:in `block (2 levels) in save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:207:in `transaction'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:240:in `block in save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:239:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/base.rb:504:in `create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/reflection.rb:180:in `create_association'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/associations/has_one_association.rb:13:in `block in create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/associations/has_one_association.rb:117:in `block in new_record'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/base.rb:1131:in `with_scope'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/associations/has_one_association.rb:116:in `new_record'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/associations/has_one_association.rb:11:in `create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/associations/association_proxy.rb:156:in `send'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/associations.rb:1540:in `block in association_constructor_method'
/home/mconf/mconf-web/current/app/models/user.rb:100:in `create_bbb_room'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:475:in `_run_create_callbacks'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:277:in `create'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/persistence.rb:257:in `create_or_update'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:273:in `block in create_or_update'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:424:in `_run_save_callbacks'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:273:in `create_or_update'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/persistence.rb:40:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/validations.rb:43:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:240:in `block (2 levels) in save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:207:in `transaction'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:240:in `block in save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/transactions.rb:239:in `save'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/base.rb:504:in `create'
/home/mconf/mconf-web/current/db/seeds.rb:157:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `block in load'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:227:in `load_dependency'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activesupport-3.0.20/lib/active_support/dependencies.rb:236:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/activerecord-3.0.20/lib/active_record/railties/databases.rake:290:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/mconf/mconf-web/current/lib/tasks/setup/setup.rake:51:in `block in run_tasks'
/home/mconf/mconf-web/current/lib/tasks/setup/setup.rake:49:in `each'
/home/mconf/mconf-web/current/lib/tasks/setup/setup.rake:49:in `run_tasks'
/home/mconf/mconf-web/current/lib/tasks/setup/setup.rake:41:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p290@mconf/bin/rake:23:in `<main>'

I'm under the impression that my issue is connected to this one: rails/arel#124

Thanks in advance for any help or advice, because at the moment I have no idea what and where is wrong. How can I troubleshoot this problem?

mbdevpl commented Aug 13, 2013

My quick and stupid workaround is instead of doing:

cd ~/mconf-web/current
RAILS_ENV=production bundle exec rake setup:db

do:

cd ~/mconf-web/current
mv db/seeds.rb db/_seeds.rb
RAILS_ENV=production bundle exec rake setup:db
mv db/_seeds.rb db/seeds.rb
RAILS_ENV=production bundle exec rake db:seed

because the bug mentioned earlier is occurring in my case.

I could do this instead:

RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake db:seed

but I'm not sure what other tasks are there in mconf...

And, unfortunately I managed to successfully run

passenger-install-apache2-module

only on 32bit Ubuntu, because my 64bit Debian is affected by a different bug this time:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672096

Even though the bug was fixed in passenger 3.0.12debian-1, mconf depends on 3.0.11 and hence script fails.

I hope these posts will help somebody.

After these obstacles, the rest of the installation and configuration went ok :)

Owner

daronco commented Aug 13, 2013

Hi @mbdevpl,

Thank you for the detailed information!

We've been seeing something similar in development in another branch (that's far ahead of the current master), but couldn't fix it yet.
The problem is that db:setup stops with an error similar to the error you're getting. We've found out that it happens in db:seed, but only when it's being triggered internally by db:setup. As you said, if you run db:seed individually it works. So in development what we usually do is:

bundle exec rake db:setup # db:setup will fail but most of it will run
bundle exec rake db:seed

You can try this (don't forget to set RAILS_ENV=production), it should work as expected. But to be sure check your database to confirm if you have only 1 admin user or if any other data added by db:seed is duplicated.
I will try this as well to check if the manual needs to be updated.

About passenger, it shouldn't be a problem if you need to use 3.0.12. If that's all that it takes to make it work on debian 64bit, it is worth a try.

We don't provide a guide for debian. Did https://github.com/mconf/mconf-web/wiki/Mconf-Web-Deployment-Manual work as expected in debian or did you have to adapt it? We're willing to provide wiki pages with installation manuals provided by contributors, so if you had to adapt the manual and are willing to share it, we can add it to the wiki.

Owner

daronco commented Oct 23, 2013

The installation instructions were updated and the block...

RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake db:seed

...was replaced by:

RAILS_ENV=production bundle exec rake db:drop db:create db:reset
RAILS_ENV=production bundle exec rake db:seed

This error shouldn't happen anymore.

Also, Passenger will be updated in the next version. If you need it in the current version, you can safely use Passenger 3.0.21. Just install this version instead of the one indicated in the instructions.

@daronco daronco closed this Oct 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment