Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracious message when vault is not reachable #14942

Merged
merged 1 commit into from
May 10, 2024

Conversation

jyejare
Copy link
Member

@jyejare jyejare commented May 3, 2024

Problem Statement

When the VPN is not connected today, an unclear/lengthy traceback:

# make vault-login                                  
2024-05-03 15:16:29 - robottelo - ERROR - Error! b'Error authenticating: Put "https://vault.example.com:8200/v1/auth/oidc/oidc/auth_url": dial tcp: lookup vault.example.com: no such host\n'
Traceback (most recent call last):
  File "/Users/jyejare/gitrepos/robottelo/scripts/vault_login.py", line 10, in <module>
    vclient.login()
  File "/Users/jyejare/gitrepos/robottelo/robottelo/utils/vault.py", line 94, in login
    token = json.loads(str(token.decode('UTF-8')))['data']['id']
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
make: *** [vault-login] Error 1

Solution

When the VPN is not connected with this PR, a nice message:

# make vault-login                                            
2024-05-03 15:11:07 - robottelo - INFO - The Vault host is not reachable, check network availability

Related Issues

@jyejare jyejare requested a review from a team as a code owner May 3, 2024 09:47
@jyejare jyejare added CherryPick PR needs CherryPick to previous branches 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels May 3, 2024
@jyejare jyejare enabled auto-merge (squash) May 10, 2024 07:10
@jyejare jyejare merged commit cdf898a into SatelliteQE:master May 10, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request May 10, 2024
github-actions bot pushed a commit that referenced this pull request May 10, 2024
github-actions bot pushed a commit that referenced this pull request May 10, 2024
github-actions bot pushed a commit that referenced this pull request May 10, 2024
jyejare added a commit that referenced this pull request May 10, 2024
Gracious message when vault is not reachable (#14942)

(cherry picked from commit cdf898a)

Co-authored-by: Jitendra Yejare <[email protected]>
jyejare added a commit that referenced this pull request May 10, 2024
Gracious message when vault is not reachable (#14942)

(cherry picked from commit cdf898a)

Co-authored-by: Jitendra Yejare <[email protected]>
jyejare added a commit that referenced this pull request May 10, 2024
Gracious message when vault is not reachable (#14942)

(cherry picked from commit cdf898a)

Co-authored-by: Jitendra Yejare <[email protected]>
Gauravtalreja1 pushed a commit that referenced this pull request May 10, 2024
Gracious message when vault is not reachable (#14942)

(cherry picked from commit cdf898a)

Co-authored-by: Jitendra Yejare <[email protected]>
jyejare added a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants