dvc diff ERROR: unexpected error - 'NoneType' object has no attribute 'endswith'

Created on 3 Mar 2020  路  4Comments  路  Source: iterative/dvc

If given rev is not tracked fails. I.E 2f05868ebe3693a7e7afbdd8923c15ce327b179d does not have metrics:

dvc diff  --show-json 2f05868ebe3693a7e7afbdd8923c15ce327b179d 19b33235917f6b3732de8486b35235ba200e74a2
ERROR: unexpected error - 'NoneType' object has no attribute 'endswith' 

I would expect at least the difference of files added

Please provide information about your setup
dvc 0.87.0
Python 3.6.9
ubuntu 10.04

bug p0-critical

Most helpful comment

@courentin Nice catch! Sending a PR for it right now. https://github.com/iterative/dvc/pull/3836

All 4 comments

Not able to reproduce. Not with dvc diff nor with dvc metrics diff, nor with current version nor with 0.87.0. Closing for now. @DavidGOrtega Please let us know if you are still experiencing this issue. And please provide verbose logs (by adding -v to the command) next time, so it is easier to see the issue in details. Thank you!

Hello,

I have the same error on 1.0.0a2 when I do either dvc diff, dvc metrics diff or dvc metrics show. Here is the verbos log:

2020-05-20 15:16:59,145 ERROR: unexpected error - 'NoneType' object has no attribute 'endswith'
------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/main.py", line 48, in main
    ret = cmd.run()
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/command/metrics.py", line 45, in run
    recursive=self.args.recursive,
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/repo/metrics/__init__.py", line 13, in show
    return show(self.repo, *args, **kwargs)
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/repo/__init__.py", line 25, in wrapper
    ret = f(repo, *args, **kwargs)
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/repo/metrics/show.py", line 99, in show
    vals = _read_metrics(repo, metrics, rev)
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/repo/metrics/show.py", line 63, in _read_metrics
    with tree.open(metric, "r") as fobj:
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/repo/tree.py", line 192, in open
    path, mode=mode, encoding=encoding, **kwargs
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/repo/tree.py", line 49, in open
    if len(outs) != 1 or outs[0].is_dir_checksum:
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/output/base.py", line 170, in is_dir_checksum
    return self.remote.is_dir_checksum(self.checksum)
  File "/Users/corentinhembise/.local/share/virtualenvs/speech-XlnoNrSS/lib/python3.6/site-packages/dvc/remote/base.py", line 322, in is_dir_checksum
    return checksum.endswith(cls.CHECKSUM_DIR_SUFFIX)
AttributeError: 'NoneType' object has no attribute 'endswith'
------------------------------------------------------------

Please let me know how can I help on that.

Here is my dvc version:

DVC version: 1.0.0a2
Python version: 3.6.8
Platform: Darwin-19.3.0-x86_64-i386-64bit
Binary: False
Package: pip
Supported remotes: http, https, s3
Cache: reflink - supported, hardlink - supported, symlink - supported
Filesystem type (cache directory): ('apfs', '/dev/disk1s2')
Repo: dvc, git
Filesystem type (workspace): ('apfs', '/dev/disk1s2')

@courentin Nice catch! Sending a PR for it right now. https://github.com/iterative/dvc/pull/3836

@courentin Will be out in 1.0.0a3 in a few minutes. Thanks again for the feedback! :pray:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Casyfill picture Casyfill  路  56Comments

JoeyCarson picture JoeyCarson  路  53Comments

jorgeorpinel picture jorgeorpinel  路  45Comments

ynop picture ynop  路  41Comments

dmpetrov picture dmpetrov  路  35Comments