因为我很确定Pkg并没有进行任何更改,所以在这里打开此问题,也许这与libgit2升级(#32806)有关?
$ julia13 -e 'using Pkg; Pkg.Registry.update()'
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /home/fredrik/.julia/registries/General — failed to fetch from repo
└ @ Pkg.Types ~/julia13/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1189
$ julia12 -e 'using Pkg; Pkg.Registry.update()'
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
在Mac上为我工作。
好的,我在Linux上。 恢复#32806为我解决了此问题。
没有任何Pkg代码的复制器:
julia> import LibGit2
julia> repo = LibGit2.GitRepo("/home/fredrik/.julia/registries/General");
julia> remoteurl = "https://github.com/JuliaRegistries/General.git";
julia> LibGit2.fetch(repo; remoteurl=remoteurl)
ERROR: GitError(Code:ERROR, Class:Net, unrecognized URL prefix)
Stacktrace:
[1] #fetch#62(::LibGit2.FetchOptions, ::String, ::typeof(LibGit2.fetch), ::LibGit2.GitRemote, ::Array{AbstractString,1}) at /home/fredrik/julia-master/usr/share/julia/stdlib/v1.4/LibGit2/src/error.jl:101
[2] #fetch at /home/fredrik/julia-master/usr/share/julia/stdlib/v1.4/LibGit2/src/remote.jl:297 [inlined]
[3] #fetch#115(::String, ::String, ::Array{AbstractString,1}, ::Nothing, ::Dict{Symbol,Tuple{Ptr{Nothing},Any}}, ::typeof(LibGit2.fetch), ::LibGit2.GitRepo) at /home/fredrik/julia-master/usr/share/julia/stdlib/v1.4/LibGit2/src/LibGit2.jl:290
[4] (::LibGit2.var"#kw##fetch")(::NamedTuple{(:remoteurl,),Tuple{String}}, ::typeof(LibGit2.fetch), ::LibGit2.GitRepo) at /home/fredrik/julia-master/usr/share/julia/stdlib/v1.4/LibGit2/src/LibGit2.jl:272
[5] top-level scope at REPL[4]:1
可能不相关:我今天在macOS的Julia 1.0.4上看到了相同的错误。 我通过在终端中的注册表并运行git fetch
来修复它。 之后,Pkg更新停止产生警告。
可能不相关:我今天在macOS的Julia 1.0.4上看到了相同的错误。 我通过在终端中的注册表并运行git fetch修复了它。 之后,Pkg更新停止产生警告。
那并没有为我解决。 另外,我尝试使用其他机器,但无法复制。 关于如何调试的任何想法?
从头开始克隆也将失败,并带有与unrecognized URL prefix
相同的错误消息。
通用二进制文件btw也会发生这种情况。
调试此错误的未来可能方法是将其减少为仅ccall,然后查看生成错误的libgit2。
import LibGit2
const repo_url = "https://github.com/JuliaRegistries/General.git"
const repo_path = "/tmp/General"
const credentials = nothing
const callbacks = LibGit2.Callbacks()
const cred_payload = LibGit2.reset!(LibGit2.CredentialPayload(credentials))
callbacks[:credentials] = (LibGit2.credentials_cb(), cred_payload)
const lbranch = Base.cconvert(Cstring, "")
const remote_callbacks = LibGit2.RemoteCallbacks(callbacks)
const fetch_opts = LibGit2.FetchOptions(callbacks=remote_callbacks)
const clone_opts = LibGit2.CloneOptions(
bare = Cint(false),
checkout_branch = Cstring(C_NULL),
fetch_opts = fetch_opts,
remote_cb = C_NULL
)
LibGit2.ensure_initialized()
const clone_opts_ref = Ref(clone_opts)
const repo_ptr_ptr = Ref{Ptr{Cvoid}}(C_NULL)
ccall((:git_clone, :libgit2), Cint,
(Ptr{Ptr{Cvoid}}, Cstring, Cstring, Ref{LibGit2.CloneOptions}),
repo_ptr_ptr, repo_url, repo_path, clone_opts_ref)
返回-1
。
FWIW的两个示例都在最新的master上工作。 别人还能繁殖吗?
@fredrikekre您可以发布您的git配置吗?
有趣的是,我将.gitconfig
文件减少为
[http]
proxy =
我不确定为什么要添加它,我不认为我自己添加了它。 似乎[email protected]为此失败,而[email protected]处理它(常规git也是如此)
可能与libgit2 0.28发行说明中的这一点有关:
HTTP代理支持现已内置; libcurl不再用于支持
代理,并作为依赖项被删除。
也许对libgit2提出问题? 您还可以尝试在https://github.com/JuliaLang/julia/pull/32806中还原我对gitcredential.jl所做的更改,以防万一(某些特定测试需要它们,但大多数操作不需要)。
从里程碑中删除,因为有一个空的http.proxy
很奇怪,我们可以在1.3.1或任何版本中升级libgit2。
我可以重现类似的内容,但是您上面发送的代码段返回-12
。 它确实似乎是在最近的提交中引入的-julia 1.2.0运行良好,但1.3.0-rc1和master /最新夜间版本(47f2800747)失败。
在我将http(s)_proxy
设置为环境变量的情况下,也出现了此问题。 为了避免它,需要取消设置(不设置为空字符串)。
感谢您的建议@tkluck-不幸的是,-12
返回代码:(
我刚才遇到了这个问题,我想用Release-1.0,release-1.3和master分支中的三个新构建的Julia二进制文件报告测试结果。 (由于生成错误,我无法测试release-1.2。)所有三个测试都是在空的~/.julia
。 环境变量http_proxy
和https_proxy
在~/.bashrc
中定义。
版本1.0(无错误):
julia> VERSION
v"1.0.6-pre.0"
(v1.0) pkg> update
Resolving package versions...
Cloning default registries into /Users/MY_USER_ID/.julia/registries
Cloning registry General from "https://github.com/JuliaRegistries/General.git"
Fetching: [========================================>] 99.9 %
版本1.3(错误):
julia> VERSION
v"1.3.0-rc3.0"
(v1.3) pkg> update
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: Git repository not found at 'https://github.com/JuliaRegistries/General.git'
主人(错误):
julia> VERSION
v"1.4.0-DEV.298"
(v1.4) pkg> update
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: Git repository not found at 'https://github.com/JuliaRegistries/General.git'
希望这个问题能尽快解决!
您的http_proxy
缺少斜线? 参见https://github.com/libgit2/libgit2/issues/5255
@kcajf ,您的解决方案有效! 非常感谢!!!
对于其他用户,这里的解决方案是将/
放在代理端口号的末尾。 例如,在~/.bashrc
,使用
export http_proxy=http://your.proxy.address:8080/
代替
export http_proxy=http://your.proxy.address:8080
叹。 libgit2
令人讨厌,要注意是否有斜线结尾。
是的我无法想象将其固定在上游很困难,但问题是它是否可以在1.3.0的合理时间内完成。 我希望这会给许多公司的Julia用户带来麻烦,因为我猜rhat no-trailing-slash是更常见的格式。
我们可以通过查找环境变量并检测缺少尾部斜杠并进行修复来最终解决该问题。 弄乱了甚至不是Julia特定的用户环境变量,这有点奇怪。 即使省了一些麻烦,这还是有点危险的。
也可以从〜/ .gitconfig和其他一些地方获取它,因此没有整体解决方案
libgit2开发人员尚未对此发表评论,也许这只是个疏忽。 如果没有,我们可以说服他们改变这一点。
从那以后,他们就发表了评论,并且似乎它将在下一个libgit2版本中得到修复。
从1.3升级到1.3,我得到
(v1.3) pkg> up
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /home/levitta/.julia/registries/General — failed to fetch from repo
└ @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:1199
Resolving package versions...
在rm -rf .julia
,我得到
(v1.3) pkg> up
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: Git repository not found at 'https://github.com/JuliaRegistries/General.git'
我在大学代理后面,我的http_proxy,https_proxy及其大写版本都正确设置(带有斜杠)。
编辑:我应该提到在1.1和1.2中有效
edit2:哦,上面的脚本返回-12。
请参阅此处的代码以了解如何提取实际错误消息: https :
代理网址可以来自env var,也可以来自其他地方,例如~/.gitconfig
。 也许将它们放置在其他地方? 如果我们能使libgit2打印出它正在检测的最终代理URL,那就太好了。
我担心这个问题会给企业和大学用户带来很多麻烦。.希望libgit2尽快发布一个更新,该更新可以包含在较小的julia版本中。
噢,非常好的收获,它的确是在.gitconfig
,它优先于env变量。 这样就可以了!
末尾的斜线是解决方法,但是真正愚蠢的人.....
同意。 这是一个libgit2错误,而不是Julia错误。 应该在较新的libgit2中修复。
在Julia 1.3.1中仍然是一个问题
@staticfloat :我们没有升级libgit2吗?
上次我们重建libgit2(例如,使用新的BB碎片重建)是https://github.com/JuliaLang/julia/commit/e44652ab03ce384444bddfaca270c04b42d968a8
上一次我们升级libgit2版本是https://github.com/JuliaLang/julia/commit/d0b5d9850fb7b51c7831d3897ad46e4d3478d322
如果我们需要包含修复程序的特定版本,请告诉我,我将构建新版本。
0.28.4有很多安全修复程序,因此应该升级吗?
0.24.4似乎不包含https://github.com/libgit2/libgit2/commit/c6ab183e9c960b74471a7d106a4deb0c8b28a8ec,尽管该问题可以解决此问题(https://github.com/libgit2/libgit2/issues/5255#issuecomment-541589326 )。
所以我想问题是我们是要修补libgit2还是只是等到他们发布包含此修复程序的发行版。
我没有代理,但遇到了这个问题,我通过将libgit2从0.99.0
降级为0.27.8
我没有代理,但遇到了这个问题,我通过将libgit2从
0.99.0
降级为0.27.8
可以确认。 我也遇到了这个问题,没有设置任何代理(至少没有在我的.gitconfig
)。 我以完全相同的方式进行了修复-通过将libgit2从0.99.0
降级为0.27.8
。
我没有代理,但遇到了这个问题,我通过将libgit2从
0.99.0
降级为0.27.8
可以确认。 我也遇到了这个问题,没有设置任何代理(至少没有在我的
.gitconfig
)。 我以完全相同的方式进行了修复-通过将libgit2从0.99.0
降级为0.27.8
。
我在Arch Linux上也有这个-libgit2是1:0.99.0-2
不能将libgit2降级。 我或者需要在.gitconfig中放入一些东西,使它消失而不破坏其他任何东西,或者在Julia中进行修复。
$ julia --version
julia version 1.3.1
...
julia> using Pkg
julia> Pkg.add("IJulia")
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
Stacktrace:
[1] top-level scope at REPL[2]:1
caused by [exception 1]
GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
Stacktrace:
[1] top-level scope at REPL[2]:1
您可以将即将发布的Julia 1.4与JULIA_PKG_SERVER=pkg.julialang.org
,它根本不会使用libgit2来安装注册的软件包。
我同意这个错误。 我正在使用manjaro .. libgit2已升级到0.99,我的julia环境(1.3.1)现已损坏....我已将julia安装到新计算机上。 它也被破坏了。 我注意到该错误仅影响从github更新注册表。 但是如果将registery手动克隆到〜/ .julia / registries / General下,仍然可以安装软件包。我想更新也可以手动进行。
什么时候会发生?
您可以将即将发布的Julia 1.4与
JULIA_PKG_SERVER=pkg.julialang.org
,它根本不会使用libgit2来安装注册的软件包。
如果使用候选发布版本或JuliaPro 1.3,则可以立即进行操作。
我在freebsd上将libgit2升级到0.99,并遇到了同样的问题。 pkg的解决方法是手动更新~/.julia/registries/General
。
请改为向libgit2存储库报告(除非它是https://github.com/libgit2/libgit2/issues/5220的重复,您可以在其中解决该问题。)
评论中报告的LibGit2 0.99.0的问题与原始错误报告无关,请参阅问题#35043和PR#35232以获取建议的修复程序。
您可以将即将发布的Julia 1.4与
JULIA_PKG_SERVER=pkg.julialang.org
,它根本不会使用libgit2来安装注册的软件包。
不幸的是,该解决方法无法正常工作,我使用的是julia 1.4。
@getzze您如何调用export
JULIA_PKG_SERVER
环境变量在您的shell中?
解决方法适用于使用_Julia_ 1.4.0的_Arch Linux_:
[tamer<strong i="10">@zinc</strong> ~]$ pacman -Q libgit2 julia
libgit2 1:0.99.0-2
julia 2:1.4.0-1
[tamer<strong i="11">@zinc</strong> ~]$ rm -r ~/.julia/registries/General/
[tamer<strong i="14">@zinc</strong> ~]$ julia -e 'using Pkg; Pkg.update()'
Cloning default registries into `~/.julia`
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
Stacktrace:
[1] up(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:206
[2] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:201 [inlined]
[3] #up#47 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[4] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[5] #up#44 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193 [inlined]
[6] up() at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193
[7] top-level scope at none:1
caused by [exception 1]
GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
Stacktrace:
[1] up(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:206
[2] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:201 [inlined]
[3] #up#47 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[4] up at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:196 [inlined]
[5] #up#44 at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193 [inlined]
[6] up() at /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:193
[7] top-level scope at none:1
[tamer<strong i="17">@zinc</strong> ~]$ JULIA_PKG_SERVER=pkg.julialang.org julia -e 'using Pkg; Pkg.update()'
Cloning default registries into `~/.julia`
######################################################################## 100.0%
Added registry `General` to `~/.julia/registries/General`
Updating registry at `~/.julia/registries/General`
Updating `~/.julia/environments/v1.4/Project.toml`
[no changes]
Updating `~/.julia/environments/v1.4/Manifest.toml`
[no changes]
如果您已经将注册表作为git克隆,它将继续将其用作git克隆而不是使用Pkg服务器,这就是为什么您必须删除它。
谢谢,我没有得到您必须删除注册表的信息。
但是,我使用的是某些软件包的开发版本,因此我需要从git中获取,而无法获取一个软件包会使所有更新失败。
运行Julia 1.4.0。 不使用任何代理。 Windows 10 Pkg.add
可以在Linux Manjaro上使用相同的软件包,但会抛出上述错误:(
@tuhtah解决方案虽然有效
嗨,我在使用manjaro Linux。 就我而言,这有助于
mkdir -p /home/terabyte/.julia/registries/General && git clone https://github.com/JuliaRegistries/General.git ~/.julia/registries/General
然后在朱莉娅
julia> using Pkg
julia> Pkg.add("IJulia")
无需删除任何文件夹。 用...
X<strong i="6">@alienware</strong>: ~/ pacman -Q libgit2 julia
libgit2 1:1.0.0-1
julia 2:1.4.0-1
我懂了
X<strong i="10">@alienware</strong>: ~/ julia -e 'using Pkg; Pkg.update()'
Updating registry at '/usr/applications/academia/julia/registries/General'
Updating git-repo 'https://github.com/JuliaRegistries/General.git'
┌ Warning: Some registries failed to update:
│ — /usr/applications/academia/julia/registries/General — failed to fetch from repo
└ @ Pkg.Types /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/Types.jl:1122
Updating '/usr/applications/academia/julia/environments/v1.4/Project.toml'
[no changes]
Updating '/usr/applications/academia/julia/environments/v1.4/Manifest.toml'
[no changes]
我最初应用@gwatcha解决方法,但是使用
X<strong i="15">@alienware</strong>: General/ pwd
/usr/applications/academia/julia/registries/General
-- -- (master origin)
X<strong i="16">@alienware</strong>: General/ git pull
做同样的工作。 当我回到julia并尝试升级软件包时,他们确实进行了升级:
(@v1.4) pkg> update
Updating registry at `/usr/applications/academia/julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /usr/applications/academia/julia/registries/General — failed to fetch from repo
└ @ Pkg.Types /build/julia/src/julia-1.4.0/usr/share/julia/stdlib/v1.4/Pkg/src/Types.jl:1122
Installed RecipesPipeline ─ v0.1.2
Installed Plots ─────────── v1.0.8
Updating `/usr/applications/academia/julia/environments/v1.4/Project.toml`
[91a5bcdd] ↑ Plots v1.0.4 ⇒ v1.0.8
Updating `/usr/applications/academia/julia/environments/v1.4/Manifest.toml`
[91a5bcdd] ↑ Plots v1.0.4 ⇒ v1.0.8
[01d81517] + RecipesPipeline v0.1.2
Building Plots → `/usr/applications/academia/julia/packages/Plots/7U0ob/deps/build.log`
所有这些都是因为我无法从JULIA_PKG_SERVER=pkg.julialang.org
获得Plots 1.0。 因此,如果您喜欢/需要最新版本的软件包,则手动更新注册表可以解决问题,直到julia和libgit2再次交谈。
编辑:显然它现在在pkg.julialang.org
(当我尝试时仅达到v0.28)。 如果您不想弄乱文件夹和降级软件包,那么值得尝试。
git问题在这里一样
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:Invalid, invalid version 0 on git_proxy_options)
环保:Arch,julia1.4.0,libgit2 1.0.0
如果您使用的是Julia 1.4,则可以执行export JULIA_PKG_SERVER=pkg.julialang.org
并且您无需在Pkg操作中使用git。 您首先需要执行rm -rf ~/.julia/registries/General
才能将常规注册表升级为使用Pkg协议而不是git。
该问题应报告给Arch,如果他们使用libgit2 1.0,则需要使用https://github.com/JuliaLang/julia/pull/35233之类的补丁。
作为记录,我再次尝试在工作中再次尝试使用Julia 1.5,在代理服务器中的~/.gitconfig
尾随斜杠。
关心这个问题的人将不得不骚扰libgit2项目,并确保他们实际上发布了包含对此错误修复程序的发行版。 显然,等待他们自己修复它是行不通的。
对我来说,发生此错误是因为我使用的是socks5代理(.gitconfig,而git clone mannully与socks5代理一起工作)。 更改为http代理修复了它。
一月21
所以我想问题是我们是要修补libgit2还是只是等到他们发布包含此修复程序的发行版。
8月21
显然,等待他们自己修复它是行不通的。
因此,与前者一起去吗? (补丁libgit2)您甚至可以为他们贡献补丁。
海事组织,要求用户向上游图书馆提出问题/交易有点不公平,毕竟,归根结底的是用户
公平与否,我没有遇到这个问题,而且我不想在libgit2中搞砸以解决此问题。 如果您想为此工作付费,请联系[email protected] ,我们可以找出一份咨询合同。 您也可以购买JuliaTeam ,然后就不会出现此问题,因为您可以连接到防火墙内部的软件包服务器,因此根本不需要通过代理(还有很多其他好处) )。 至少,您可以在https://github.com/libgit2/libgit2/issues/5220而不是此处发出一些声音。 实际上, @ fredrikekre是唯一在此发布信息的人。 取而代之的是每个人都困扰我们,我想期望我们为他们骚扰libgit2开发人员吗? 如果在此处发布的每个人也对libgit2存储库发布了投诉,那么他们可能已经解决了。
我现在对在此发布的以及相关问题的所有人员进行ping操作,其中libgit2错误是他们在相关libgit2问题上的根本原因。 请在此提示您的错误报告。
也许https://github.com/JuliaLang/julia/pull/35233会有所帮助吗? 我没有研究补丁说明。
最有用的评论
@getzze您如何调用
export
JULIA_PKG_SERVER
环境变量在您的shell中?解决方法适用于使用_Julia_ 1.4.0的_Arch Linux_: