Skip to content

DVC status fails after using add -R #4150

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
moshe-rl opened this issue Jul 2, 2020 · 1 comment · Fixed by #4156
Closed

DVC status fails after using add -R #4150

moshe-rl opened this issue Jul 2, 2020 · 1 comment · Fixed by #4156
Assignees
Labels
bug Did we break something?

Comments

@moshe-rl
Copy link

moshe-rl commented Jul 2, 2020

Hey :)

I have a folder of files I added with
$$ dvc add -R raw_data

Then I've imported the folder in other git repo using
$$ dvc import -o data --rev raw-v1 https://[email protected]/.../raw_data_reg.git raw_data

Then when execute dvc status I get an error message

$$ dvc status -v

2020-06-29 13:54:52,056 DEBUG: fetched: [(3,)]                                  
2020-06-29 13:54:52,059 DEBUG: Creating external repo https://[email protected]/.../raw_data_reg.git@43fb50fb519d58415bba4903b480f44811fefec1
2020-06-29 13:54:52,059 DEBUG: erepo: git clone https://[email protected]/.../raw_data_reg.git to a temporary dir
Cloning                                                                     |0.00 [00:00,      ?obj/s]Password for 'https://[email protected]':
2020-06-29 13:54:58,709 DEBUG: fetched: [(17,)]                                                      
2020-06-29 13:54:58,728 ERROR: failed to obtain data status - get_hash() takes 2 positional arguments but 3 were given
------------------------------------------------------------
Traceback (most recent call last):
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/dependency/repo.py", line 57, in _get_checksum
    return repo.find_out_by_relpath(self.def_path).info["md5"]
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/repo/__init__.py", line 566, in find_out_by_relpath
    (out,) = self.find_outs_by_path(path)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/repo/__init__.py", line 560, in find_outs_by_path
    raise OutputNotFoundError(path, self)
dvc.exceptions.OutputNotFoundError: Unable to find DVC-file with output '../../../tmp/tmpq5w4msxhdvc-clone/raw_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/command/status.py", line 51, in run
    recursive=self.args.recursive,
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/repo/__init__.py", line 35, in wrapper
    ret = f(repo, *args, **kwargs)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/repo/status.py", line 146, in status
    self, targets, with_deps=with_deps, recursive=recursive
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/repo/status.py", line 37, in _local_status
    return _joint_status(stages)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/repo/status.py", line 23, in _joint_status
    status.update(stage.status(check_updates=True))
  File "/home/moshe/.local/lib/python3.6/site-packages/funcy/decorators.py", line 39, in wrapper
    return deco(call, *dargs, **dkwargs)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/stage/decorators.py", line 35, in rwlocked
    return call()
  File "/home/moshe/.local/lib/python3.6/site-packages/funcy/decorators.py", line 60, in __call__
    return self._func(*self._args, **self._kwargs)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/stage/__init__.py", line 469, in status
    self._status_deps(ret)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/stage/__init__.py", line 485, in _status_deps
    deps_status = self._status(self.deps)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/stage/__init__.py", line 480, in _status
    ret.update(entry.status())
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/dependency/repo.py", line 71, in status
    current_checksum = self._get_checksum(locked=True)
  File "/home/moshe/.local/lib/python3.6/site-packages/dvc/dependency/repo.py", line 67, in _get_checksum
    return self.repo.cache.local.get_hash(path, tree)
TypeError: get_hash() takes 2 positional arguments but 3 were given
------------------------------------------------------------

$$ dvc version
DVC version: 1.0.1
Python version: 3.6.9
Platform: Linux-5.3.0-61-generic-x86_64-with-Ubuntu-18.04-bionic
Binary: False
Package: pip
Supported remotes: azure, gdrive, gs, hdfs, http, https, s3, ssh, oss
Cache: reflink - not supported, hardlink - supported, symlink - supported
Filesystem type (cache directory): ('ext4', '/dev/sda1')
Repo: dvc, git
Filesystem type (workspace): ('ext4', '/dev/sda1')

Do you know what could be the problem?
Thanks.

@ghost ghost added the triage Needs to be triaged label Jul 2, 2020
@pmrowla pmrowla added bug Did we break something? p0-critical labels Jul 2, 2020
@ghost ghost removed the triage Needs to be triaged label Jul 2, 2020
@pmrowla
Copy link
Contributor

pmrowla commented Jul 2, 2020

Looks like

return self.repo.cache.local.get_hash(path, tree)

should be
get_hash(path, tree=tree)

We should make sure to add test coverage for this case w/the bugfix

@efiop efiop self-assigned this Jul 2, 2020
@efiop efiop mentioned this issue Jul 2, 2020
3 tasks
efiop added a commit to efiop/dvc that referenced this issue Jul 2, 2020
efiop added a commit that referenced this issue Jul 3, 2020
* [RFC] tests: make read_text() work with directories

This PR is just a showcase to see how we like it. I've converted a few
tests to it, but there will be much more to come.

```
assert (tmp_dir / "file") == "contents"
assert (tmp_dir / "dir").read_text() == {"subdir": {"file": "hello"}}
```

This approach is nicer because it allows us to use a declaratory
asserts instead of relying on fs files. The problem becomes much more
apparent once you get into remote workspaces, where we `trees_equal`
doesn't work.

* status: pass tree as a kwarg

Fixes #4150

Depends on #4155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants