Project

General

Profile

Actions

Bug #20968

open

invalid YAML in lookup keys can break db migrations

Added by Ohad Levy about 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

StandardError: An error has occurred, this and all later migrations canceled:

(<unknown>): found character that cannot start any token while scanning for the next token at line 1 column 5
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/coders/yaml_column.rb:24:in `load'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/type/serialized.rb:18:in `deserialize'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/attribute.rb:140:in `type_cast'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/attribute.rb:38:in `value'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/attribute_set.rb:44:in `fetch_value'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/attribute_methods/read.rb:66:in `_read_attribute'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/attribute_methods/read.rb:36:in `__temp__4656661657c647f56716c65756'
/home/ohad/git/foreman/db/migrate/20170112175131_migrate_template_to_parameters_macros.rb:25:in `block (2 levels) in up'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/relation/delegation.rb:38:in `each'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/relation/delegation.rb:38:in `each'
/home/ohad/git/foreman/db/migrate/20170112175131_migrate_template_to_parameters_macros.rb:24:in `block in up'
/home/ohad/git/foreman/db/migrate/20170112175131_migrate_template_to_parameters_macros.rb:23:in `each'
/home/ohad/git/foreman/db/migrate/20170112175131_migrate_template_to_parameters_macros.rb:23:in `up'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:792:in `exec_migration'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:773:in `block (2 levels) in migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:772:in `block in migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `with_connection'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:771:in `migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration/compatibility.rb:121:in `migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:951:in `migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1232:in `block in execute_migration_in_transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1300:in `block in ddl_transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `block in transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/transaction.rb:189:in `within_new_transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/transactions.rb:211:in `transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1300:in `ddl_transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1231:in `execute_migration_in_transaction'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1203:in `block in migrate_without_lock'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `each'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `migrate_without_lock'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1152:in `migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:1006:in `up'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/migration.rb:984:in `migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/tasks/database_tasks.rb:163:in `migrate'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activerecord-5.0.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:287:in `load'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:287:in `block in load'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/ohad/.rvm/gems/ruby-2.4.1/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:287:in `load'
-e:1:in `<main>'
Psych::SyntaxError: (<unknown>): found character that cannot start any token while scanning for the next token at line 1 column 5

Related issues 1 (0 open1 closed)

Related to Foreman - Feature #16740: Host parameters should be available in templates using some macroClosedOndřej Pražák09/29/2016Actions
Actions

Also available in: Atom PDF