Skip to content

CLI: getting "Validation failed name: username" error in cli in case workspace or template name does not follow allowed pattern #1673

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

Closed
nadzeyav opened this issue May 23, 2022 · 2 comments · Fixed by #3390
Labels
api Area: HTTP API

Comments

@nadzeyav
Copy link

OS Information

  • OS: Windows 10
  • coder --version:
    Coder v0.5.10+ba818b3 Wed May 18 00:07:20 UTC 2022
    ba818b3

Steps to Reproduce

  1. Init any template
  2. Run "coder template create wrong-name_ -d "[path to template]"
  3. Set service account key
  4. Confirm create? (yes/no) yes

Expected

Any error message that template name has a wrong format is displayed

Actual

status code 400: Validation failed
name: username

The same for a new worskpace created with CLI.

What is your suggestion?

Currently if Workspace Name or Template Name does not match names rules: "Name must start with a-Z or 0-9 and can contain a-Z, 0-9 or -."
in CLI the resulting error is:

status code 400: Validation failed
name: username

That is confusing since this is not username that causes the error, but template name or workspace name in case workspace was created.

Logs

Screenshot

Template error

image

Workspace error

image

Notes

@misskniss misskniss added the api Area: HTTP API label May 24, 2022
@kylecarbs kylecarbs changed the title Bug: CLI: getting "Validation failed name: username" error in cli in case workspace or template name does not follow allowed pattern CLI: getting "Validation failed name: username" error in cli in case workspace or template name does not follow allowed pattern Jun 7, 2022
@github-actions
Copy link

github-actions bot commented Aug 7, 2022

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Aug 7, 2022
@mafredri
Copy link
Member

mafredri commented Aug 8, 2022

This issue will be fixed by #3390, once merged, the output will look like this:

> Confirm create? (yes/no)
Validation failed.
- name: Validation failed for tag "template_name" with value: "wrong-name_"
Run 'coder templates create --help' for usage.

@github-actions github-actions bot removed the stale This issue is like stale bread. label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants