Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CLI | Windows | Creating initial user fails with TTY error #454

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
bryphe-coder opened this issue Mar 16, 2022 · 3 comments
Closed

CLI | Windows | Creating initial user fails with TTY error #454

bryphe-coder opened this issue Mar 16, 2022 · 3 comments
Labels
api Area: HTTP API
Milestone

Comments

@bryphe-coder
Copy link
Contributor

bryphe-coder commented Mar 16, 2022

Overview

On Windows, if I try to run the coder login command flow to create an initial user, the command fails with: Error: the initial user cannot be created in non-interactive mode

See @vapurrmaid 's screenshot:

image

The bug is that we rely on a helper library - isatty to decide if we can handle input. The isatty function has an open issue for detecting Windows terminals

A temporary workaround is to use the --force-tty flag for the CLI. This overrides the check, and tells the binary to assume it is used in a tty. We implemented this to ensure the tests pass reliably on automation, and we assumed that this bug only occurred in automated tests - but it seems like that assumption was invalid.

It looks like in @vapurrmaid 's case - a MINGW console is used. We should evaluate the isatty behavior on a few different consoles in Windows (because there are a lot of cases...):

  • Raw win32 console (cmd.exe)
  • Powershell (powershell.exe)
  • MINGW Bash
  • Cygwin Bash
@greyscaled
Copy link
Contributor

greyscaled commented Mar 16, 2022

I can confirm that I'm using Git BASH (MINGW)

@bryphe-coder
Copy link
Contributor Author

Here's a few relevant spots in the code to look

@greyscaled greyscaled removed the go label Apr 4, 2022
@misskniss
Copy link

Closing this. It has been fixed.

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

No branches or pull requests

3 participants