# Package publishing problems (failed)

**URL:** <https://discourse.julialang.org/t/package-publishing-problems-failed/9331>\
**Category:** New to Julia\
**Created:** [February 26, 2018, 8:02am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331 "2018-02-26T08:02:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 8:02am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/1 "2018-02-26T08:02:29Z")

</div>

I’d like to report back on my recent (last night) experience with package publishing - ultimately the happy path failed.

1/ per the docs I’ve used the `hub` binary – `hub create` is a great way of setting up the remote repo. However, I suspect `hub` has a problem handling repos ending up with a `.jl` prefix. Notice that in the output, the repo is created without the `.jl` postfix:

```julia
$ hub create
github.com username: essenciary
github.com password for essenciary (never stored):
origin	https://github.com/essenciary/IssueReporter.jl.git (fetch)
origin	https://github.com/essenciary/IssueReporter.jl.git (push)
created repository: essenciary/IssueReporter

```

Obviously, pushing to it will fail:

```julia
$ git push origin master
remote: Repository not found.
fatal: repository 'https://github.com/essenciary/IssueReporter.jl.git/' not found

```

Thus updating the origin was necessary:

```julia
$ git remote set-url origin https://github.com/essenciary/IssueReporter.git

```

2/ `PkgDev.register` worked, but `PkgDev.publish` did not:

```julia
julia> PkgDev.register("IssueReporter")
INFO: Registering IssueReporter at https://github.com/essenciary/IssueReporter.git
INFO: Committing METADATA for IssueReporter

julia> PkgDev.publish()
ERROR: There are no METADATA changes to publish
Stacktrace:
 [1] (::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String})(::Base.LibGit2.GitRepo) at /Users/adrian/.julia/v0.6/PkgDev/src/entry.jl:72
 [2] with(::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
 [3] publish(::String, ::String) at /Users/adrian/.julia/v0.6/PkgDev/src/entry.jl:64
 [4] publish() at /Users/adrian/.julia/v0.6/PkgDev/src/PkgDev.jl:u7533:

```

3/ `PkgDev.tag` worked, but again, `PkgDev.publish` did not:

```julia
julia> PkgDev.tag("IssueReporter")
INFO: Tagging IssueReporter v0.0.1
INFO: Committing METADATA for IssueReporter

julia> PkgDev.publish()
ERROR: SystemError: opening file /Users/adrian/.julia/v0.6/METADATA/BSON/versions/0.1.0/sha1: No such file or directory
Stacktrace:
 [1] #systemerror#44 at ./error.jl:64 [inlined]
 [2] systemerror(::String, ::Bool) at ./error.jl:64
 [3] open(::String, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./iostream.jl:104
 [4] open(::Base.#readstring, ::String) at ./iostream.jl:150
 [5] readchomp at ./io.jl:491 [inlined]
 [6] (::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String})(::Base.LibGit2.GitRepo) at /Users/adrian/.julia/v0.6/PkgDev/src/entry.jl:79
 [7] with(::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
 [8] publish(::String, ::String) at /Users/adrian/.julia/v0.6/PkgDev/src/entry.jl:64
 [9] publish() at /Users/adrian/.julia/v0.6/PkgDev/src/PkgDev.jl:75

```

So unless there’s an easy fix, I presume I’m stuck with trying the manual approach.

* * *

Here’s some debug info:

```julia
julia> MetadataTools.get_pkg("IssueReporter")
IssueReporter https://github.com/essenciary/IssueReporter.git
  0.0.1,f37dce,julia 0.6,GitHub,MetadataTools,URIParser

julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 26, 2018, 9:04am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/2 "2018-02-26T09:04:01Z")

</div>

I would suggest using AttoBot [https://github.com/attobot/attobot](https://github.com/attobot/attobot). It makes registering and tagging packages much easier. Just install it to your repo and tag a release. Done.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 9:17am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/3 "2018-02-26T09:17:48Z")

</div>

Thanks, Kristoffer, I’ll give it a try and report back on the progress. It would be great to identify and officially recommend a better way. Unfortunately every publishing step, following the official doc, resulted in an error so far.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 9:47am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/4 "2018-02-26T09:47:34Z")

</div>

Attobot seems to have worked. I’ve also opened an issue with `hub`.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [February 26, 2018, 10:46am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/5 "2018-02-26T10:46:26Z")

</div>

I think the doc is a bit outdated, I made a PR about it a while ago:

[https://github.com/JuliaLang/julia/pull/25163](https://github.com/JuliaLang/julia/pull/25163)

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 26, 2018, 10:49am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/6 "2018-02-26T10:49:06Z")

</div>

> [@essenciary](#):
>
> It would be great to identify and officially recommend a better way.

The `master` docs [recommend attobot](https://docs.julialang.org/en/latest/manual/packages/#Tagging-and-Publishing-Your-Package-1).

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 11:19am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/7 "2018-02-26T11:19:01Z")

</div>

@Tamas_Papp ah, ok, I’ve seen that. I guess it depends on how each person understands it. I didn’t read that as the official way. It’s just a tip and as I have limited experience with GitHub bot integrations, I decided to skip it. Also I prefer not to do things via the GitHub website but rather stay in the Julia REPL. If that’s the best practice as of recently, I’d expect the documentation to move away the parts about `PkgDev.register`, `PkgDev.publish`, and `PkgDev.tag` and elaborate on the Attobot approach. If that is the case, I’m happy to do it.

Anyway, it’s good to know that Attobot works - the whole thing is part of a write-up on creating and publishing Julia packages and I was quite disappointed by the failure. I was reluctant to go into manual git wrangling as it would’ve been outside the scope of the chapter, which is targeting beginners. I’m adding in a section on  
Attobot now. In the end, it’s all for the better as it’s a more exciting process. 🙂

@jonathanBieler I also tried tagging and then publishing again, but that failed as well. Not sure if the previous call to `PkgDev.publish` broke it, but the tagging seems to have worked, per my output.

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [February 26, 2018, 11:41am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/8 "2018-02-26T11:41:38Z")

</div>

imho: while attobot is quite nice, the REPL way should work as described. Not everything is hosted on github.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 11:56am UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/9 "2018-02-26T11:56:29Z")

</div>

Good point

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 26, 2018, 1:27pm UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/10 "2018-02-26T13:27:41Z")

</div>

> [@lobingera](#):
>
> imho: while attobot is quite nice, the REPL way should work as described. Not everything is hosted on github.

Note that it is not very difficult to just do what PkgDev does manually (push `.julia/v0.x/METADATA/`to local METADATA and create a PR)

Of course, PkgDev should work as well, but like with everything, there is a cost-benefit ratio to consider.

but with limited there is always a effort to gain rat

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 3:43pm UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/11 "2018-02-26T15:43:33Z")

</div>

Following up on the repo naming issue, after checking with the `hub` team, I believe that the problem is with `PkgDev`:

```julia
julia> PkgDev.generate("TestPkg", "MIT")
INFO: Initializing TestPkg repo: /Users/adrian/.julia/v0.6/TestPkg # repo is initialized as "TestPkg"
INFO: Origin: https://github.com/essenciary/TestPkg.jl.git # origin is set to "TestPkg.jl"
INFO: Generating LICENSE.md
INFO: Generating README.md
INFO: Generating src/TestPkg.jl
INFO: Generating test/runtests.jl
INFO: Generating REQUIRE
INFO: Generating .gitignore
INFO: Generating .travis.yml
INFO: Generating appveyor.yml
INFO: Generating .codecov.yml
INFO: Committing TestPkg generated files

```

The fact that `hub create` adds a remote repo called “TestPkg”, just like the name of the local repo, seems consistent to me.

Another issue is that it’s not clear how to address the problem. My initial solution was to update the origin (instead or renaming the repo to add the `.jl` extension) – but repos which don’t end with a `.jl` extension break Attobot 🤨

* * *

Suggested fix: `PkgDev.generate` should consistently append `.jl` to both the repo name and the origin.

* * *

###Update 1  
Also tried creating a package which includes the `.jl` suffix in its name – but `PkgDev` removes that from the repo’s name, ending up with the same situation:

```julia
julia> PkgDev.generate("TestPkgTwo.jl", "MIT")
INFO: Initializing TestPkgTwo repo: /Users/adrian/.julia/v0.6/TestPkgTwo
INFO: Origin: https://github.com/essenciary/TestPkgTwo.jl.git
INFO: Generating LICENSE.md
INFO: Generating README.md
INFO: Generating src/TestPkgTwo.jl
INFO: Generating test/runtests.jl
INFO: Generating REQUIRE
INFO: Generating .gitignore
INFO: Generating .travis.yml
INFO: Generating appveyor.yml
INFO: Generating .codecov.yml
INFO: Committing TestPkgTwo generated files

```

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 26, 2018, 3:51pm UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/12 "2018-02-26T15:51:49Z")

</div>

I was under the impression that this is how it should work; you create the repos ending in `.jl` (so that software is easier to find on the net), and locally this is omitted.

(I always end up changing the location of `origin` anyway, to use the `git` protocol instead of `https`).

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2018, 4:01pm UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/13 "2018-02-26T16:01:17Z")

</div>

Well, I don’t know what to make of it. Attobot requires the `.jl` suffix while `PkgDev` strips it off.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 27, 2018, 3:52pm UTC](https://discourse.julialang.org/t/package-publishing-problems-failed/9331/14 "2018-02-27T15:52:53Z")

</div>

Sometimes when one obsesses too much about a problem, one misses the most obvious solution:  
`$ hub create TestPkg.jl `

All that’s needed is passing the name of the repo with the `.jl` extension this time. So I’m guessing the only issue with the documentation is that the convention is not spelled clearly:

- no `.jl` locally (or if used, will be stripped)
- _do_ use `.jl` remotely (required by Attobot & co)
