Closed harshith30 closed 10 years ago
Facing same issue here when we try to setup the testcasedb from master branch.
The error messages show it is clearly coming from omniauth related code or gem.
kiran@jaihanuman:~/testcasedb$ bundle exec rake db:setup RAILS_ENV='production'
tcdb_production already exists
rake aborted!
PG::UndefinedTable: ERROR: relation "settings" does not exist
LINE 5: WHERE a.attrelid = '"settings"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"settings"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in exec' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in
exec_no_cache'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:660:in block in exec_query' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/notifications/instrumenter.rb:20:in instrument' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in exec_query' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1292:in
column_definitions'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:855:in columns' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/schema_cache.rb:12:in
block in initialize'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:229:in yield' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:229:in
default'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:229:in columns' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:249:in
column_names'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:262:in column_methods_hash' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/dynamic_matchers.rb:74:in
all_attributes_exists?'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/dynamic_matchers.rb:27:in method_missing' /home/kiran/testcasedb/config/initializers/omniauth.rb:2:in
block in <top (required)>'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in instance_eval' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in
initialize'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.3/lib/omniauth/builder.rb:7:in initialize' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:43:in
new'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:43:in build' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in
block in build'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in each' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in
inject'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in build' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/engine.rb:475:in
app'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application/finisher.rb:31:in block in <module:Finisher>' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:30:in
instance_exec'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:30:in run' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:55:in
block in run_initializers'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:54:in each' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/initializable.rb:54:in
run_initializers'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:136:in initialize!' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in
method_missing'
/home/kiran/testcasedb/config/environment.rb:5:in <top (required)>' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in
require'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in block in require' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in
load_dependency'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in require' /home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:103:in
require_environment!'
/home/kiran/testcasedb/vendor/bundle/ruby/1.9.1/gems/railties-3.2.14/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
Tasks: TOP => db:setup => db:schema:load_if_ruby => environment
(See full trace by running task with --trace)
After creating the database, you need to migrate to the latest set of database changes.
Can you please try running, "bundle exec rake db:migration RAILS_ENV=production".
After that, you can try compiling assets again.
Hi,
Tried it and was not able to migrate the db.
harshith@harshith-Inspiron-3520:~/testcasedb$ bundle exec rake db:migrate RAILS_ENV="production" --trace
* Invoke db:migrate (first_time) * Invoke environment (first_time) \ Execute environment rake aborted!
PG::UndefinedTable: ERROR: relation "settings" does not exist LINE 5: WHERE a.attrelid = '"settings"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"settings"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in exec' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in
exec_no_cache'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:660:in block in exec_query' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activesupport-3.2.14/lib/active_support/notifications/instrumenter.rb:20:in instrument' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in exec_query' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1292:in
column_definitions'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:855:in columns' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/connection_adapters/schema_cache.rb:12:in
block in initialize'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:229:in yield' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:229:in
default'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:229:in columns' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:249:in
column_names'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:262:in column_methods_hash' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/dynamic_matchers.rb:74:in
all_attributes_exists?'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activerecord-3.2.14/lib/active_record/dynamic_matchers.rb:27:in method_missing' /home/harshith/testcasedb/config/initializers/omniauth.rb:2:in
block in <top (required)>'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rack-1.4.5/lib/rack/builder.rb:51:in instance_eval' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rack-1.4.5/lib/rack/builder.rb:51:in
initialize'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/omniauth-1.1.3/lib/omniauth/builder.rb:7:in initialize' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:43:in
new'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:43:in build' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in
block in build'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in each' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in
inject'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.2.14/lib/action_dispatch/middleware/stack.rb:113:in build' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/engine.rb:475:in
app'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/application/finisher.rb:31:in block in <module:Finisher>' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/initializable.rb:30:in
instance_exec'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/initializable.rb:30:in run' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/initializable.rb:55:in
block in run_initializers'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/initializable.rb:54:in each' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/initializable.rb:54:in
run_initializers'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/application.rb:136:in initialize!' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in
method_missing'
/home/harshith/testcasedb/config/environment.rb:5:in <top (required)>' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in
require'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in block in require' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in
load_dependency'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in require' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/application.rb:103:in
require_environment!'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/railties-3.2.14/lib/rails/application.rb:305:in block (2 levels) in initialize_tasks' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:236:in
call'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:236:in block in execute' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:231:in
each'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:231:in execute' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:175:in
block in invoke_with_call_chain'
/home/harshith/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:168:in
invoke_with_call_chain'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:197:in block in invoke_prerequisites' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:195:in
each'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:195:in invoke_prerequisites' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:174:in
block in invoke_with_call_chain'
/home/harshith/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:168:in
invoke_with_call_chain'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/task.rb:161:in invoke' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:149:in
invoke_task'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:106:in block (2 levels) in top_level' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:106:in
each'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:106:in block in top_level' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:115:in
run_with_threads'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:100:in top_level' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:78:in
block in run'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:165:in standard_exception_handling' /home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/lib/rake/application.rb:75:in
run'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/gems/rake-10.1.0/bin/rake:33:in <top (required)>' /home/harshith/.rvm/gems/ruby-1.9.3-p547/bin/rake:23:in
load'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/bin/rake:23:in <main>' /home/harshith/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in
eval'
/home/harshith/.rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `
Just to test, I commented omniauth from gemfile, contents from 'config/initializers/omniauth.rb' and did git reset to fcb8f5 and then did db:migrate and now it migrates.
So it is clearly related to omniauth.
Hi, After the latest git pull ,i'm able to migrate the DB as well as precompile it , that resolved this issue so closing it. Thanks
Hi, I'm getting the above error whenever i try to run
rake assets:precompile
.commit 96c776a5e23dc587330ee724ca63876d7abf11f9 Author: Marc Joffe mjoffe@msjit.ca Date: Thu Jun 26 10:32:55 2014 -0400
What steps should i take to fix this issue, if there is need for any additional information i will provide them.
harshith