→ dvc status -c
WARNING: using obsoleted config format. Consider updating.
ERROR: failed to obtain data status - 'NoneType' object has no attribute 'path_info'
Having any troubles?. Hit us up at https://dvc.org/support, we are always happy to help!
Config contains just a single ssh remote section with an URL. There is no core section options defined in my config.
It couldn't find the remote option in missing [core] and -r remotename option was not specified.
→ dvc status -c
ERROR: you should specify default remote in [core] config section or pass its name via `-r` argument
DVC version: 0.50.1+cc9411
Python version: 3.7.3
Platform: Linux-5.1.3-arch1-1-ARCH-x86_64-with-arch-Arch-Linux
Binary: False
Cache: reflink - False, hardlink - True, symlink - True
Filesystem type (cache directory): ('ext4', '/dev/nvme0n1p5')
Filesystem type (workspace): ('ext4', '/dev/nvme0n1p5')
I use dvc from master.
@ei-grad Could you post a stacktrace, please?
Another user is experiencing this. Now with a stacktrace https://discordapp.com/channels/485586884165107732/485596304961962003/600681395878101011
→ dvc status -c
> /home/ei-grad/repos/github.com/iterative/dvc/dvc/config.py(449)load()
448
--> 449 try:
450 d = Schema(self.SCHEMA).validate(d)
ipdb> pp d['core']
{'analytics': 'false'}
ipdb> n
> /home/ei-grad/repos/github.com/iterative/dvc/dvc/config.py(450)load()
449 try:
--> 450 d = Schema(self.SCHEMA).validate(d)
451 except SchemaError as exc:
ipdb>
> /home/ei-grad/repos/github.com/iterative/dvc/dvc/config.py(453)load()
452 raise ConfigError("config format error", cause=exc)
--> 453 self.config = configobj.ConfigObj(d, write_empty_values=True)
454
ipdb> pp d['core']
{'analytics': False,
'checksum_jobs': None,
'cloud': '',
'interactive': False,
'remote': '',
'storagepath': ''}
Oops. To reproduce there should be the [core] section somewhere in configs, possibly just empty.
I was mangling around to find the conditions to reproduce the issue and eventually added an empty [core] section in the repo's .dvc/config, and forgot about it (thought that ~/.config/dvc/config is the only file with the [core] section in my env).
Reproduction:
#!/bin/bash
rm -rf repo storage
mkdir repo storage
cd repo
git init >> /dev/null && dvc init >> /dev/null
dvc remote add server ssh://[email protected]:/cache
dvc config core.cloud ''
dvc status -c
Though, after analysing config send by user from discord discussion, it seems that there might be some other issue, as he did not have any core config specified, which was required to trigger the bug in @ei-grad case.
@pared in my case there is no core.cloud specified in the config file. Just an empty [core] section is enough to reproduce. Or core.analytics as it was in debug session some comments before.
But anyway I like the solution with dropping the legacy checks :-). So never mind.
@ei-grad thanks, Ill Ill check with empty core too. Maybe there are more than one problems here.
Ok, @ei-grad I checked it, and, yes, even empty core was enough, because _init_compat in data cloud was defaulting cloud section to '' in here. Anyhow, removing support for old configuration should solve this problem, because instead of returning None, get_remote will raise proper ConfigError.
This is solving the issue for me:
diff --git a/dvc/config.py b/dvc/config.py
index b0d280b8..787e8998 100644
--- a/dvc/config.py
+++ b/dvc/config.py
@@ -205,7 +205,7 @@ class Config(object):Â # pylint: disable=too-many-instance-attributes
            SECTION_CORE_CHECKSUM_JOBS, default=None
        ): SECTION_CORE_CHECKSUM_JOBS_SCHEMA,
        # backward compatibility
-Â Â Â Â Â Â Â Optional(SECTION_CORE_CLOUD, default=""): SECTION_CORE_CLOUD_SCHEMA,
+Â Â Â Â Â Â Â Optional(SECTION_CORE_CLOUD): SECTION_CORE_CLOUD_SCHEMA,
        Optional(SECTION_CORE_STORAGEPATH, default=""): str,
    }