postalserver / postal

📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail
https://postalserver.io
MIT License
14.85k stars 1.05k forks source link

DB migration script fails. #1049

Closed rickydjohn closed 4 years ago

rickydjohn commented 4 years ago

When I try to run postal make-user - i see an error while the script tries to search for a User table in postal db. Which of the steps mentioned in the installation guide is responsible for the schema migration?

Here is the trace:

/opt/postal/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `_query': Mysql2::Error: Table 'postal.users' doesn't exist: SHOW FULL FIELDS FROM `users` (ActiveRecord::StatementInvalid)
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in `block in query'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:118:in `handle_interrupt'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:118:in `query'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
        from /usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:196:in `execute_and_free'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:793:in `column_definitions'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:113:in `columns'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/schema_cache.rb:69:in `columns'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/schema_cache.rb:75:in `columns_hash'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/model_schema.rb:466:in `load_schema!'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/attributes.rb:234:in `load_schema!'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/attribute_decorators.rb:51:in `load_schema!'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/model_schema.rb:459:in `block in load_schema'
        from /usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/model_schema.rb:456:in `load_schema'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/model_schema.rb:346:in `attribute_types'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/attribute_methods.rb:230:in `has_attribute?'
        from /opt/postal/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.2.1/lib/active_record/inheritance.rb:55:in `new'
        from /opt/postal/app/lib/postal/user_creator.rb:12:in `start'
        from script/make_user.rb:7:in `<main>'
                   34 Quit
rickydjohn commented 4 years ago

figured out the script and reran it .