dvc: get/import: improve error message on no default remote

Since we allow importing/getting files that are not cached this error does not make much sense:

failed to import 'model.pkl' from '../test-import/'. - config file error: no remote specified. Setup default remote with

in a lot of cases.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 19 (18 by maintainers)

Most upvoted comments

Let’s discuss remote function param or cli in #2466. And leave this issue for message only.

@efiop renamed the issue, created new ticket for lifting the remote requirement, so that we do not lost track of it.

@pared Sorry for the delay. Sure, feel free!

@shcheklein That’s a good point! Thinking about it, that issue is only relevant for erepo.pull(and friends). When you are accessing regular non-cached files, that one is not called. So it would be best to keep that in mind when fixing this. Will do.

Btw, it’s the second time someone is asking us about adding a parameter to specify remote that should be used for an external repo. Just for the record.

@Suor @efiop if we allow non-cached artifacts to be pulled from an external repo, why would we require any remotes at all? The case can (and we had something like this in the past) - use it to collect metrics and use dvc metrics show exclusively. And other cases, of course.

+1 for improving messages.

@shcheklein, @Suor I found out I could not run dvc import if the source repo has no default remote set. Also, the error I got (see below) confused me, because it made me think I had to run dvc config core.remote in the working repository.

ERROR: failed to import 'models/spacy_model/' from 'git@gitlab.com:iomed/datascience/spacy-model-es-cat'. - config file error: no remote specified. Setup default remote with
    dvc config core.remote <name>
or use:
    dvc pull -r <name>

As a newbie dvc user who might be missing something, I’d say it would be useful to:

  • Skip the error message shown by @shcheklein
  • If no default remotes are set:
    • in the source repository, have a more explicit error message indicating that the problem is in the source repository.
    • Have a parameter to indicate the remote to use, maybe?