# Permissions error in ArtifactUtils.upload\_to\_gist

**URL:** <https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469>\
**Category:** General Usage\
**Tags:** question, package, error, artifacts\
**Created:** [March 22, 2023, 6:21pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469 "2023-03-22T18:21:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [March 22, 2023, 6:21pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/1 "2023-03-22T18:21:40Z")

</div>

I am having the following issue with `ArtifactUtils.upload_to_gist`:

```julia
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
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:

```julia
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](https://github.com/simeonschaub/ArtifactUtils.jl/pull/20)

---

<div class="post-metadata">

**Author:** ![marcobonici](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcobonici/32/20549_2.png) [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Post date:** [March 27, 2023, 1:23am UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/2 "2023-03-27T01:23:41Z")

</div>

Do you have any update on this? I tried to follow the tutorial [here](https://www.juliafordatascience.com/artifacts/), 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).

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [March 27, 2023, 9:46am UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/3 "2023-03-27T09:46:48Z")

</div>

> [@marcobonici](#):
>
> 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).

> [@marcobonici](#):
>
> Do you have any update on this?

No. I’m still getting the error.

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [March 28, 2023, 8:37pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/4 "2023-03-28T20:37:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [March 28, 2023, 8:40pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/5 "2023-03-28T20:40:01Z")

</div>

@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](https://github.com/JuliaVersionControl/Git.jl/issues/40)

---

<div class="post-metadata">

**Author:** ![marcobonici](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcobonici/32/20549_2.png) [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Post date:** [March 29, 2023, 7:24pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/6 "2023-03-29T19:24:57Z")

</div>

@e3c6 , no I am not using osxkeychain.

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [March 29, 2023, 8:25pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/7 "2023-03-29T20:25:14Z")

</div>

This could be a fix: [Fix error with upload\_to\_gist by cossio · Pull Request #20 · simeonschaub/ArtifactUtils.jl · GitHub](https://github.com/simeonschaub/ArtifactUtils.jl/pull/20), it worked for me. In case you want to test it, can you comment on the PR if it works or not for you?

---

<div class="post-metadata">

**Author:** ![marcobonici](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcobonici/32/20549_2.png) [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Post date:** [March 29, 2023, 9:59pm UTC](https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469/8 "2023-03-29T21:59:49Z")

</div>

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