Project

General

Profile

Actions

Bug #26662

closed

Migration 20190103093409 AddDeploymentOptionToPolicy fails with existing policies

Added by Doug Forster about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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'

Actions #1

Updated by Doug Forster about 5 years ago

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

Actions #2

Updated by The Foreman Bot about 5 years ago

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

Updated by Marek Hulán almost 5 years ago

  • Fixed in Releases foreman_openscap 1.0.0 added
Actions #4

Updated by Anonymous almost 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF