Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Make error message better after deleting/recreating the repo behind a package #757

Open
1 task done
shroudedcode opened this issue Nov 29, 2017 · 3 comments
Open
1 task done

Comments

@shroudedcode
Copy link

shroudedcode commented Nov 29, 2017

Edit by @rsese

We found that the issue is if you publish a package but then delete and recreate the repository, if you then try to publish another version of your package you can get a confusing Creating new version failed: Git tag not found error.

You have to unpublish the package first and then publish to get around the error but it's not clear what the issue is from the error message.

x-ref: #707 and Jason's comment /cc #707 (comment) for more background.


Prerequisites

  • Put an X between the brackets on this line if you have done all of the following [...]

Description

I'm currently working on a @semantic-release plugin for apm that has to publish a package based on an existing tag set by it. Whatever I try I don't seem to get it to work, apm publish --tag vX.Y.Z throws an error saying the tag doesn't exist although it clearly does.

Steps to Reproduce

  • Create an Atom package.
  • Login to APM with your token.
  • Follow what I did in this asciinema recording (note that I tried this multiple times and with longer delays).

Expected behavior:

The package gets successfully published.

Actual behavior:

Publishing semantic-release-apm-example@vX.Y.Z ✗
Creating new version failed: Git tag not found

Reproduces how often: 100%

Versions

Atom    : 1.22.1
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
apm  1.18.8
npm  3.10.10
node 6.9.5 x64
python 2.7.12
git 2.7.4

on Ubuntu 16.04.3 LTS

@rsese
Copy link

rsese commented Dec 7, 2017

Sorry for the trouble @shroudedcode - it looks like the issue is with https://github.com/shroudedcode/semantic-release-apm-example yes? Can you confirm if you published that package and then deleted/re-created the repository? I'm wondering if you're hitting the situation described in #707 (comment).

@shroudedcode
Copy link
Author

Can you confirm if you published that package and then deleted/re-created the repository?

Yeah ... seems like I re-created the repository at some point while trying things out.
Totally didn't think of that (because I wasn't aware of repository IDs).

I'm wondering if you're hitting the situation described in #707 (comment).

Looks very similar, I also tried the suggested fix (unpublish and publish again) and it worked.


While my issue is now solved, I think that you should add more telling error messages to prevent this from happening in the future, something like this:

The repository your package is linked to no longer exists. If you re-created the
repository at some point, try updating the repository link with "apm relink".

This way it's clear that nothing is wrong with the tag/tarball, but that the wrong repository is linked.

@kachkaev
Copy link

kachkaev commented Apr 14, 2018

I was desperately trying to publish a fork of markdown-preview-enhanced now and wasted more than an hour. Here's what I saw no matter what options etc. I tried:

apm publish minor
Preparing and tagging a new version ✓
Pushing v0.2.0 tag ✓
Publishing markdown-preview-enhanced-with-litvis@v0.2.0 ✗
Creating new version failed: Git tag not found
apm publish --tag v0.2.0
Publishing markdown-preview-enhanced-with-litvis@v0.2.0 ✗
Creating new version failed: Git tag not found

I did all possible sane and insane things such as unpublishing the package, adding or removing .git in package.json's repository field, manually pushing to master while the update was going, tweaking .git/config, and so on. But then I noticed that in my fork I had the tags from the original repo. So I was publishing v0.2.0 while there were tags like v0.3.0 ... v0.15.5 in the repo. Wiping out these tags on github either helped or just co-incised with a successful publish. Nevermind, going to sleep now 😫

@rsese rsese changed the title "Creating new version failed: Git tag not found" although tag is present "Creating new version failed: Git tag not found" error when trying to publish after deleting/recreating repo Jun 7, 2018
@lee-dohm lee-dohm changed the title "Creating new version failed: Git tag not found" error when trying to publish after deleting/recreating repo Make error message better after deleting/recreating the repo behind a package Jun 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants