theforeman/foreman · error · Foreman::FingerprintException
The remote system presented a public key with hash %s but we
Error message
The remote system presented a public key with hash %s but we're expecting a different hash. If you are sure the remote system is authentic, go to the compute resource edit page, press the 'Test Connection' or 'Load Datacenters' button and submit
What it means
Error "The remote system presented a public key with hash %s but we're expecting a different hash. If you are sure the remote system is authentic, go to the compute resource edit page, press the 'Test Connection' or 'Load Datacenters' button and submit" thrown in theforeman/foreman.
Source
Thrown at app/models/compute_resources/foreman/model/vmware.rb:796
def update_public_key(options = {})
return unless pubkey_hash.blank? || options[:force]
client
rescue Foreman::FingerprintException => e
self.pubkey_hash = e.fingerprint
end
def client
@client ||= ::Fog::Compute.new(
:provider => "vsphere",
:vsphere_username => user,
:vsphere_password => password,
:vsphere_server => server,
:vsphere_expected_pubkey_hash => pubkey_hash
)
rescue => e
case e.message
when /The remote system presented a public key with hash (\w+) but we're expecting a hash of/
raise Foreman::FingerprintException.new(
N_("The remote system presented a public key with hash %s but we're expecting a different hash. If you are sure the remote system is authentic, go to the compute resource edit page, press the 'Test Connection' or 'Load Datacenters' button and submit"), Regexp.last_match(1))
when /Cannot complete login due to an incorrect user name or password./
raise Foreman::UsernameOrPasswordException.new(
N_("Can not load datacenters due to an incorrect user name or password."))
else
raise e
end
end
def unused_vnc_port(ip)
10.times do
port = rand(5901..5964)
unused = (TCPSocket.connect(ip, port).close rescue true)
return port if unused
end
raise "no unused port found"
end
View on GitHub (pinned to 6b05625475)
When it happens
Trigger: Thrown at app/models/compute_resources/foreman/model/vmware.rb:796 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23).
Data as JSON: /api/errors/cfa6a0f884e0ba61.
Report an issue: GitHub.