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

Error when trying to run "apikeys" commands after initially adding a random API key. #477

Open
olamilekan000 opened this issue Oct 11, 2024 · 0 comments

Comments

@olamilekan000
Copy link

olamilekan000 commented Oct 11, 2024

Issue

I encounter an error when trying to run any "apikeys" sub-commands like, remove, list, show, and save after successfully adding an API key for the first time. The error is as follows:

Unable to list regions: DatabaseAccountNotFoundError: Failed to find the account within the internal databaseError getting supported regions to feature DatabaseAccountNotFoundError: Failed to find the account within the internal database 

When I checked why this error occurs, I discovered it was due to this block

	if Current.Meta.CurrentAPIKey != "" && Current.RegionToFeatures == nil {
		Current.RegionToFeatures, err = regionsToFeature()
		if err != nil {
			fmt.Printf("Error getting supported regions to feature %s \n", err)
			os.Exit(1)
		}

		dataBytes, err := json.Marshal(Current)
		if err != nil {
			fmt.Printf("Error parsing JSON %s \n", err)
			os.Exit(1)
		}

		err = os.WriteFile(filename, dataBytes, 0600)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	}

The API key is set, but it fails when trying to fetch the features for the default region using that key."

Acceptance Criteria

  • I should be able to run the save subcommand as many times as needed without errors.
  • I should be able to run the remove subcommand as many times as needed without errors.
  • I should be able to run the list subcommand as many times as needed without errors.
  • I should be able to run the remove subcommand as many times as needed without errors.
@olamilekan000 olamilekan000 changed the title Error When trying to run "apikeys" commands after initially adding a random API key. Error when trying to run "apikeys" commands after initially adding a random API key. Oct 11, 2024
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