Skip to content

[Bug] Misleading error message when opening .yml file #2889

@ndormann

Description

@ndormann

🐛 Bug

Description

The error message doesn't reflect that Hydra only accepts .yml files. The error message states "Cannot find primary config 'config.yml'" which hints at a problem with an incorrect path setup or a missing file. However, the config file exists and the path is correct. Only the file ending is not supported.

Checklist

  • I checked on the latest version of Hydra
  • I created a minimal repro (See this for tips).

To reproduce

** Minimal Code/Config snippet to reproduce **
from hydra import initialize, compose

with initialize(version_base=None, config_path="cloud_app/conf"):
cfg = compose("config.yml",overrides=["+db=mysql"])
print(cfg)

** Stack trace/error message **

MissingConfigException: Cannot find primary config 'config.yml'. Check that it's in your config search path.

Config search path:
	provider=hydra, path=pkg://hydra.conf
	provider=main, path=file:///home/user/notebooks/cloud_app/conf
	provider=schema, path=structured://

Expected Behavior

Output appropriate Error Message:

  • WrongFileEndingException: Only .yaml files are expected as config files.

System information

  • Hydra Version : 1.3.2
  • Python version : 3.9.19
  • Virtual environment type and version : conda 4.12.0
  • Operating system : ubuntu

Related Issues and PRs

Previous discussions to support .yml or not (concluded not to support for now): #398 #1050
Add note in documentation: #1298

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions