MyBB failed to import


(Nathaniel Suchy) #1

I followed the instructions at Migrating from mybb and get the following error message after the users have imported. Any ideas on what went wrong and how to fix it?

discourse@sm64hacks-app:/var/www/discourse/script/import_scripts$ RAILS_ENV=production ruby mybb.rb # no idea what "bundle exec" does
loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...
creating users
405 / 405 (100.0%) /var/www/discourse/lib/pretty_text.rb:107:in `read': No such file or directory @ rb_sysopen - lib/javascripts/moment.js (Errno::ENOENT)
from /var/www/discourse/lib/pretty_text.rb:107:in `block in create_es6_context'
from /usr/local/lib/ruby/2.4.0/set.rb:324:in `each_key'
from /usr/local/lib/ruby/2.4.0/set.rb:324:in `each'
from /var/www/discourse/lib/pretty_text.rb:106:in `create_es6_context'
from /var/www/discourse/lib/pretty_text.rb:123:in `block in v8'
from /var/www/discourse/lib/pretty_text.rb:121:in `synchronize'
from /var/www/discourse/lib/pretty_text.rb:121:in `v8'
from /var/www/discourse/lib/pretty_text.rb:143:in `block in markdown'
from /var/www/discourse/lib/pretty_text.rb:395:in `block in protect'
from /var/www/discourse/lib/pretty_text.rb:394:in `synchronize'
from /var/www/discourse/lib/pretty_text.rb:394:in `protect'
from /var/www/discourse/lib/pretty_text.rb:142:in `markdown'
from /var/www/discourse/lib/pretty_text.rb:242:in `cook'
from /var/www/discourse/app/models/post_analyzer.rb:31:in `cook'
from /var/www/discourse/app/models/post_analyzer.rb:132:in `cooked_stripped'
from /var/www/discourse/app/models/post_analyzer.rb:114:in `raw_links'
from /var/www/discourse/app/models/post_analyzer.rb:125:in `link_count'
from /var/www/discourse/app/models/post.rb:233:in `block (2 levels) in <class:Post>'
from /var/www/discourse/lib/validators/post_validator.rb:112:in `can_post_links_validator'
from /var/www/discourse/lib/validators/post_validator.rb:18:in `validate'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:197:in `block (2 levels) in halting'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:600:in `catch'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:600:in `block in default_terminator'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:198:in `block in halting'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `block in invoke_before'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `invoke_before'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:130:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_validate_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations.rb:405:in `run_validations!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations/callbacks.rb:110:in `block in run_validations!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:131:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_validation_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations/callbacks.rb:110:in `run_validations!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations.rb:335:in `valid?'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:65:in `valid?'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:82:in `perform_validations'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:44:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/attribute_methods/dirty.rb:35:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:308:in `block (2 levels) in save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:308:in `block in save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:323:in `rollback_active_record_state!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:307:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/suppressor.rb:42:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:371:in `insert_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/has_many_association.rb:34:in `insert_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:360:in `block (2 levels) in _create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:447:in `replace_on_target'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:281:in `add_to_target'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:358:in `block in _create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:129:in `block in transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:128:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:357:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/has_many_association.rb:121:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/association.rb:196:in `create'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_proxy.rb:347:in `create'
from /var/www/discourse/app/models/category.rb:204:in `create_category_definition'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:235:in `block in halting_and_conditional'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `block in invoke_after'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `invoke_after'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:132:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_create_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/callbacks.rb:340:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/timestamp.rb:95:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/persistence.rb:563:in `create_or_update'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/callbacks.rb:336:in `block in create_or_update'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:131:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_save_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/callbacks.rb:336:in `create_or_update'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/persistence.rb:162:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:50:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:313:in `block in save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
from /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:313:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/suppressor.rb:46:in `save!'
from /var/www/discourse/script/import_scripts/base.rb:451:in `create_category'
from /var/www/discourse/script/import_scripts/base.rb:422:in `block in create_categories'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in `each'
from /var/www/discourse/script/import_scripts/base.rb:403:in `create_categories'
from mybb.rb:89:in `import_categories'
from mybb.rb:42:in `execute'
from /var/www/discourse/script/import_scripts/base.rb:46:in `perform'
from mybb.rb:304:in `<main>'
discourse@sm64hacks-app:/var/www/discourse/script/import_scripts$ RAILS_ENV=production ruby mybb.rb # no idea what "bundle exec" does
loading existing groups...
loading existing users...
loading existing categories...
loading existing posts...
loading existing topics...
creating users
Skipping 405 already imported users
/var/www/discourse/lib/pretty_text.rb:107:in `read': No such file or directory @ rb_sysopen - lib/javascripts/moment.js (Errno::ENOENT)
from /var/www/discourse/lib/pretty_text.rb:107:in `block in create_es6_context'
from /usr/local/lib/ruby/2.4.0/set.rb:324:in `each_key'
from /usr/local/lib/ruby/2.4.0/set.rb:324:in `each'
from /var/www/discourse/lib/pretty_text.rb:106:in `create_es6_context'
from /var/www/discourse/lib/pretty_text.rb:123:in `block in v8'
from /var/www/discourse/lib/pretty_text.rb:121:in `synchronize'
from /var/www/discourse/lib/pretty_text.rb:121:in `v8'
from /var/www/discourse/lib/pretty_text.rb:143:in `block in markdown'
from /var/www/discourse/lib/pretty_text.rb:395:in `block in protect'
from /var/www/discourse/lib/pretty_text.rb:394:in `synchronize'
from /var/www/discourse/lib/pretty_text.rb:394:in `protect'
from /var/www/discourse/lib/pretty_text.rb:142:in `markdown'
from /var/www/discourse/lib/pretty_text.rb:242:in `cook'
from /var/www/discourse/app/models/post_analyzer.rb:31:in `cook'
from /var/www/discourse/app/models/post_analyzer.rb:132:in `cooked_stripped'
from /var/www/discourse/app/models/post_analyzer.rb:114:in `raw_links'
from /var/www/discourse/app/models/post_analyzer.rb:125:in `link_count'
from /var/www/discourse/app/models/post.rb:233:in `block (2 levels) in <class:Post>'
from /var/www/discourse/lib/validators/post_validator.rb:112:in `can_post_links_validator'
from /var/www/discourse/lib/validators/post_validator.rb:18:in `validate'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:197:in `block (2 levels) in halting'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:600:in `catch'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:600:in `block in default_terminator'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:198:in `block in halting'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `block in invoke_before'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `invoke_before'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:130:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_validate_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations.rb:405:in `run_validations!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations/callbacks.rb:110:in `block in run_validations!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:131:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_validation_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations/callbacks.rb:110:in `run_validations!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/validations.rb:335:in `valid?'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:65:in `valid?'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:82:in `perform_validations'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:44:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/attribute_methods/dirty.rb:35:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:308:in `block (2 levels) in save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:308:in `block in save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:323:in `rollback_active_record_state!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:307:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/suppressor.rb:42:in `save'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:371:in `insert_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/has_many_association.rb:34:in `insert_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:360:in `block (2 levels) in _create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:447:in `replace_on_target'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:281:in `add_to_target'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:358:in `block in _create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:129:in `block in transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:128:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_association.rb:357:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/has_many_association.rb:121:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/association.rb:196:in `create'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/associations/collection_proxy.rb:347:in `create'
from /var/www/discourse/app/models/category.rb:204:in `create_category_definition'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:235:in `block in halting_and_conditional'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `block in invoke_after'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:511:in `invoke_after'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:132:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_create_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/callbacks.rb:340:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/timestamp.rb:95:in `_create_record'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/persistence.rb:563:in `create_or_update'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/callbacks.rb:336:in `block in create_or_update'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:131:in `run_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:827:in `_run_save_callbacks'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/callbacks.rb:336:in `create_or_update'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/persistence.rb:162:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/validations.rb:50:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:313:in `block in save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
from /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:210:in `transaction'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/transactions.rb:313:in `save!'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/suppressor.rb:46:in `save!'
from /var/www/discourse/script/import_scripts/base.rb:451:in `create_category'
from /var/www/discourse/script/import_scripts/base.rb:422:in `block in create_categories'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in `each'
from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-1.0.0/lib/patches/db/mysql2.rb:8:in `each'
from /var/www/discourse/script/import_scripts/base.rb:403:in `create_categories'
from mybb.rb:89:in `import_categories'
from mybb.rb:42:in `execute'
from /var/www/discourse/script/import_scripts/base.rb:46:in `perform'
from mybb.rb:304:in `<main>'
discourse@sm64hacks-app:/var/www/discourse/script/import_scripts$

(Régis Hanol) #2

Have you tried running this from the discourse directory?

RAILS_ENV=production bundle exec ruby script/import_scripts/mybb.rb

(Nathaniel Suchy) #3
ipt/import_scripts/mybb.rbw/discourse# RAILS_ENV=production bundle exec ruby scri
script/import_scripts/mybb.rb:1:in `require': cannot load such file -- mysql2 (LoadError)
	from script/import_scripts/mybb.rb:1:in `<main>'

New error message I now get. Yes I tried installing the mysql gem.


(Régis Hanol) #4

How did you install the mysql gem?

One way is to add it to the Gemfile

echo "gem 'mysql2'" >> Gemfile

And then run

bundle install --no-deployment

(Nathaniel Suchy) #5

I had just typed gem install mysql2 - after following your instructions and reattempting the import and got the following error output.

root@sm64hacks-app:/var/www/discourse# echo "gem 'mysql2'" >> Gemfile
root@sm64hacks-app:/var/www/discourse# bundle install --no-deployment
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.....
Fetching rake 12.3.0
Fetching concurrent-ruby 1.0.5
Fetching i18n 0.8.6
Installing i18n 0.8.6
Installing rake 12.3.0
Installing concurrent-ruby 1.0.5
Fetching minitest 5.10.3
Fetching thread_safe 0.3.6
Installing minitest 5.10.3
Installing thread_safe 0.3.6
Fetching builder 3.2.3
Fetching erubi 1.6.1
Installing builder 3.2.3
Installing erubi 1.6.1
Fetching mini_portile2 2.3.0
Fetching crass 1.0.3
Fetching rack 2.0.5
Installing mini_portile2 2.3.0
Installing crass 1.0.3
Installing rack 2.0.5
Fetching mini_mime 1.0.0
Installing mini_mime 1.0.0
Fetching arel 8.0.0
Fetching public_suffix 2.0.5
Installing arel 8.0.0
Installing public_suffix 2.0.5
Fetching ast 2.4.0
Installing ast 2.4.0
Fetching aws-partitions 1.24.0
Fetching aws-sigv4 1.0.2
Installing aws-partitions 1.24.0
Fetching jmespath 1.3.1
Fetching ember-source 2.13.3
Installing aws-sigv4 1.0.2
Installing jmespath 1.3.1
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching msgpack 1.2.4
Using bundler 1.16.2
Fetching byebug 9.0.6
Installing msgpack 1.2.4 with native extensions
Installing byebug 9.0.6 with native extensions
Installing ember-source 2.13.3
Fetching certified 1.0.0
Installing certified 1.0.0
Fetching chunky_png 1.3.8
Installing chunky_png 1.3.8
Fetching coderay 1.1.2
Installing coderay 1.1.2
Fetching connection_pool 2.2.1
Installing connection_pool 2.2.1
Fetching cppjieba_rb 0.3.0
Installing cppjieba_rb 0.3.0 with native extensions
Fetching safe_yaml 1.0.4
Installing safe_yaml 1.0.4
Fetching diff-lcs 1.3
Installing diff-lcs 1.3
Fetching exifr 1.2.5
Installing exifr 1.2.5
Fetching fspath 3.1.0
Installing fspath 3.1.0
Fetching image_size 1.5.0
Installing image_size 1.5.0
Fetching in_threads 1.4.0
Installing in_threads 1.4.0
Fetching progress 3.3.1
Installing progress 3.3.1
Fetching email_reply_trimmer 0.1.12
Installing email_reply_trimmer 0.1.12
Fetching method_source 0.8.2
Installing method_source 0.8.2
Fetching thor 0.19.4
Installing thor 0.19.4
Fetching excon 0.56.0
Installing excon 0.56.0
Fetching fabrication 2.9.8
Installing fabrication 2.9.8
Fetching fakeweb 1.3.0
Installing fakeweb 1.3.0
Fetching multipart-post 2.0.0
Installing multipart-post 2.0.0
Fetching fast_blank 1.0.0
Installing fast_blank 1.0.0 with native extensions
Fetching fast_xs 0.8.0
Installing fast_xs 0.8.0 with native extensions
Fetching fastimage 2.1.1
Installing fastimage 2.1.1
Fetching ffi 1.9.18
Installing ffi 1.9.18 with native extensions
Fetching flamegraph 0.9.5
Installing flamegraph 0.9.5
Fetching gc_tracer 1.5.1
Installing gc_tracer 1.5.1 with native extensions
Fetching guess_html_encoding 0.0.11
Installing guess_html_encoding 0.0.11
Fetching hashdiff 0.3.4
Installing hashdiff 0.3.4
Fetching hashie 3.5.5
Installing hashie 3.5.5
Fetching highline 1.7.8
Installing highline 1.7.8
Fetching hiredis 0.6.1
Installing hiredis 0.6.1 with native extensions
Fetching hkdf 0.3.0
Installing hkdf 0.3.0
Fetching htmlentities 4.3.4
Installing htmlentities 4.3.4
Fetching http_accept_language 2.0.5
Installing http_accept_language 2.0.5
Fetching jwt 1.5.6
Installing jwt 1.5.6
Fetching kgio 2.11.1
Installing kgio 2.11.1 with native extensions
Fetching libv8 6.3.292.48.1 (x86_64-linux)
Installing libv8 6.3.292.48.1 (x86_64-linux)
Fetching rb-fsevent 0.9.8
Installing rb-fsevent 0.9.8
Fetching ruby_dep 1.5.0
Installing ruby_dep 1.5.0
Fetching request_store 1.3.2
Installing request_store 1.3.2
Fetching logstash-event 1.2.02
Installing logstash-event 1.2.02
Fetching logster 1.2.9
Installing logster 1.2.9
Fetching lru_redux 1.1.0
Installing lru_redux 1.1.0
Fetching memory_profiler 0.9.10
Installing memory_profiler 0.9.10
Fetching metaclass 0.0.4
Installing metaclass 0.0.4
Fetching mock_redis 0.17.3
Installing mock_redis 0.17.3
Fetching moneta 1.0.0
Installing moneta 1.0.0
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching multi_xml 0.6.0
Installing multi_xml 0.6.0
Fetching mustache 1.0.5
Installing mustache 1.0.5
Using mysql2 0.5.1
Fetching oauth 0.5.1
Installing oauth 0.5.1
Fetching oj 3.4.0
Installing oj 3.4.0 with native extensions
Fetching ruby-openid 2.7.0
Installing ruby-openid 2.7.0
Fetching redis 4.0.1
Installing redis 4.0.1
Fetching parallel 1.12.1
Installing parallel 1.12.1
Fetching pg 0.21.0
Installing pg 0.21.0 with native extensions
Fetching powerpack 0.1.1
Installing powerpack 0.1.1
Fetching slop 3.6.0
Installing slop 3.6.0
Fetching puma 3.9.1
Installing puma 3.9.1 with native extensions
Fetching r2 0.2.6
Installing r2 0.2.6
Fetching rainbow 3.0.0
Installing rainbow 3.0.0
Fetching raindrops 0.19.0
Installing raindrops 0.19.0 with native extensions
Fetching trollop 2.1.2
Installing trollop 2.1.2
Fetching rinku 2.0.2
Installing rinku 2.0.2 with native extensions
Fetching rotp 3.3.0
Installing rotp 3.3.0
Fetching rspec-support 3.6.0
Installing rspec-support 3.6.0
Fetching rtlit 0.0.5
Installing rtlit 0.0.5
Fetching ruby-progressbar 1.9.0
Installing ruby-progressbar 1.9.0
Fetching unicode-display_width 1.3.0
Installing unicode-display_width 1.3.0
Fetching sass 3.4.24
Installing sass 3.4.24
Fetching shoulda-context 1.2.2
Installing shoulda-context 1.2.2
Fetching sshkey 1.9.0
Installing sshkey 1.9.0
Fetching stackprof 0.2.10
Installing stackprof 0.2.10 with native extensions
Fetching tilt 2.0.7
Installing tilt 2.0.7
Fetching unf_ext 0.0.7.4
Installing unf_ext 0.0.7.4 with native extensions
Fetching rake-compiler 1.0.4
Installing rake-compiler 1.0.4
Fetching tzinfo 1.2.3
Installing tzinfo 1.2.3
Fetching nokogiri 1.8.2
Installing nokogiri 1.8.2 with native extensions
Fetching mail 2.7.1.rc1
Installing mail 2.7.1.rc1
Fetching addressable 2.5.1
Installing addressable 2.5.1
Fetching parser 2.5.0.3
Installing parser 2.5.0.3
Fetching rack-test 0.7.0
Installing rack-test 0.7.0
Fetching sprockets 3.7.1
Installing sprockets 3.7.1
Fetching message_bus 2.1.5
Installing message_bus 2.1.5
Fetching rack-mini-profiler 1.0.0
Installing rack-mini-profiler 1.0.0
Fetching rack-protection 2.0.1
Installing rack-protection 2.0.1
Fetching aws-sdk-core 3.6.0
Installing aws-sdk-core 3.6.0
Fetching uglifier 3.2.0
Installing uglifier 3.2.0
Fetching barber 0.11.2
Installing barber 0.11.2
Fetching ember-data-source 2.2.1
Installing ember-data-source 2.2.1
Fetching rqrcode 0.10.1
Installing rqrcode 0.10.1
Fetching bootsnap 1.1.8
Installing bootsnap 1.1.8 with native extensions
Fetching crack 0.4.3
Installing crack 0.4.3
Fetching discourse_image_optim 0.24.5
Installing discourse_image_optim 0.24.5
Fetching faraday 0.11.0
Installing faraday 0.11.0
Fetching omniauth 1.6.1
Installing omniauth 1.6.1
Fetching rb-inotify 0.9.8
Installing rb-inotify 0.9.8
Fetching mini_suffix 0.3.0
Installing mini_suffix 0.3.0
Fetching webpush 0.3.2
Installing webpush 0.3.2
Fetching mini_racer 0.1.15
Installing mini_racer 0.1.15 with native extensions
Fetching logstash-logger 0.25.1
Installing logstash-logger 0.25.1
Fetching mocha 1.2.1
Installing mocha 1.2.1
Fetching rack-openid 1.3.1
Installing rack-openid 1.3.1
Fetching openid-redis-store 0.0.2
Installing openid-redis-store 0.0.2
Fetching redis-namespace 1.6.0
Installing redis-namespace 1.6.0
Fetching pry 0.10.4
Installing pry 0.10.4
Fetching rbtrace 0.4.10
Installing rbtrace 0.4.10 with native extensions
Fetching rspec-core 3.6.0
Installing rspec-core 3.6.0
Fetching rspec-expectations 3.6.0
Installing rspec-expectations 3.6.0
Fetching rspec-mocks 3.6.0
Installing rspec-mocks 3.6.0
Fetching sassc 1.11.2
Installing sassc 1.11.2 with native extensions
Fetching unicorn 5.4.0
Installing unicorn 5.4.0 with native extensions
Fetching fast_xor 1.1.3
Installing fast_xor 1.1.3 with native extensions
Fetching activesupport 5.1.4
Installing activesupport 5.1.4
Fetching rubocop 0.53.0
Installing rubocop 0.53.0
Fetching sidekiq 5.1.3
Installing sidekiq 5.1.3
Fetching aws-sdk-kms 1.2.0
Installing aws-sdk-kms 1.2.0
Fetching ember-handlebars-template 0.7.5
Installing ember-handlebars-template 0.7.5
Fetching unf 0.1.4
Installing unf 0.1.4
Fetching webmock 3.0.1
Installing webmock 3.0.1
Fetching oauth2 1.3.1
Installing oauth2 1.3.1
Fetching omniauth-oauth 1.1.0
Installing omniauth-oauth 1.1.0
Fetching listen 3.1.5
Installing listen 3.1.5
Fetching loofah 2.2.2
Installing loofah 2.2.2
Fetching nokogumbo 1.5.0
Installing nokogumbo 1.5.0 with native extensions
Fetching ruby-readability 0.7.0
Installing ruby-readability 0.7.0
Fetching omniauth-openid 1.0.1
Installing omniauth-openid 1.0.1
Fetching pry-nav 0.2.4
Installing pry-nav 0.2.4
Fetching pry-rails 0.3.4
Installing pry-rails 0.3.4
Fetching rspec 3.6.0
Installing rspec 3.6.0
Fetching rails-dom-testing 2.0.3
Installing rails-dom-testing 2.0.3
Fetching globalid 0.4.0
Installing globalid 0.4.0
Fetching activemodel 5.1.4
Installing activemodel 5.1.4
Fetching shoulda-matchers 2.8.0
Fetching aws-sdk-s3 1.4.0
Installing shoulda-matchers 2.8.0
Installing aws-sdk-s3 1.4.0
Fetching omniauth-oauth2 1.4.0
Installing omniauth-oauth2 1.4.0
Fetching omniauth-twitter 1.3.0
Installing omniauth-twitter 1.3.0
Fetching rails-html-sanitizer 1.0.4
Installing rails-html-sanitizer 1.0.4
Fetching rspec-html-matchers 0.9.1
Installing rspec-html-matchers 0.9.1
Fetching activejob 5.1.4
Installing activejob 5.1.4
Fetching active_model_serializers 0.8.3
Fetching activerecord 5.1.4
Installing active_model_serializers 0.8.3
Installing activerecord 5.1.4
Fetching omniauth-facebook 4.0.0
Installing omniauth-facebook 4.0.0
Fetching omniauth-github 1.3.0
Installing omniauth-github 1.3.0
Fetching omniauth-google-oauth2 0.3.1
Installing omniauth-google-oauth2 0.3.1
Fetching omniauth-instagram 1.0.2
Installing omniauth-instagram 1.0.2
Fetching actionview 5.1.4
Fetching shoulda 3.5.0
Installing shoulda 3.5.0
Installing actionview 5.1.4
Fetching seed-fu 2.3.7
Installing seed-fu 2.3.7
Fetching actionpack 5.1.4
Installing actionpack 5.1.4
Fetching actionmailer 5.1.4
Fetching railties 5.1.4
Installing actionmailer 5.1.4
Installing railties 5.1.4
Fetching sprockets-rails 3.2.0
Installing sprockets-rails 3.2.0
Fetching jquery-rails 4.3.1
Fetching lograge 0.7.1
Installing lograge 0.7.1
Fetching rails_multisite 2.0.4
Installing rails_multisite 2.0.4
Installing jquery-rails 4.3.1
Fetching rspec-rails 3.6.1
Installing rspec-rails 3.6.1
Fetching ember-rails 0.18.5
Installing ember-rails 0.18.5
Fetching sanitize 4.6.4
Installing sanitize 4.6.4
Fetching onebox 1.8.47
Installing onebox 1.8.47
Bundle complete! 107 Gemfile dependencies, 182 gems now installed.
Gems in the group development were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from certified:
IMPORTANT: Remember to use the included executable `certifed-update` regularly to keep your certificate bundle up to date.
Post-install message from discourse_image_optim:
Rails image assets optimization is extracted into image_optim_rails gem
You can safely remove `config.assets.image_optim = false` if you are not going to use that gem
ipt/import_scripts/mybb.rbw/discourse# RAILS_ENV=production bundle exec ruby scri
/usr/local/lib/ruby/gems/2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `initialize': FATAL:  Peer authentication failed for user "discourse" (PG::ConnectionBad)
	from /usr/local/lib/ruby/gems/2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `new'
	from /usr/local/lib/ruby/gems/2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `connect'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:695:in `connect'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:220:in `initialize'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in `new'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in `postgresql_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:759:in `new_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:803:in `checkout_new_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:782:in `try_to_checkout_new_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:743:in `acquire_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:500:in `checkout'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_handling.rb:116:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activerecord-5.1.4/lib/active_record/connection_handling.rb:88:in `connection'
	from /var/www/discourse/lib/site_settings/db_provider.rb:62:in `table_exists?'
	from /var/www/discourse/lib/site_settings/db_provider.rb:21:in `find'
	from /var/www/discourse/lib/site_settings/defaults_provider.rb:109:in `block in refresh_site_locale!'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
	from /usr/local/lib/ruby/gems/2.4.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:73:in `each_connection'
	from /var/www/discourse/lib/site_settings/defaults_provider.rb:103:in `refresh_site_locale!'
	from /var/www/discourse/lib/site_settings/defaults_provider.rb:20:in `initialize'
	from /var/www/discourse/lib/site_setting_extension.rb:35:in `new'
	from /var/www/discourse/lib/site_setting_extension.rb:35:in `defaults'
	from /var/www/discourse/lib/site_setting_extension.rb:72:in `block in setting'
	from /var/www/discourse/lib/site_setting_extension.rb:71:in `synchronize'
	from /var/www/discourse/lib/site_setting_extension.rb:71:in `setting'
	from /var/www/discourse/app/models/site_setting.rb:17:in `block in load_settings'
	from /var/www/discourse/lib/site_settings/yaml_loader.rb:25:in `block (2 levels) in load'
	from /var/www/discourse/lib/site_settings/yaml_loader.rb:11:in `each'
	from /var/www/discourse/lib/site_settings/yaml_loader.rb:11:in `block in load'
	from /var/www/discourse/lib/site_settings/yaml_loader.rb:10:in `each_key'
	from /var/www/discourse/lib/site_settings/yaml_loader.rb:10:in `load'
	from /var/www/discourse/app/models/site_setting.rb:16:in `load_settings'
	from /var/www/discourse/app/models/site_setting.rb:21:in `<class:SiteSetting>'
	from /var/www/discourse/app/models/site_setting.rb:4:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:379:in `block in require_or_load'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `block in load_interlock'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `load_interlock'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:357:in `require_or_load'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:510:in `load_missing_constant'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:202:in `const_missing'
	from /var/www/discourse/config/initializers/004-message_bus.rb:99:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:655:in `block in load_config_initializer'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:168:in `instrument'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:654:in `load_config_initializer'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:611:in `each'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:611:in `block in <class:Engine>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:48:in `each'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:48:in `tsort_each_child'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:415:in `call'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:415:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `call'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
	from /usr/local/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `public_send'
	from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `method_missing'
	from /var/www/discourse/config/environment.rb:5:in `<top (required)>'
	from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
	from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
	from script/import_scripts/mybb.rb:2:in `require'
	from script/import_scripts/mybb.rb:2:in `<main>'
root@sm64hacks-app:/var/www/discourse# 

(Nathaniel Suchy) #6

Any updates on fixing this issue?


(Régis Hanol) #7

Don’t run the import in production mode? :wink:

It’s best to run the import locally in a development environment.


(Nathaniel Suchy) #8

Does production mode intentionally fail? Could you send me instructoins for creating a development environment to do the import?


(Bryan Underwood) #9

Nathaniel, I just came across the same problem while using a custom script that I modified from the vanilla.rb importer. To fix this, I ran the import script inside of my docker instance. I was previously running it from /var/www/discourse/subfolder. When I ran it from /var/www/discourse everything worked.

It looks like there is a relative path coded somewhere in the pretty text dependency. Instead of it looking in the directory /var/www/discourse/lib/javascripts/, it is looking in the directory lib/javascripts/moment.js.

I hope this helps you or another.


(Bryan Underwood) #10

What’s “development” mode? :wink:

image


(Régis Hanol) #11

The mode we all use when working on Discourse (or any software)

https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md