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

unable to do PkgDev.publish() #48

Closed
alsam opened this issue Jun 19, 2016 · 33 comments
Closed

unable to do PkgDev.publish() #48

alsam opened this issue Jun 19, 2016 · 33 comments

Comments

@alsam
Copy link

alsam commented Jun 19, 2016

Hello, I've got the following error message when I tried to do Pkg.publish():

julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing OffsetArrays permanent tags: v0.2.0
ERROR: MethodError: no method matching Base.LibGit2.UserPasswordCredentials(::Void, ::String)
Closest candidates are:
  Base.LibGit2.UserPasswordCredentials(::AbstractString, ::AbstractString)
  Base.LibGit2.UserPasswordCredentials{T}(::Any)
 in credentials() at .../.julia/v0.5/PkgDev/src/github.jl:126
 in (::PkgDev.Entry.##6#9{Dict{String,Array{String,1}}})(::Base.LibGit2.GitRepo) at .../.julia/v0.5/PkgDev/src/entry.jl:99
 in with(::PkgDev.Entry.##6#9{Dict{String,Array{String,1}}}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:660
 in publish(::String, ::String) at .../.julia/v0.5/PkgDev/src/entry.jl:84
 in publish() at .../.julia/v0.5/PkgDev/src/PkgDev.jl:55
 in eval(::Module, ::Any) at ./boot.jl:231
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46
julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0-dev+4819 (2016-06-16 20:13 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit d634100* (3 days old master)
|__/                   |  x86_64-linux-gnu

Thanks!

@timholy
Copy link
Member

timholy commented Jul 26, 2016

Still relevant with a version of master as of today:

julia> PkgDev.publish()
WARNING: bytestring(s::AbstractString...) is deprecated, use string(s...) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in bytestring(::SubString{String}) at ./deprecated.jl:50
 in dir(::SubString{String}) at /home/tim/.julia/v0.5/PkgDev/src/PkgDev.jl:24
 in (::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String})(::Base.LibGit2.GitRepo) at /home/tim/.julia/v0.5/PkgDev/src/entry.jl:71
 in with(::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:658
 in publish(::String, ::String) at /home/tim/.julia/v0.5/PkgDev/src/entry.jl:53
 in publish() at /home/tim/.julia/v0.5/PkgDev/src/PkgDev.jl:70
 in eval(::Module, ::Any) at ./boot.jl:234
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:46
while loading no file, in expression starting on line 0
INFO: Validating METADATA
WARNING: bytestring(s::AbstractString...) is deprecated, use string(s...) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in bytestring(::String) at ./deprecated.jl:50
 in dir(::String) at /home/tim/.julia/v0.5/PkgDev/src/PkgDev.jl:24
 in publish(::String, ::String) at /home/tim/.julia/v0.5/PkgDev/src/entry.jl:86
 in publish() at /home/tim/.julia/v0.5/PkgDev/src/PkgDev.jl:70
 in eval(::Module, ::Any) at ./boot.jl:234
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:46
while loading no file, in expression starting on line 0
INFO: Pushing ImageMagick permanent tags: v0.1.7
ERROR: error authenticating:  ssh-agent
ERROR: MethodError: no method matching start(::Void)
Closest candidates are:
  start(::SimpleVector)
  start(::Base.MethodList)
  start(::IntSet)
  ...
 in isempty(::Void) at ./iterator.jl:3
 in credentials_callback(::Ptr{Ptr{Void}}, ::Cstring, ::Cstring, ::UInt32, ::Ptr{Void}) at ./libgit2/callbacks.jl:117
 in macro expansion at ./libgit2/error.jl:96 [inlined]
 in #push#53(::Bool, ::Base.LibGit2.PushOptions, ::Function, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./libgit2/remote.jl:84
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./<missing>:0
 in #push#92(::String, ::String, ::Array{String,1}, ::Bool, ::Nullable{Base.LibGit2.UserPasswordCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:179
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRepo) at ./<missing>:0
 in (::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}})(::Base.LibGit2.GitRepo) at /home/tim/.julia/v0.5/PkgDev/src/entry.jl:101
 in with(::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:658
 in publish(::String, ::String) at /home/tim/.julia/v0.5/PkgDev/src/entry.jl:86
 in publish() at /home/tim/.julia/v0.5/PkgDev/src/PkgDev.jl:70
 in eval(::Module, ::Any) at ./boot.jl:234
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:46
julia> versioninfo()
Julia Version 0.5.0-pre+5632
Commit c849f54* (2016-07-22 19:29 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)

PkgDev:

tim@diva:~/.julia/v0.5/PkgDev$ git log | head
commit e16710de8dbabbf3a327b09687e5912c56157e93
Author: Gabriel Gellner <gabrielgellner@gmail.com>
Date:   Wed Jun 29 11:06:51 2016 -0700

    Add GPL family of Licenses (#47)

    * Add GPL family of Licenses

    Pull request to resolve #46

@tkelman
Copy link
Contributor

tkelman commented Jul 26, 2016

I think you're 2 commits of julia prior to the fix for that one https://github.com/JuliaLang/julia/commits/3503a59666b4cca443e926c8c5974a1817f1180e

@timholy
Copy link
Member

timholy commented Jul 26, 2016

Ah, OK. Moreover, it worked if I had ssh-agent already running.

I'll update my julia.

@wildart
Copy link
Member

wildart commented Jul 28, 2016

@alsam Try PkgDev.config()

@wildart
Copy link
Member

wildart commented Jul 28, 2016

@timholy Update your julia build to recent master, reported error was fixed.

@timholy
Copy link
Member

timholy commented Jul 28, 2016

Yep, I'm just loving Pkg & PkgDev these days. The progress in recent weeks has been astonishing.

@alsam
Copy link
Author

alsam commented Jul 28, 2016

Even with PkgDev.config() I'm still having:

julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing OffsetArrays permanent tags: v0.2.0, v0.2.1
ERROR: error authenticating:  ssh-agent
ERROR: AssertionError: isdefined(p,ks)
 in setindex!(::Base.LibGit2.UserPasswordCredentials, ::String, ::Symbol, ::String) at ./libgit2/types.jl:67
...

@timholy mentioned that it works if ssh-agent is running.
Cannot figure how to get it running.

@tkelman
Copy link
Contributor

tkelman commented Jul 28, 2016

@Keno it sure would have been nice if those assertions had been more descriptive about the values of what it was trying to look up. @alsam does that happen every time? you can try gallium or adding @show calls to see what's going wrong.

@Keno
Copy link
Member

Keno commented Jul 28, 2016

What about the rest of the backtrack?

@alsam
Copy link
Author

alsam commented Jul 28, 2016

Yes, it happens every time, the full log:

INFO: Pushing OffsetArrays permanent tags: v0.2.0, v0.2.1
ERROR: error authenticating:  ssh-agent
ERROR: AssertionError: isdefined(p,ks)
 in setindex!(::Base.LibGit2.UserPasswordCredentials, ::String, ::Symbol, ::String) at ./libgit2/types.jl:67
 in credentials_callback(::Ptr{Ptr{Void}}, ::Cstring, ::Cstring, ::UInt32, ::Ptr{Void}) at ./libgit2/callbacks.jl:134
 in macro expansion at ./libgit2/error.jl:96 [inlined]
 in #push#53(::Bool, ::Base.LibGit2.PushOptions, ::Function, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./libgit2/remote.jl:84
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./<missing>:0
 in #push#94(::String, ::String, ::Array{String,1}, ::Bool, ::Nullable{Base.LibGit2.UserPasswordCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:179
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRepo) at ./<missing>:0
 in (::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}})(::Base.LibGit2.GitRepo) at /home/.../.julia/v0.5/PkgDev/src/entry.jl:99
 in with(::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:658
 in publish(::String, ::String) at /home/.../.julia/v0.5/PkgDev/src/entry.jl:84
 in publish() at /home/.../.julia/v0.5/PkgDev/src/PkgDev.jl:55
julia> versioninfo()
Julia Version 0.5.0-rc0+36
Commit b7d37c4 (2016-07-28 19:53 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)

@alsam
Copy link
Author

alsam commented Jul 28, 2016

The same error message after upgrading PkgDev

julia> Pkg.update()
INFO: Updating METADATA...
WARNING: Cannot perform fast-forward merge.
INFO: Updating cache of PkgDev...
INFO: Updating cache of PositiveFactorizations...
INFO: Updating OffsetArrays master...
WARNING: Package PkgDev.try: skipping update (dirty)...
INFO: Computing changes...
INFO: Upgrading PkgDev: v0.1.0 => v0.1.1
...
julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing OffsetArrays permanent tags: v0.2.0, v0.2.1
ERROR: error authenticating:  ssh-agent
ERROR: AssertionError: isdefined(p,ks)
 in setindex!(::Base.LibGit2.UserPasswordCredentials, ::String, ::Symbol, ::String) at ./libgit2/types.jl:67
...

@Keno
Copy link
Member

Keno commented Jul 28, 2016

I have a patch, hold on.

@alsam
Copy link
Author

alsam commented Jul 28, 2016

Thanks!

@Keno
Copy link
Member

Keno commented Jul 29, 2016

Try with JuliaLang/julia#17691. I suspect there may still be a bug in PkgDev (namely trying to authenticate an SSH remote with username/password), but at least it should give a better error message.

@alsam
Copy link
Author

alsam commented Jul 29, 2016

Ok, switched to kf/refactorlibgit2 branch and now have the following error message:

julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing OffsetArrays permanent tags: v0.2.0, v0.2.1
WARNING: The explicitly provided credentials were incompatible with the server's supported authentication methods
ERROR: GitError(Code:EAUTH, Class:None, No errors)
 in macro expansion at ./libgit2/error.jl:98 [inlined]
 in #push#53(::Bool, ::Base.LibGit2.PushOptions, ::Function, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./libgit2/remote.jl:84
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./<missing>:0
 in #push#94(::String, ::String, ::Array{String,1}, ::Bool, ::Nullable{Base.LibGit2.UserPasswordCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:179
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRepo) at ./<missing>:0
 in (::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}})(::Base.LibGit2.GitRepo) at /home/.../.julia/v0.5/PkgDev/src/entry.jl:101
 in with(::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:645
 in publish(::String, ::String) at /home/.../.julia/v0.5/PkgDev/src/entry.jl:86
 in publish() at /home/.../.julia/v0.5/PkgDev/src/PkgDev.jl:70

@Keno
Copy link
Member

Keno commented Jul 29, 2016

Yep, for some reason your METADATA has an SSH remote but PkgDev expects it to be an HTTPS remote. Ideally PkgDev should probably force HTTPS.

@alsam
Copy link
Author

alsam commented Jul 30, 2016

Thanks @Keno, do you know how to fix METADATA?

@alsam
Copy link
Author

alsam commented Aug 2, 2016

Switched to main trunk

julia> versioninfo()
Julia Version 0.5.0-rc0+124
Commit 6b6dead (2016-08-02 06:09 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
...

Thanks for merging the more informative diagnostics to master from kf/refactorlibgit2:

julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing OffsetArrays permanent tags: v0.2.0, v0.2.1, v0.2.2
WARNING: The explicitly provided credentials were incompatible with the server's supported authentication methods
ERROR: GitError(Code:EAUTH, Class:None, No errors)
 in macro expansion at ./libgit2/error.jl:98 [inlined]
...

Unfortunately still don't know a workaround for pushing the tags.

@randyzwitch
Copy link

@alsam I had problems pushing tags, I ended up modifying the pushurl in <package>/.git/config to use https instead of git protocol and it worked.

A hack for sure, but it worked

@tkelman
Copy link
Contributor

tkelman commented Aug 3, 2016

We should probably make Pkg default to using an https push url

@alsam
Copy link
Author

alsam commented Aug 3, 2016

Thanks for the hint, just have added to <package>/.git/config

[url "https://"]
    insteadOf = git://

As I have the same in $HOME/.gitconfig
unfortunately it didn't help.

@alsam
Copy link
Author

alsam commented Aug 3, 2016

Thanks @randyzwitch , @tkelman for the hints!
Directly modified pushurl in <package>/.git/config
and created a push request JuliaLang/METADATA.jl#5417

@tomasaschan
Copy link
Member

I'm seing a similar error today, but I don't know if the problem is with PkgDev or base Julia:

julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing Contour permanent tags: v0.1.1
WARNING: The explicitly provided credentials were incompatible with the server's supported authentication methods
ERROR: GitError(Code:EAUTH, Class:None, No errors)
 in macro expansion at ./libgit2/error.jl:98 [inlined]
 in #push#53(::Bool, ::Base.LibGit2.PushOptions, ::Function, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./libgit2/remote.jl:84
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./<missing>:0
 in #push#94(::String, ::String, ::Array{String,1}, ::Bool, ::Nullable{Base.LibGit2.UserPasswordCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:179
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRepo) at ./<missing>:0
 in (::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}})(::Base.LibGit2.GitRepo) at /home/tlycken/.julia/v0.5/PkgDev/src/entry.jl:101
 in with(::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:645
 in publish(::String, ::String) at /home/tlycken/.julia/v0.5/PkgDev/src/entry.jl:86
 in publish() at /home/tlycken/.julia/v0.5/PkgDev/src/PkgDev.jl:70

I get the same error regardless of Pkg.setprotocol!("git"), Pkg.setprotocol!("ssh"), or Pkg.setprotocol!("https"), PkgDev.config() indicates a user for which ~/.ssh/id_rsa is a valid key file, and ssh-agent is running. Julia Version 0.5.0-rc1+1, Commit acfd04c*, PkgDev v0.1.1.

Do I still need to fix some config issue, or should I file a new issue (here or at base Julia)?

@helgee
Copy link

helgee commented Aug 15, 2016

Another one on RC2:

ERROR: GitError(Code:EAUTH, Class:OS, The ProgramData file 'config' doesn't exist: )
 in macro expansion at ./libgit2/error.jl:99 [inlined]
 in #push#53(::Bool, ::Base.LibGit2.PushOptions, ::Function, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./libgit2/remote.jl:84
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./<missing>:0
 in #push#94(::String, ::String, ::Array{String,1}, ::Bool, ::Nullable{Base.LibGit2.UserPasswordCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:185
 in (::Base.LibGit2.#kw##push)(::Array{Any,1}, ::Base.LibGit2.#push, ::Base.LibGit2.GitRepo) at ./<missing>:0
 in (::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}})(::Base.LibGit2.GitRepo) at /Users/helge/.julia/v0.5/PkgDev/src/entry.jl:114
 in with(::PkgDev.Entry.##6#11{Dict{String,Array{String,1}}}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:638
 in publish(::String, ::String) at /Users/helge/.julia/v0.5/PkgDev/src/entry.jl:97
 in publish() at /Users/helge/.julia/v0.5/PkgDev/src/PkgDev.jl:70

@eschnett
Copy link

Is there a work-around for this EAUTH error?

@wildart
Copy link
Member

wildart commented Aug 16, 2016

@helgee Run PkgDev.config() to setup a GitHub access token for publishing.

@eschnett Have you tried latest master? All push updates now use https transport.

@eschnett
Copy link

@wildart I tried master for both Julia and PkgDev, and this didn't help. I also ran PkgDev.config(), and confirmed my user name etc., but this also didn't change anything.

How does the Github access token thingy work? Is this something I have to do manually for my clone of the Metadata repo? Is there a way I can use ssh instead?

@alsam
Copy link
Author

alsam commented Aug 17, 2016

PkgDev in the current state is broken for me too. Used to work work-around to substitute pushurl
from git@github.com/... to https://github.com/... doesn't work for me anymore unfortunately.
The error message:

julia> PkgDev.publish()
INFO: Validating METADATA
INFO: Pushing OffsetArrays permanent tags: v0.2.4
ERROR: GitError(Code:EAUTH, Class:None, No errors)
 in macro expansion at ./libgit2/error.jl:99 [inlined]
...

I'd retreat to manual creation of METADATA branch or maybe someone knows a workaround?

@eschnett
Copy link

My workaround is to tag and publish from Julia 0.4; that seems to be the easiest.

@alsam
Copy link
Author

alsam commented Aug 17, 2016

Thank you, it works.

@tkelman
Copy link
Contributor

tkelman commented Aug 17, 2016

Or tag from PkgDev and push from the command-line, that's what I usually do.

@leclere
Copy link

leclere commented Oct 19, 2016

I have the same error after PkgDev.publish():

WARNING: The explicitly provided credentials were incompatible with the server's supported authentication methods
ERROR: GitError(Code:EAUTH, Class:OS, The ProgramData file 'config' doesn't exist: )
in macro expansion at ./libgit2/error.jl:99 [inlined]
in #push#53(::Bool, ::Base.LibGit2.PushOptions, ::Function, ::Base.LibGit2.GitRemote, ::Array{String,1}) at ./libgit2/remote.jl:84

@tkelman would you mind precising how you push from command-line ?

P.S: I don't know how to insert block of code (or in this case error report), sorry for the bad presentation.

@tkelman
Copy link
Contributor

tkelman commented Oct 19, 2016

What I do is roughly the following

Pkg.checkout("PackageToTag")
Pkg.update()
import PkgDev
cd(Pkg.dir("METADATA"))
run(`git checkout -b tagmynewpackage`)
PkgDev.tag("PackageToTag")
run(`git remote add mine https://tkelman@github.com/tkelman/METADATA.jl`)
run(`git push mine tagmynewpackage`) # or from shell mode with ;
cd(Pkg.dir("PackageToTag"))
run(`git remote add mine https://tkelman@github.com/tkelman/PackageToTag.jl`)
run(`git push mine --tags`) # or from shell mode with ;

then open the PR to METADATA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests