Commit e26d0f5e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'tc-geo-faulty-primary-db-key' into 'master'

Geo: Gracefully catch incorrect db key on primary

Closes #2869

See merge request !2819
parents 8e502d68 b34ef831
......@@ -35,6 +35,8 @@ module Geo
Array([message, details].compact.join("\n"))
end
rescue OpenSSL::Cipher::CipherError
['Error decrypting the Geo secret from the database. Check that the primary uses the correct db_key_base.']
rescue HTTParty::Error, Timeout::Error, SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED => e
[e.message]
end
......
---
title: 'Geo: Gracefully catch incorrect db key on primary'
merge_request: 2819
author:
type: fixed
......@@ -52,5 +52,15 @@ describe Geo::NodeStatusService do
expect(status.health).to eq("Could not connect to Geo node - HTTP Status Code: 401 Unauthorized\n")
end
it 'returns meaningful error message when primary uses incorrect db key' do
secondary # create it before mocking GeoNode#secret_access_key
allow_any_instance_of(GeoNode).to receive(:secret_access_key).and_raise(OpenSSL::Cipher::CipherError)
status = subject.call(secondary)
expect(status.health).to eq('Error decrypting the Geo secret from the database. Check that the primary uses the correct db_key_base.')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment