Skip to content

Handle non interactive TTYs (like Git Bash on Windows) #554

Closed

Description

@ttsirkia

When using Git Bash in Windows, the init fails with the following:

The above error occurred in the <TabIndexProvider> component:
    in TabIndexProvider
    in div (created by Box)
    in Box
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.

Seems to work fine with the standard command line.

Activity

  1. changed the title [-]Init fails in Windows with GIT Bash[/-] [+][Windows] `init` fails in Windows with GIT Bash[/+] on Sep 14, 2019
  2. added
    bug/2-confirmed
    kind/bug
    on Sep 14, 2019
  3. janpio commented on Sep 14, 2019

    @janpio
    Contributor

    I can confirm this:

    image

    Thanks for reporting.

  4. pantharshit00 commented on Sep 15, 2019

    @pantharshit00
    Contributor

    This was reported a few days ago(#401) but was closed because we thought it should have been fixed by the rewrite.

    I think it is solely related to Git Bash being a non-interactive TTY.

  5. changed the title [-][Windows] `init` fails in Windows with GIT Bash[/-] [+]Handle non interactive TTYs[/+] on Sep 17, 2019
  6. added
    kind/feature
    and removed
    bug/2-confirmed
    kind/bug
    on Sep 17, 2019
  7. janpio commented on Sep 17, 2019

    @janpio
    Contributor

    I renamed this issue to become a feature requests that can be added to the CLI. Until this is implemented, we unfortunately do not support non interactive TTYs like Git Bash on Windows.

  8. changed the title [-]Handle non interactive TTYs[/-] [+]Handle non interactive TTYs (like Git Bash on Windows)[/+] on Sep 17, 2019
  9. pantharshit00 commented on Sep 17, 2019

    @pantharshit00
    Contributor

    @ttsirkia You can use https://hyper.is if you are using Git Bash as a replacement. That one is a good interactive TTY

  10. divyenduz commented on Sep 20, 2019

    @divyenduz

    Internal note: dropping because of product priority

  11. 4 remaining items

  12. janpio commented on Oct 5, 2019

    @janpio
    Contributor

    I just researched ink in non interactive TTYs for something related, but as this information might be relevant here as well I will just dump it:

    You can reproduce the problem in an interactive TTY quite simply:

    • echo "foo" | prisma2 -v works
    • echo "foo" | prisma2 init foo does not

    Possibly related ink stuff:
    vadimdemedes/ink#40
    https://github.com/vadimdemedes/ink/pull/42/files

    Some more info around related things:
    vadimdemedes/ink#166
    vadimdemedes/ink#172

    Our probably affected file:
    https://github.com/prisma/prisma2/blob/4aef53c9db0f02af5351d90facb08de184237865/cli/ink-components/src/hooks/useStdin.ts


    Rereading this issue here, is it possible that the actual error message is missing? Usually the "The above error..." refers to something output right before - but here there is nothing.

  13. ViableClanMember commented on Oct 14, 2019

    @ViableClanMember

    Another solution is to try winpty bash before prisma2

  14. janpio commented on Oct 15, 2019

    @janpio
    Contributor

    Another solution is to try winpty bash before prisma2

    Interesting suggestion @ViableClanMember. Unfortunately this gives me:

    $ winpty bash prisma2 init
    internal/modules/cjs/loader.js:638
        throw err;
        ^
    
    Error: Cannot find module 'C:\Users\Jan\node_modules\prisma2\build\index.js'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
        at Function.Module._load (internal/modules/cjs/loader.js:562:25)
        at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
        at startup (internal/bootstrap/node.js:283:19)
        at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
    
    

    in Git Bash on Windows 10. Am I doing it wrong? But I am also getting it on $ winpty bash prisma2 -v, so this doesn't seem to work for me in general.

  15. MikeyUchiha commented on Dec 7, 2019

    @MikeyUchiha

    @janpio Not sure if you're the best person to ask but can you please add this to the roadmap? It's a big blocker to use this in Docker Compose and Kubernetes.
    It's even referenced in your limitations documentation here: https://github.com/prisma/prisma2/blob/master/docs/limitations.md
    And yet doesn't seem to be being worked on at all.

  16. janpio commented on Dec 7, 2019

    @janpio
    Contributor

    I am not really, but that's fine. In exchange you have to explain the usecase of prisma2 init in a docker compose or kubernetes environment to me - then I might be able to help out ;)

  17. MikeyUchiha commented on Dec 7, 2019

    @MikeyUchiha

    Sure!
    I want to be able to load up my database, prisma2, and app as separate containers. See this docker-compose.yml file.

    image

    Unfortunately, when I try and run it I get the following error:
    image
    Which has to do with the fact that interactive windows don't work. Ultimately, I want to be able to run Prisma in a Kubernetes environment and the first step is getting it to work correctly in a Docker Compose environment.

    image
    This is my current folder structure. I had to add a package.json file to my prisma folder just to be able to get it to run.

  18. pantharshit00 commented on Dec 9, 2019

    @pantharshit00
    Contributor

    You are running the dev command inside the container. I will not recommend that.

    Also, you can get an interactive prompt in docker with the -i flag.

  19. self-assigned this
    on Dec 13, 2019
  20. MikeyUchiha commented on Dec 14, 2019

    @MikeyUchiha

    @pantharshit00 I should be able to just run a command in kubernetes and docker in a ci/cd pipleline.

  21. MikeyUchiha commented on Dec 14, 2019

    @MikeyUchiha

    requiring someone to have to create an interactive docker isn't possible in kubernetes.

  22. Jolg42 commented on Feb 14, 2020

    @Jolg42
    Contributor

    The init command is not interactive anymore and we check if we are in a TTY env in the code when appropriate.

    When I tried on Windows recently it was working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/featuretopic: cli

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions