Skip to content

[Bug]: dstack init doesn't work if .git/config doesn't have the user section #616

@peterschmidt85

Description

@peterschmidt85

dstack version

0.10.7rc1

Python version

No response

Host OS

Any

Host Arch

Any

What happened?

Traceback (most recent call last):
  File "/home/runner/.local/bin/dstack", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.local/lib/python3.10/site-packages/dstack/_internal/cli/main.py", line 50, in main
    check_cli_errors(args.func)(args)
  File "/home/runner/.local/lib/python3.10/site-packages/dstack/_internal/cli/utils/common.py", line 146, in decorator
    func(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/dstack/_internal/cli/utils/common.py", line 146, in decorator
    func(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/dstack/_internal/cli/commands/__init__.py", line 44, in __command
    self._command(args)
  File "/home/runner/.local/lib/python3.10/site-packages/dstack/_internal/cli/commands/init/__init__.py", line 56, in _command
    repo = RemoteRepo(local_repo_dir=Path.cwd())
  File "/home/runner/.local/lib/python3.10/site-packages/dstack/_internal/core/repo/remote.py", line 122, in __init__
    repo_data.repo_config_name = repo.config_reader().get_value("user", "name")
  File "/home/runner/.local/lib/python3.10/site-packages/git/config.py", line 772, in get_value
    valuestr = self.get(section, option)
  File "/home/runner/.local/lib/python3.10/site-packages/git/config.py", line 122, in assure_data_present
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.10/configparser.py", line 782, in get
    d = self._unify_values(section, vars)
  File "/usr/lib/python3.10/configparser.py", line 1153, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'user'
Error: Process completed with exit code 1.

Relevant log output

No response

Additional Information

No response

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