1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

git push で remote: Repository not found. fatal: Authentication failed for ‘xxx’ と言われた

Last updated at Posted at 2022-09-01

GitHubにgit pushをしたらある日突然エラーになった。VSCode内のターミナルで実行した場合に出たエラーが以下。

$ git push
Missing or invalid credentials.
Error: connect ECONNREFUSED /run/user/1000/vscode-git-c4b2e1d8a0.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
  errno: -111,
  code: ‘ECONNREFUSED’,
  syscall: ‘connect’,
  address: ‘/run/user/1000/vscode-git-c4b2e1d8a0.sock’
}
Missing or invalid credentials.
Error: connect ECONNREFUSED /run/user/1000/vscode-git-c4b2e1d8a0.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
  errno: -111,
  code: ‘ECONNREFUSED’,
  syscall: ‘connect’,
  address: ‘/run/user/1000/vscode-git-c4b2e1d8a0.sock’
}
remote: Repository not found.
fatal: Authentication failed for ‘https://github.com/xxxx/xxxx.git/’

解決した方法

git push 等をするときにパスワードの代わりに入力するGitHubのPersonal access token(PAT)の期限が切れていた。デフォルトだと数ヶ月で切れるらしい。知らなかった。

以下のリンクの手順に従って新しいトークンを作成する。期限が切れたトークンをそのまま使うことはできないし、期限を延長することもできない。ただし新しいトークンを作成するときに期限を無期限にすることはできる模様。
https://docs.github.com/ja/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?