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

To inform user about the cause of error while loading credential json file #45

Open
rahulcsaple opened this issue May 10, 2022 · 0 comments

Comments

@rahulcsaple
Copy link

When wrong path for credential.json file was supplied

(.py39) rahulcs@DESKTOP-FFFN7ID:~/.netfoundry$ nfctl --verbose -C /mnt/c/Users/rahul/Desktop/credentials.json -P cldeng
☐ spinner disabled because DEBUG is enabled
☐ got spinner as function param
☐ token cache dir exists with mode drwx------
☐ cache file path is computed '/home/rahulcs/.cache/netfoundry/cldeng.json'
☐ ignoring exception while checking for token cache, caught cache file '/home/rahulcs/.cache/netfoundry/cldeng.json' not found, caught [Errno 2] No such file or directory: '/home/rahulcs/.cache/netfoundry/cldeng.json'
☐ no bearer token found
☐ got Organization(credentials=/mnt/c/Users/rahul/Desktop/credentials.json)
☐ no credentials file /mnt/c/Users/rahul/Desktop/credentials.json in project-default directory
☐ no credentials file /mnt/c/Users/rahul/Desktop/credentials.json in user-default directory
☐ no credentials file /mnt/c/Users/rahul/Desktop/credentials.json in device-default directory
☐ no credentials file /mnt/c/Users/rahul/Desktop/credentials.json in site-default directory
☐ credentials file '/mnt/c/Users/rahul/Desktop/credentials.json' does not exist
☐ token renewal impossible because API account credentials are not configured
☐ cached token file '/home/rahulcs/.cache/netfoundry/cldeng.json' does not exist
☐ caught no credentials exception from organization, prompting for token
Enter Bearer Token:

image

When correct path for credential.json file was supplied - SUCCESSFUL

(.py39) rahulcs@DESKTOP-FFFN7ID:~/.netfoundry$ nfctl --verbose -C /mnt/c/Users/rahul/Downloads/New_API/credentials.json -P cldeng
☐ spinner disabled because DEBUG is enabled
☐ got spinner as function param
☐ token cache dir exists with mode drwx------
☐ cache file path is computed '/home/rahulcs/.cache/netfoundry/cldeng.json'
☐ ignoring exception while checking for token cache, caught cache file '/home/rahulcs/.cache/netfoundry/cldeng.json' not found, caught [Errno 2] No such file or directory: '/home/rahulcs/.cache/netfoundry/cldeng.json'
☐ no bearer token found
☐ got Organization(credentials=/mnt/c/Users/rahul/Downloads/New_API/credentials.json)
☐ found credentials file '/mnt/c/Users/rahul/Downloads/New_API/credentials.json'
☐ configured credentials from file '/mnt/c/Users/rahul/Downloads/New_API/credentials.json'
☐ cached token file '/home/rahulcs/.cache/netfoundry/cldeng.json' does not exist
☐ renewing token with credentials
☐ using environment parsed from token_endpoint URL production
☐ using audience parsed from token_endpoint URL https://gateway.production.netfoundry.io/
☐ Starting new HTTPS connection (1): netfoundry-production-xfjiye.auth.us-east-1.amazoncognito.com:443
https://netfoundry-production-xfjiye.auth.us-east-1.amazoncognito.com:443 "POST /oauth2/token HTTP/1.1" 200 None
☐ computed expiry epoch 1652197778 from 'expires_in=3600'
☐ bearer token expiry in 3600s
☐ cached token in '/home/rahulcs/.cache/netfoundry/cldeng.json'
☐ detected resource type identities
☐ no handlers specified for url 'https://gateway.production.netfoundry.io/identity/v1/identities/self'
☐ Starting new HTTPS connection (1): gateway.production.netfoundry.io:443
https://gateway.production.netfoundry.io:443 "GET /identity/v1/identities/self HTTP/1.1" 200 None
https://gateway.production.netfoundry.io:443 "GET /rest/v1/network-groups?sort=name%2Casc&size=1000&page=1 HTTP/1.1" 200 None
☐ detected resource type organizations
☐ no handlers specified for url 'https://gateway.production.netfoundry.io/identity/v1/organizations/95068bb0-864b-4930-b06e-9acf4957c826'
https://gateway.production.netfoundry.io:443 "GET /identity/v1/organizations/95068bb0-864b-4930-b06e-9acf4957c826 HTTP/1.1" 200 None
https://gateway.production.netfoundry.io:443 "GET /rest/v1/network-groups?sort=name%2Casc&size=1000&page=1 HTTP/1.1" 200 None
☐ logged-in organization label is cldeng.
☐ not configuring network or network group
Domain | Summary
-----------+----------------------------------------------------------
Caller ID | rahul api (rahul.saple@netfoundry.io) in cldeng (cldeng)

ℹ try running 'nfctl list networks'

It would be helpful for the user if exact reason of failure is indicated as a message.

Ref: https://mattermost.tools.netfoundry.io/netfoundry/pl/ic8jt5yrfbb9xr3gqarpcztqgo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant