Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add better error message when user inputs invalid value for environment flag

Open
#753 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go, kafka
Domain
cli

Research direction

Start with the Nais CLI implementations of kafka credentials, kafka grant-access, and kafka list, then trace how each environment flag is validated and how server errors are surfaced. Done means invalid dev/dev-gcp values produce specific guidance for the affected command instead of the generic server error.

Written by the indexing model from the issue text.

Description

I recently started to use the Nais CLI. While trying to run nais kafka credentials -t <team> -e dev-gcp --ttl 1d, I encountered an error message:

creating Kafka credentials: input:3:2: createKafkaCredentials The server errored out while processing your request, and we didn't write a suitable error message. You might consider that a bug on our side. Please try again, and if the error persists, contact the Nais team.

The error was caused by the environment flag being set to dev-gcp instead of dev. Running nais kafka grant-access or nais kafka list, however, accepts an environment flag dev-gcp, not dev.

As an easy mistake to make (and detect?), I suggest adding error messages explaining the invalid environment flag in the following cases:

  • nais kafka credentials should use -e dev, not -e dev-gcp
  • nais kafka grant-access should use -e dev-gcp, not -e dev
  • nais kafka list should use -e dev-gcp, not -e dev
Dominant language
Go
Stars
2
Forks
5
Avg merge
6h 59m
Merged PRs (30d)
36

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nais/cli

All issues in nais/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.