Bug #6830

upgrade 1.4.5 to 1.5.2 results in "Invalid search query" error

Added by Gerard Reitsma over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Dominic Cleal
Category:DB migrations
Target version:Sprint 27
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/1639
Story points-
Velocity based estimate-
Release1.5.3Release relationshipAuto

Description

I updated from 1.4.5 to 1.5.2. After the upgrade the following error occured when starting foreman:

Validation failed: Search Invalid search query: Field 'compute_resource_id' not recognized for searching! (ActiveRecord::RecordInvalid)

After commenting out this line Foreman started: https://github.com/theforeman/foreman/blob/1.5-stable/app/models/filter.rb#L47


Related issues

Related to Foreman - Bug #5235: Filter creation allows me to enter and save with a field ... Closed 04/17/2014

Associated revisions

Revision 48c69213
Added by Dominic Cleal over 3 years ago

Fixes #6830 - Add host search on compute_resource_id used in 1.5 auth migrations

Revision bba2a265
Added by Dominic Cleal over 3 years ago

Fixes #6830 - Add host search on compute_resource_id used in 1.5 auth migrations

(cherry picked from commit 48c69213e70e1bc697b4a5487652549a8757a7a0)

Revision 98ef70bb
Added by Dominic Cleal about 3 years ago

Fixes #6830 - Add host search on compute_resource_id used in 1.5 auth migrations

(cherry picked from commit 48c69213e70e1bc697b4a5487652549a8757a7a0)

History

#1 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #5235: Filter creation allows me to enter and save with a field that isn't available for searching and blows up the resulting entity page added

#2 Updated by Dominic Cleal over 3 years ago

  • Subject changed from upgrade 1.4.5 to 1.5.2 results in error to upgrade 1.4.5 to 1.5.2 results in "Invalid search query" error
  • Category set to DB migrations
  • Release set to 1.5.3

#3 Updated by Dominic Cleal over 3 years ago

I think what's happening is we're creating a filter during DB migration (for 1.4 to 1.5 auth changes) and this is invalid.

#4 Updated by Dominic Cleal over 3 years ago

As a workaround, comment out this line in /usr/share/foreman/app/models/filter.rb, circa line 47:

validates_with ScopedSearchValidator

#5 Updated by Jason Barnett over 3 years ago

Just to give you some feeback. I ran into this problem and commenting out `validates_with ScopedSearchValidator` worked to get around the issue.

#6 Updated by Joshua Hoblitt over 3 years ago

I hit the same issue upgrading from 1.4 to the 1.5.2-1 RPMs. Commenting line 47 in filer.rb also fixed it.

#7 Updated by Dominic Cleal over 3 years ago

  • Assigned To set to Dominic Cleal

#8 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Target version set to Sprint 27
  • Pull request https://github.com/theforeman/foreman/pull/1639 added

#9 Updated by Dominic Cleal over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#10 Updated by Glen Ogilvie over 3 years ago

Thanks for the fix.. I was also affected.

Also available in: Atom PDF