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

Configfile-related errors aren't printed #493

Closed
jplitza opened this issue Feb 5, 2025 · 2 comments
Closed

Configfile-related errors aren't printed #493

jplitza opened this issue Feb 5, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jplitza
Copy link

jplitza commented Feb 5, 2025

Description

Any error messages related to parsing the config file (those) aren't printed.

Expected behavior

Helpful error messages why the config is ignored

Environment

Go Version:

Ionosctl version:

6.8.0

OS:

Ubuntu 24.04

Shell:

bash

Configuration Files

Anything that is considered invalid, e.g. invalid JSON or wrong permissions.

How to Reproduce

$ echo '{"userdata.token":"foo"}' > /tmp/ionosctl.json
$ chmod 0600 /tmp/ionosctl.json
$ ionosctl --config /tmp/ionosctl.json whoami --provenance
Note: Authentication failed!
Authentication layers, in order of priority:
  [1] Global Flags (--token)
  [2] Environment Variables (IONOS_TOKEN, IONOS_USERNAME, IONOS_PASSWORD)
* [3] Config file settings (userdata.token, userdata.name, userdata.password) (USED)
    - Using token for authentication.
    - Using https://api.ionos.com as the API URL.
$ chmod 0640 /tmp/ionosctl.json
Note: Authentication failed! None of the authentication layers had a token, or both username & password set.
Authentication layers, in order of priority:
  [1] Global Flags (--token)
  [2] Environment Variables (IONOS_TOKEN, IONOS_USERNAME, IONOS_PASSWORD)
  [3] Config file settings (userdata.token, userdata.name, userdata.password)

That last command should have said "failed config file permissions check: invalid permissions for /tmp/ionosctl.json: expected 0600, got 0640"

Error and Debug Output

Additional Notes

References

I think you're dropping the generated error here

@jplitza jplitza added the bug Something isn't working label Feb 5, 2025
@glimberea
Copy link
Contributor

Hi, thank you for bringing this up and apologies for the slow response! We've looked into it and we will include some additional error outputs in order to make debugging config file authentication easier.

@glimberea
Copy link
Contributor

This issue was resolved by #498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants