Project

General

Profile

Bug #8591

Selecting domain in New Host dialog results in PGError and no subnets being available

Added by Adam Ruzicka almost 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Steps to reproduce:
Create domain and subnet, assign the subnet to the domain
Hosts > New Host
Select Organization and location
Switch to Network tab
Select domain

Expected behavior:
Subnet list provides available subnets for the domain

Current behavior:
No subnets are available. PGError received from controller but not shown

PGError:


Warning!
PGError: ERROR: column reference "id" is ambiguous LINE 1: SELECT id FROM "subnets" INNER JOIN "subnet_domains" ON "sub... ^ : SELECT id FROM "subnets" INNER JOIN "subnet_domains" ON "subnets"."id" = "subnet_domains"."subnet_id" WHERE "subnets"."id" IN (1) AND "subnet_domains"."domain_id" = 1 ORDER BY vlanid

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
ActiveRecord::StatementInvalid
PGError: ERROR: column reference "id" is ambiguous LINE 1: SELECT id FROM "subnets" INNER JOIN "subnet_domains" ON "sub... ^ : SELECT id FROM "subnets" INNER JOIN "subnet_domains" ON "subnets"."id" = "subnet_domains"."subnet_id" WHERE "subnets"."id" IN (1) AND "subnet_domains"."domain_id" = 1 ORDER BY vlanid
app/helpers/hosts_and_hostgroups_helper.rb:31:in `domain_subnets'
app/views/common/_domain.html.erb:2:in `block in _app_views_common__domain_html_erb___3366442248415189655_70262450388580'
app/views/common/_domain.html.erb:1:in `_app_views_common__domain_html_erb___3366442248415189655_70262450388580'
app/controllers/concerns/foreman/controller/host_details.rb:49:in `block in assign_parameter'
app/models/taxonomy.rb:59:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:148:in `as_location'
app/models/taxonomy.rb:58:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:113:in `as_org'
app/models/taxonomy.rb:57:in `as_taxonomy'
app/controllers/concerns/foreman/controller/host_details.rb:46:in `assign_parameter'
app/controllers/concerns/foreman/controller/host_details.rb:22:in `block (2 levels) in domain_selected'
app/controllers/concerns/foreman/controller/host_details.rb:21:in `domain_selected'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call' 

Installed on centos 6.5 from nightly at 5.12. with options

--capsule-dhcp=true \
    --capsule-dhcp-range='192.168.115.10 192.168.115.254' \
    --capsule-dhcp-gateway=192.168.115.1 \
    --capsule-dhcp-interface=eth0 \
    --capsule-dns=true \
    --capsule-dns-reverse='115.168.192.in-addr.arpa' \
    --capsule-dns-zone='v2' \
    --capsule-tftp=true" 


Related issues

Related to Foreman - Bug #8221: subnet not matching domain available as choice when creating new hostClosed2014-10-30

Associated revisions

Revision 395613b4 (diff)
Added by Shlomi Zadok almost 6 years ago

fixes #8591 - explicitly set where to subnets.id

Revision a5c8b2e5 (diff)
Added by Shlomi Zadok almost 6 years ago

fixes #8591 - explicitly set where to subnets.id

(cherry picked from commit 395613b415d03bdf82c7a327abad4c9e46fdc99e)

History

#1 Updated by Dominic Cleal almost 6 years ago

  • Category set to Organizations and Locations

#2 Updated by Dominic Cleal almost 6 years ago

  • Related to Bug #8221: subnet not matching domain available as choice when creating new host added

#3 Updated by Dominic Cleal almost 6 years ago

  • Legacy Backlogs Release (now unused) set to 28

#4 Updated by The Foreman Bot almost 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2002 added
  • Pull request deleted ()

#5 Updated by Shlomi Zadok almost 6 years ago

  • Assignee set to Shlomi Zadok

#6 Updated by Shlomi Zadok almost 6 years ago

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

#7 Updated by Dominic Cleal almost 6 years ago

  • Legacy Backlogs Release (now unused) changed from 28 to 29

Also available in: Atom PDF