Project

General

Profile

Bug #26662

Migration 20190103093409 AddDeploymentOptionToPolicy fails with existing policies

Added by Doug Forster over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:

Description

When trying to run migrations on foreman 1.21 a migration fails when there are existing policies defined.

Installed packages:
tfm-rubygem-foreman_openscap-0.12.3-1.fm1_21.el7.noarch
openscap-1.2.17-2.el7.x86_64
openscap-scanner-1.2.17-2.el7.x86_64

Error:
20190103093409 AddDeploymentOptionToPolicy: migrating ====================
-- add_column(:foreman_openscap_policies, :deploy_by, :string)
> 0.0660s
-
change_column(:foreman_openscap_policies, :deploy_by, :string, {:null=>false})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Invalid use of NULL value: ALTER TABLE `foreman_openscap_policies` CHANGE `deploy_by` `deploy_by` varchar(255) NOT NULL
/opt/theforeman/tfm/root/usr/share/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `_query'
/opt/theforeman/tfm/root/usr/share/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `block in query'
/opt/theforeman/tfm/root/usr/share/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:119:in `handle_interrupt'
/opt/theforeman/tfm/root/usr/share/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:119:in `query'

Associated revisions

Revision 9a6ba7f2 (diff)
Added by Ondřej Pražák over 3 years ago

Fixes #26662 - Fix adding deploy_by on mysql (#379)

History

#1 Updated by Doug Forster over 3 years ago

Later in the error
Caused by:
Mysql2::Error: Invalid use of NULL value

#2 Updated by The Foreman Bot over 3 years ago

  • Assignee set to Ondřej Pražák
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_openscap/pull/379 added

#3 Updated by Marek Hulán over 3 years ago

  • Fixed in Releases foreman_openscap 1.0.0 added

#4 Updated by Anonymous over 3 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF