iterative / dvc

🦉 Data Versioning and ML Experiments
https://dvc.org
Apache License 2.0
13.87k stars 1.19k forks source link

exp run: Parameter name does not support backslashes #6819

Open DavidGOrtega opened 3 years ago

DavidGOrtega commented 3 years ago

Bug Report

Description

In GH CI is useful to reuse the ENV var GITHUB_REPOSITORY if not the workflow is even uglier in bash. A plausible solution would be to use a hash function internally to generate an "ID" from the name or throw an error with illegal chars. If that would be accepted I can prepare a PR 🚀

Reproduce

In any experiment try to setup a name with backslashes

dvc exp run --name wont/work

Expected

To work or at least a log related to wrong naming.

Environment information

DVC version: 2.7.4 (deb)
---------------------------------
Platform: Python 3.8.11 on Linux-5.8.0-1042-azure-x86_64-with-glibc2.14
Supports:
    azure (adlfs = 2021.9.1, knack = 0.8.2, azure-identity = 1.6.1),
    gdrive (pydrive2 = 1.9.4),
    gs (gcsfs = 2021.8.1),
    hdfs (pyarrow = 5.0.0),
    webhdfs (hdfs = 2.6.0),
    http (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
    https (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
    s3 (s3fs = 2021.8.1, boto3 = 1.17.106),
    ssh (sshfs = 2021.8.1),
    oss (ossfs = 2021.8.0),
    webdav (webdav4 = 0.9.2),
    webdavs (webdav4 = 0.9.2)
Cache types: <https://error.dvc.org/no-dvc-cache>
Caches: local
Remotes: s3
Workspace directory: ext4 on /dev/root
Repo: dvc, git

Output logs:

2021-10-18 08:57:34,587 ERROR: Failed to reproduce experiment '42a05ee': expected str, bytes or os.PathLike object, not NoneType
------------------------------------------------------------
Traceback (most recent call last):
  File "dvc/repo/experiments/__init__.py", line 807, in _workspace_repro
  File "dvc/scm/git/__init__.py", line 343, in _backend_func
  File "dvc/scm/git/backend/dulwich.py", line 309, in set_ref
  File "os.py", line 806, in fsencode
TypeError: expected str, bytes or os.PathLike object, not NoneType

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "dvc/main.py", line 55, in main
  File "dvc/command/base.py", line 45, in do_run
  File "dvc/command/experiments.py", line 615, in run
  File "dvc/repo/experiments/__init__.py", line 957, in run
  File "dvc/repo/__init__.py", line 50, in wrapper
  File "dvc/repo/experiments/run.py", line 32, in run
  File "dvc/repo/experiments/__init__.py", line 421, in reproduce_one
  File "dvc/repo/experiments/__init__.py", line 57, in wrapper
  File "dvc/repo/experiments/__init__.py", line 815, in _workspace_repro
dvc.exceptions.DvcException: Failed to reproduce experiment '42a05ee'
pmrowla commented 3 years ago

Same as https://github.com/iterative/dvc/issues/6652 & https://github.com/iterative/dvc/issues/6674 (we need validate and then error out on invalid exp names)

pmrowla commented 3 years ago

@dberenbaum we probably need to add the linked issues to the next sprint since it's affecting CML now

efiop commented 3 years ago

For the record: Added to the https://github.com/orgs/iterative/projects/189

pmrowla commented 3 years ago

Also, for CML team reference, exp names have to be valid git branch names (so they can't contain slashes).

karajan1001 commented 3 years ago

reopen for #6848