Permissions error in ArtifactUtils.upload_to_gist

I am having the following issue with ArtifactUtils.upload_to_gist:

julia> gist = ArtifactUtils.upload_to_gist(artifact_id)
- Creating gist...
✓ Created gist
Cloning into '.'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

This has always worked for me, so I’m not sure what’s going wrong now. The readme says that ArtifactUtils uses the gh CLI for authentication, so I checked that:

julia> run(`$(gh_cli_jll.gh()) auth status`)
github.com
  ✓ Logged in to github.com as *** (/Users/***/.config/gh/hosts.yml)
  ✓ Git operations for github.com configured to use https protocol.
  ✓ Token: *******************

is working fine. I’m not sure what the problem can be. I recently started using osxkeychain as the git credential storage, could this make a difference here?

Stack trace:

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] git
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:44 [inlined]
  [5] (::ArtifactUtils.var"#15#17"{ArtifactUtils.var"#11#12"{String}, String})(git_dir::String)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:45
  [6] mktempdir(fn::ArtifactUtils.var"#15#17"{ArtifactUtils.var"#11#12"{String}, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:764
  [7] mktempdir (repeats 2 times)
    @ ./file.jl:760 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:43 [inlined]
  [9] macro expansion
    @ ./task.jl:454 [inlined]
 [10] with_new_gist(f::ArtifactUtils.var"#11#12"{String}; private::Bool)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:39
 [11] gist_from_file(filepath::String; private::Bool)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:10
 [12] upload_to_gist(artifact_id::Base.SHA1, tarball::String; private::Bool, archive_options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:172
 [13] upload_to_gist
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:163 [inlined]
 [14] #32
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:205 [inlined]
 [15] mktempdir(fn::ArtifactUtils.var"#32#33"{Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Base.SHA1, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:764
 [16] mktempdir (repeats 2 times)
    @ ./file.jl:760 [inlined]
 [17] #upload_to_gist#31
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:204 [inlined]
 [18] upload_to_gist(artifact_id::Base.SHA1)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:183
 [19] top-level scope
    @ REPL[3]:1

Update: Fix error with upload_to_gist by cossio · Pull Request #20 · simeonschaub/ArtifactUtils.jl · GitHub

1 Like

Do you have any update on this? I tried to follow the tutorial here, but I am not being able to upload the gist (I have the same error as you).
Curiously, it upload something to my github gist (altough it’s empty).

You mean the “dummy” thing? I think that’s just to create an empty gist, because the API does not allow you to upload binary stuff at first. So you create the gist with the dummy empty file, and then push via git anything you want (if I understand correctly).

No. I’m still getting the error.

Might be worth opening an issue … Nobody else is experiencing this?

@marcobonici By any chance, are you using osxkeychain as your credential store in your .gitconfig file?

This could be related: Trouble with auth on macOS due to SIP · Issue #40 · JuliaVersionControl/Git.jl · GitHub

@e3c6 , no I am not using osxkeychain.

This could be a fix: Fix error with upload_to_gist by cossio · Pull Request #20 · simeonschaub/ArtifactUtils.jl · GitHub, it worked for me. In case you want to test it, can you comment on the PR if it works or not for you?

1 Like

It worked! I’ll comment it on the PR.

1 Like