Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid config file ~/.config/gh/hosts.yml: invalid format #5949

Closed
hpsaturn opened this issue Jul 15, 2022 · 8 comments · Fixed by cli/go-gh#55
Closed

invalid config file ~/.config/gh/hosts.yml: invalid format #5949

hpsaturn opened this issue Jul 15, 2022 · 8 comments · Fixed by cli/go-gh#55
Assignees
Labels
bug Something isn't working

Comments

@hpsaturn
Copy link

hpsaturn commented Jul 15, 2022

Describe the bug

Today I try to create a new issue and I have this error.

Steps to reproduce the behavior

  1. With any parameter, for example gh --version

Also I reinstalled the CLI using debian package alternartive.

Output

gh issue create
failed to read configuration:  invalid config file ~/.config/gh/hosts.yml: invalid format

the file mentioned in the error is empty. I never used or touch it.

Environment:

dpkg -l | grep GitHub
ii  gh    2.14.2  amd64        GitHub’s official command line tool.

lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
@hpsaturn hpsaturn added the bug Something isn't working label Jul 15, 2022
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Jul 15, 2022
@troldmand
Copy link

This happened to me too, a few weeks ago. Still an issue for me and I'm currently investigating.

@eshack94
Copy link

eshack94 commented Jul 17, 2022

This just happened after updating to the latest version of the gh cli tool.

eshackelford@MacBook-Pro git $ brew info gh
gh: stable 2.14.2 (bottled), HEAD
GitHub command-line tool
https://github.com/cli/cli
/usr/local/Cellar/gh/2.14.2 (138 files, 34.4MB) *
  Poured from bottle on 2022-07-16 at 18:32:07
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gh.rb
License: MIT

@eshack94
Copy link

eshack94 commented Jul 17, 2022

Additional information and how I fixed the issue on my machine:

  • Inspected ~/.config/gh/config.yml file, noticed that its contents were empty.
  • Deleted the file.
  • gh cli working as expected.

I'm wondering if maybe the latest version of the gh cli tool auto-creates an empty config.yml file?

cc @troldmand & @hpsaturn , can you see if this also resolves your issue?

Obviously this doesn't fix root cause, but may be a workaround for folks in the meantime.

@hpsaturn
Copy link
Author

hpsaturn commented Jul 17, 2022

mmm, maybe you want say: remove the ~/.config/gh/hosts.yml file. Yes, this resolve the issue. Thanks.

@MatthewDolan
Copy link

@hpsaturn, I think it makes sense to keep this issue open.

Although there is a work-around to resolve the issue when it happens (delete the file), I would guess that there is a bug in the cli which is causing this to happen. It's happened on multiple different machines independently.

@mislav
Copy link
Contributor

mislav commented Jul 18, 2022

I will reopen to investigate what could have made the file empty in the first place.

Does anyone affected by this have XDG_CONFIG_HOME environment variable set or remembers what version did they upgrade gh from?

@mislav mislav added needs-user-input and removed needs-triage needs to be reviewed labels Jul 18, 2022
@tnorthcutt
Copy link

@mislav I do not have XDG_CONFIG_HOME set (or don't think so... I ran echo $XDG_CONFIG_HOME and got no output).

I upgraded from 2.13.0 to 2.14.2 yesterday and ran into this error today (using gh for the first time since upgrading yesterday).

@hpsaturn hpsaturn reopened this Jul 24, 2022
@atymic
Copy link

atymic commented Jul 25, 2022

Also had this issue, deleting file fixed. Homebrew on mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants