Dvc remote cannot be setup

I once tried to setup a remote and I could do it, although push failed
(this question Failing to push to a NAS - #2 by kupruser)

However all of a sudden setting remotes give all kind of errors and I am overwhelmed. Certainly using dvc can not be this complex

Following the advice of the linked question I mounted my NAS in local and I did

 dvc remote add -d
 mountedremote /home/me/RemoteAccess/DataDVCTry

Then I tried to push but it says

ERROR: unexpected error - [Errno 13] Permission denied:

Ok… I suppose I need some kind of password. So I tried to do what I did before without problems and now it doesnt work

 dvc remote modify --local mountedremote user me
ERROR: configuration error - config file error: extra keys not allowed @ data['remote']['mountedremote']['user']
dvc remote modify mountedremote auth basic
ERROR: configuration error - config file error: extra keys not allowed @ data['remote']['mountedremote']['auth']

What are these “extra keys”?

I am planning to incorporate DVC in my work and introduce it to my company but frankly if it is going to be this complicated I am rethinking the idea…

Is the remote mounted as read-only? Could you please provide a verbose output (add -v to the push command, please)?

Since it is a local filesystem, you don’t need to set user or password. They are only useful for remote filesystems where you access them via ssh/http/webdav, or and other methods.

If you have mounted the NAS as read-only, please mount it with read/write permissions so that dvc can push files to it.

There is the possibility (I didnt check before umounting it) that it was RO.

But is the lack of permissions of a remote originate that now none of the dvc commands work? Not even dvc status? That is very odd…

Anyway I remounted with RW permissions but of course nothing in dvc works.
For example

 dvc remote add -d myremote /home/me/RemoteAccess/DataDVCTry/ 
Setting 'myremote' as a default remote.
ERROR: configuration error - config file error: expected 'url' for dictionary value @ data['remote']['myremote1']
(example1-ui6lFrCK-py3.9) me@me-Zephyrus-Ubuntu:~/MyStudy/2024/example1(SetupRemote)$ dvc push
ERROR: configuration error - config file error: expected 'url' for dictionary value @ data['remote']['myremote1']

Is there some way to recover the use of DVC in the repo. Thankfully this is a toy repo but if I have to erase everything and clone the repo again then the solution is not workable

This is the verbose version

dvc push -v
2024-03-05 19:29:11,847 DEBUG: v3.41.0 (pip), CPython 3.9.16 on Linux-5.15.0-94-generic-x86_64-with-glibc2.31
2024-03-05 19:29:11,847 DEBUG: command: /home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/bin/dvc push -v
2024-03-05 19:29:12,038 ERROR: configuration error - config file error: expected 'url' for dictionary value @ data['remote']['myremote1']
Traceback (most recent call last):
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/cli/__init__.py", line 210, in main
    cmd = args.func(args)
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/cli/command.py", line 21, in __init__
    self.repo: "Repo" = Repo(uninitialized=self.UNINITIALIZED)
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/repo/__init__.py", line 217, in __init__
    hardlink_lock=self.config["core"].get("hardlink_lock", False),
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/funcy/objects.py", line 25, in __get__
    res = instance.__dict__[self.fget.__name__] = self.fget(instance)
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/repo/__init__.py", line 249, in config
    return Config(
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/config.py", line 114, in __init__
    self.load(
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/config.py", line 190, in load
    conf = self.validate(conf)
  File "/home/me/.cache/pypoetry/virtualenvs/example1-ui6lFrCK-py3.9/lib/python3.9/site-packages/dvc/config.py", line 389, in validate
    raise ConfigError(str(exc)) from None
dvc.config.ConfigError: config file error: expected 'url' for dictionary value @ data['remote']['myremote1']

2024-03-05 19:29:12,051 DEBUG: Analytics is enabled.
2024-03-05 19:29:12,113 DEBUG: Trying to spawn ['daemon', 'analytics', '/tmp/tmpunwg3doo', '-v']
2024-03-05 19:29:12,118 DEBUG: Spawned ['daemon', 'analytics', '/tmp/tmpunwg3doo', '-v'] with pid 100864

By the way dvc doctor also fails.
(no output and exception in verbose)

Strangely I tried to do the same in a different repo, with the same instructions (but in which the previous errors have not happened) and it worked.

It seems that once the errors “configuration error” appears, then the rest of dvc command fail

Looks like you removed everything underneath the remote section. url is required to set a remote.

You can try following commands to remove the remote completely:

dvc config remote.myremote1 --unset

Or, do it manually.

dvc config remote.myremote --unset
ERROR: configuration error - config file error: expected 'url' for dictionary value @ data['remote']['myremote1']

What does ERROR: configuration error - config file error: expected ‘url’ for dictionary value @ data[‘remote’][‘myremote1’] mean and why it appear? and why it refuses to go?

I even now deleted the file and start with setting the remote again, still that error appear

Can you change the command to following (note the 1 at the end):

dvc config remote.myremote1 --unset

Does that work?

dvc config remote.myremote1 --unset
ERROR: configuration error - config file error: option 'myremote1' doesn't exist in section 'remote'

the strange thing is that everything is working well in my other repo with the exact same commands…

Is there a .dvc/config.local file? I see that you did --local on a few commands above.

In that case, either you’d have to remove that file or add a --local to the above command.

1 Like

THAT was the problem!!

Thank you very much!!!

It was a good lesson to learn!

1 Like