Installation error on Windows 11 WSL2 - PG::UndefinedTable: ERROR: relation "spree_countries" does not exist
zw10 opened this issue · 0 comments
zw10 commented
Environment
OS: Windows 11, under WSL 2
Docker: version 20.10.7, build 20.10.7-0ubuntu5~20.04.2
Steps
- bin/setup
- docker-compose run web rake spree_sample:load (throws this error)
Tried unsuccessfully to follow through #968 for fix, and also tried first running
- docker-compose run web rake db:create
- docker-compose up (works ok but error remains for docker-compose run web rake spree_sample:load)
Below is the output
Creating spree_starter_web_run ... done
** Invoke spree_sample:load (first_time)
** Invoke environment (first_time)
** Execute environment
[Scout] [04/19/22 13:04:58 +0000 662f73c3df6c (1)] INFO : Couldn't find configuration in /app/config/scout_apm.yml for environment: development. Configuration in ENV will still be applied.
** Execute spree_sample:load
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "spree_countries" does not exist
LINE 8: WHERE a.attrelid = '"spree_countries"'::regclass
^
/bundle/ruby/3.0.0/gems/rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:110:in `exec'
/bundle/ruby/3.0.0/gems/rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:110:in `async_exec'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `block (2 levels) in query'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:18:in `block in query'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:17:in `query'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql_adapter.rb:820:in `column_definitions'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:116:in `columns'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:112:in `block in columns'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:111:in `fetch'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:111:in `columns'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:120:in `block in columns_hash'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:119:in `fetch'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:119:in `columns_hash'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:553:in `load_schema!'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/attributes.rb:250:in `load_schema!'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:539:in `block in load_schema'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:536:in `synchronize'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:536:in `load_schema'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:392:in `columns_hash'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:363:in `block in find_by'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:347:in `each'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:347:in `each_with_object'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:347:in `find_by'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:384:in `find_by!'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/db/samples/addresses.rb:1:in `<main>'
/bundle/ruby/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/bundle/ruby/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/bundle/ruby/3.0.0/gems/zeitwerk-2.5.3/lib/zeitwerk/kernel.rb:35:in `require'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/lib/spree/sample.rb:13:in `load_sample'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/lib/spree_sample.rb:10:in `load_samples'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/lib/tasks/sample.rake:20:in `block (2 levels) in <main>'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/bundle/bin/rake:29:in `load'
/bundle/bin/rake:29:in `<main>'
Caused by:
PG::UndefinedTable: ERROR: relation "spree_countries" does not exist
LINE 8: WHERE a.attrelid = '"spree_countries"'::regclass
^
/bundle/ruby/3.0.0/gems/rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:110:in `exec'
/bundle/ruby/3.0.0/gems/rack-mini-profiler-2.3.3/lib/patches/db/pg.rb:110:in `async_exec'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `block (2 levels) in query'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:18:in `block in query'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/bundle/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:17:in `query'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/postgresql_adapter.rb:820:in `column_definitions'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:116:in `columns'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:112:in `block in columns'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:111:in `fetch'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:111:in `columns'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:120:in `block in columns_hash'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:119:in `fetch'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/schema_cache.rb:119:in `columns_hash'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:553:in `load_schema!'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/attributes.rb:250:in `load_schema!'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:539:in `block in load_schema'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:536:in `synchronize'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:536:in `load_schema'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/model_schema.rb:392:in `columns_hash'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:363:in `block in find_by'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:347:in `each'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:347:in `each_with_object'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:347:in `find_by'
/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/core.rb:384:in `find_by!'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/db/samples/addresses.rb:1:in `<main>'
/bundle/ruby/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/bundle/ruby/3.0.0/gems/bootsnap-1.10.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/bundle/ruby/3.0.0/gems/zeitwerk-2.5.3/lib/zeitwerk/kernel.rb:35:in `require'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/lib/spree/sample.rb:13:in `load_sample'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/lib/spree_sample.rb:10:in `load_samples'
/bundle/ruby/3.0.0/gems/spree_sample-4.4.0/lib/tasks/sample.rake:20:in `block (2 levels) in <main>'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/bundle/bin/rake:29:in `load'
/bundle/bin/rake:29:in `<main>'
Tasks: TOP => spree_sample:load
ERROR: 1