Search code examples
dvc

Git bash command prompt hanging when running dvc push to DAGsHub


I'm having problems pushing files with DVC to DAGsHub.

Workflow:

  • I used my email to signup to DAGsHub.
  • I created a repo and clone it to my computer.
  • I added files to the repo and track them using DVC and Git to track the pointer files.
  • Running DVC push -r origin, it asks me for my password. When I enter the password and hit enter - nothing happens.

It sits and waits, barring me from even canceling the operation with Ctrl+C. I'm forced to manually close the terminal, open a new one, ending the "Python" process in task manager and delete the lock file in .dvc/tmp/lock.


Solution

  • Short answer

    Do not use ask_password. Instead, save your token in the local config by running once:

    dvc remote modify origin --local --unset ask_password
    dvc remote modify origin --local password <--access token-->
    

    dvc push -r origin should work then.

    Long answer

    Git Bash is not running the regular Windows command prompt but an emulated Unix-style bash prompt. From the information in your question, I cannot know for sure, but this is probably causing the msvcrt package used by DVC to prompt the password on windows machines to fail/hang.

    There are potentially 3 ways to deal with the issue:

    1. Run dvc pull from the regular Windows cmd prompt.
    2. Find a way to make Git Bash wrap Python calls with winpty - I am not 100% positive about how to do this, but not using winpty seems to be the reason msvcrt fails at prompting for your password.
    3. The simplest solution - Do not use ask_password. Instead, save your token in the local config by running once:
      dvc remote modify origin --local --unset ask_password
      dvc remote modify origin --local password <--access token-->
      
      You can get your access token by clicking on the question mark beside the DVC remote of your DAGsHub repository, then click on "Reveal my token".