Project

General

Profile

Actions

Bug #12623

closed

CRs with integer UUIDs cause DB error on VM association: operator does not exist: character varying = integer

Added by Dominic Cleal about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Compute resources that return integers from the #identity method of Fog server objects throw an error during VM/host association as Rails tries to compare an integer to a string column.

PGError: ERROR: operator does not exist: character varying = integer LINE 1: ..."hosts"."compute_resource_id" = 1 AND "hosts"."uuid" IN (21) ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. : SELECT COUNT(*) FROM "hosts" WHERE "hosts"."organization_id" IN (1) AND "hosts"."location_id" IN (2) AND "hosts"."type" IN ('Host::Managed') AND "hosts"."compute_resource_id" = 1 AND "hosts"."uuid" IN (21)

This is called from the Host::Managed.for_vm scope.

Reported at https://github.com/theforeman/foreman-one/issues/8 and I suspect it may also affect foreman-digitalocean whose Fog server does the same.

Actions

Also available in: Atom PDF