首页 > 解决方案 > 警告:无效的凭证行——该行来自哪里?

问题描述

我在 Windows 10 上使用“Git Bash here”窗口。我经常(但不总是)使用 git 命令得到这个:

$ git pull
warning: invalid credential line: Unable to initialize the New Relic .NET Agent log file.  Please make sure the logs directory is writeable.
# after that warning, a standard git-gui--askpass window pops up to ask me for credentials.

我已经查看了这个这个,也许还有其他一些问题。他们没有帮助。

我已从 Windows 凭据管理器中删除了所有与 git 相关的凭据。

我已经确定 New Relic .NET 代理不再安装在我的机器上(如果曾经安装过的话)。 我错了……看我的回答

我最好的猜测是某处的某个文件中包含此文本

Unable to initialize the New Relic .NET Agent log file.  Please make sure the logs directory is writeable.

那个 git 正在读取那个文件。我怎样才能弄清楚它是什么文件?

关于我的机器的更多信息,略有编辑:

$ git --version
git version 2.27.0.windows.1

$ git config -l 
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=schannel
core.autocrlf=false
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager
user.name=rpresser
user.email=rpresser@****.com
gui.recentrepo=C:/Users/rpresser/source/repos/*****
gui.recentrepo=C:/Users/rpresser/source/repos/*****

$ cat ~/.gitconfig
[user]
        name = rpresser
        email = rpresser@****.com
[gui]
        recentrepo = C:/Users/rpresser/source/repos/*****
        recentrepo = C:/Users/rpresser/source/repos/*****

标签: gitgit-credential-winstore

解决方案


我已经确定 New Relic .NET 代理不再安装在我的机器上(如果曾经安装过的话)。

好吧,我错了。我的机器上仍然部分安装了新的 Relic .NET 代理,删除它确实解决了问题

该消息的发生是因为 git-credential-manager.exe 显然调用了一个 .NET 程序集来访问已保存的 Windows 凭据。(我通过查看 ProcMon 结果发现了这一点。)NewRelic 分析器被配置为在每次 .NET 启动时启动并决定是否附加分析器。它遇到了那个错误——拒绝访问日志目录——因为该目录只允许 IIS 应用程序池访问;几个月前,我一直在我的机器上使用 NR 代理来调试我们如何在服务器上使用它。


推荐阅读