Project

General

Profile

Actions

Bug #3603

closed

ActiveRecord::StatementInvalid and postgres undefinedtable when searching puppetclasses in Foreman 1.3.0

Added by Jason Ashby over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi guys, I searched through the issues, but did not see this one already...

In Foreman 1.3.0, when searching puppetclasses in the web gui, e.g. http://foreman/puppetclasses?utf8=%E2%9C%93&search=webcerts, I get the following error:

ActiveRecord::StatementInvalid
PG::UndefinedTable: ERROR: missing FROM-clause entry for table "environments" LINE 1: ...RE (("puppetclasses"."name" ILIKE '%webcerts%' OR "environme... ^ : SELECT "puppetclasses"."id" FROM "puppetclasses" WHERE (("puppetclasses"."name" ILIKE '%webcerts%' OR "environments"."name" ILIKE '%webcerts%' OR "hostgroups"."name" ILIKE '%webcerts%' OR "lookup_keys"."key" ILIKE '%webcerts%')) ORDER BY puppetclasses.name LIMIT 20 OFFSET 0
app/controllers/puppetclasses_controller.rb:17:in `index'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

I just upgraded to Foreman 1.3.0 from 1.2.2. Here is my puppetmaster/foreman host setup:

CentOS 6.4
Puppet 3.3.1
PuppetDB 1.5.2
Postgres 9.1 databases for Foreman and puppetDB
Puppet master and Foreman are served via Apache 2.4.6 and passenger 4.0.5
Ruby 1.8.7

I upgraded the node.rb and foreman.rb scripts per http://theforeman.org/manuals/1.3/index.html#Upgradenotes. There's definitely an "environments" table that exists in the foreman postgres DB.

Let me know if you need more info.

Actions #1

Updated by Dominic Cleal over 10 years ago

  • translation missing: en.field_release set to 3

I'm surprised this got through RCs! Thanks for the report.

Actions #2

Updated by Anonymous over 10 years ago

Similarly, when ordering puppet classes by environment (/puppetclasses?order=environment+ASC&search=), I see:

SQLite3::SQLException: no such column: environments.name: SELECT "puppetclasses"."id" FROM "puppetclasses" ORDER BY "environments"."name" ASC LIMIT 20 OFFSET 0
Completed 500 Internal Server Error in 11.9ms

ActiveRecord::StatementInvalid (SQLite3::SQLException: no such column: environments.name: SELECT "puppetclasses"."id" FROM "puppetclasses" ORDER BY "environments"."name" ASC LIMIT 20 OFFSET 0):

Actions #3

Updated by Anonymous over 10 years ago

  • Status changed from New to Assigned
Actions #4

Updated by Anonymous over 10 years ago

  • Target version set to 1.10.0
  • Assignee set to Anonymous
Actions #5

Updated by Anonymous over 10 years ago

  • Status changed from Assigned to Ready For Testing
Actions #6

Updated by Anonymous over 10 years ago

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

Also available in: Atom PDF