Project

General

Profile

Actions

Bug #6830

closed

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

Added by Gerard Reitsma over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DB migrations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 1 (0 open1 closed)

Related to Foreman - 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 pageClosed04/17/2014Actions
Actions #1

Updated by Dominic Cleal over 9 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
Actions #2

Updated by Dominic Cleal over 9 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
  • translation missing: en.field_release set to 20
Actions #3

Updated by Dominic Cleal over 9 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.

Actions #4

Updated by Dominic Cleal over 9 years ago

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

validates_with ScopedSearchValidator
Actions #5

Updated by Jason Barnett over 9 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.

Actions #6

Updated by Joshua Hoblitt over 9 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.

Actions #7

Updated by Dominic Cleal over 9 years ago

  • Assignee set to Dominic Cleal
Actions #8

Updated by The Foreman Bot over 9 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 1.7.5
  • Pull request https://github.com/theforeman/foreman/pull/1639 added
  • Pull request deleted ()
Actions #9

Updated by Dominic Cleal over 9 years ago

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

Updated by Glen Ogilvie over 9 years ago

Thanks for the fix.. I was also affected.

Actions

Also available in: Atom PDF