martinthomson / i-d-template

A template for IETF internet draft git repositories
Other
208 stars 182 forks source link

Publish workflow fails to upload: "Revision not found" #311

Closed aarongable closed 2 years ago

aarongable commented 2 years ago

I'm setting up a new repository and running into a roadblock. When I push a tag and the Publish New Draft Version action runs, it fails to upload the draft.

Error message:

``` /usr/bin/docker run --name ghcriomartinthomsonidtemplateactionlatest_eb0669 --label 48c179 --workdir /github/workspace --rm -e INPUT_MAKE -e INPUT_TOKEN -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/draft-acme-ari/draft-acme-ari":"/github/workspace" ghcr.io/martinthomson/i-d-template-action:latest "upload" warning: lib/default-branch.py: correcting the default branch locally: make: '.targets.mk' is up to date. warning: lib/default-branch.py: git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main warning: lib/default-branch.py: correcting the default branch locally: warning: lib/default-branch.py: git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main make[1]: Entering directory '/github/workspace' git show "draft-aaron-acme-ari-01:draft-aaron-acme-ari.md" | sed -e 's/draft-aaron-acme-ari-latest/draft-aaron-acme-ari-01/g' >draft-aaron-acme-ari-01.md cat draft-aaron-acme-ari-01.md | mmark | lib/add-note.py | xml2rfc -q -s 'Setting consensus="true" for IETF STD document' --rfc-base-url https://datatracker.ietf.org/doc/html/ --id-base-url https://datatracker.ietf.org/doc/html/ --cache=/root/.cache/xml2rfc --v2v3 /dev/stdin -o /dev/stdout >draft-aaron-acme-ari-01.xml rm draft-aaron-acme-ari-01.md make[1]: Leaving directory '/github/workspace' make[1]: Entering directory '/github/workspace' set -ex; email="aaron@letsencrypt.org"; \ [ -z "$email" ] && email=$(xmllint --xpath '/rfc/front/author[1]/address/email/text()' draft-aaron-acme-ari-01.xml 2>/dev/null); \ [ -z "$email" ] && ! echo "Unable to find email to use for submission." 1>&2; \ curl -sS -D .draft-aaron-acme-ari-01.upload -F "user=$email" -F "xml=@draft-aaron-acme-ari-01.xml" "https://datatracker.ietf.org/api/submit" && echo && \ (grep -q ' 200 OK' .draft-aaron-acme-ari-01.upload >/dev/null 2>&1 || ! cat .draft-aaron-acme-ari-01.upload 1>&2) + email=aaron@letsencrypt.org + '[' -z aaron@letsencrypt.org ']' + '[' -z aaron@letsencrypt.org ']' + curl -sS -D .draft-aaron-acme-ari-01.upload -F user=aaron@letsencrypt.org -F xml=@draft-aaron-acme-ari-01.xml https://datatracker.ietf.org/api/submit + echo Validation Error: {'__all__': ['Revision not found']} + grep -q ' 200 OK' .draft-aaron-acme-ari-01.upload + cat .draft-aaron-acme-ari-01.upload HTTP/1.1 400 Bad Request Date: Tue, 21 Sep 2021 22:35:17 GMT Server: Apache Content-Length: 53 Strict-Transport-Security: max-age=3600; includeSubDomains X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block X-Frame-Options: ALLOW-FROM IETF.ORG *.IETF.ORG MEETECHO.COM *.MEETECHO.COM GATHER.TOWN *.GATHER.TOWN Referrer-Policy: strict-origin-when-cross-origin Vary: Origin,Accept-Encoding Strict-Transport-Security: max-age=31536000; preload X-Xss-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Security-Policy: default-src 'self' 'unsafe-inline' data: https://datatracker.ietf.org/ https://www.ietf.org/ http://ietf.org/; frame-ancestors 'self' ietf.org *.ietf.org meetecho.com *.meetecho.com gather.town *.gather.town Connection: close Content-Type: text/plain make[1]: *** [lib/upload.mk:20: .draft-aaron-acme-ari-01.upload] Error 1 make[1]: *** Deleting file '.draft-aaron-acme-ari-01.upload' make: *** [lib/upload.mk:29: .draft-aaron-acme-ari-01.upload] Error 2 make[1]: Leaving directory '/github/workspace' ```

I do have a datatracker account with my aaron@letsencrypt.org address, so I don't think that's the issue: image

Am I just missing a step here, or has something deeper gone wrong? Thanks, and sorry for the trouble!

martinthomson commented 2 years ago

Hmm, why are you tagging this with a -01 and not -00? Is this the first version?

aarongable commented 2 years ago

Aha! No one taught me that drafts are zero-indexed :) Thank you!

However, I get the same result when tagging as -00:

+ curl -sS -D .draft-aaron-acme-ari-00.upload -F user=aaron@letsencrypt.org -F xml=@draft-aaron-acme-ari-00.xml https://datatracker.ietf.org/api/submit
+ echo
+ grep -q ' 200 OK' .draft-aaron-acme-ari-00.upload
+ cat .draft-aaron-acme-ari-00.upload
Validation Error: {'__all__': ['Revision not found']}
martinthomson commented 2 years ago

Hmm, that's a singularly unhelpful message. I cloned your repo, built the file, and it seems like you have a source file problem. I don't know that it will fix the problem - I'm not very familiar with mmark - but I've opened https://github.com/aarongable/draft-acme-ari/pull/1 for you.

After that, you will need to remove some tags (which might mean some command-line chicanery). You currently have -00 and -01 tags floating around. From the command-line, this is relatively easy:

git tag -d draft-aaron-acme-ari-00 draft-aaron-acme-ari-01
git push origin :draft-aaron-acme-ari-00
git push origin :draft-aaron-acme-ari-01

You might be able to delete a release from the GitHub site, but I'm not sure about that (it's an unusual thing to want to do). After that, try tagging with -00 again and we'll see how it works out.

The way I discovered this was to build the draft and run idnits, which complained about the draft name.

By the way, you should really make sure that you have an abstract before you submit something. It's fine to have a bunch of placeholder text when it comes to details, but the abstract is used pretty widely. At a minimum, you are missing out on good marketing for your proposal.

aarongable commented 2 years ago

Thank you! I already had a local change that dropped a couple of the extraneous values from the title block (stand_alone, smart_quotes, etc) and added -latest to the name, but I hadn't pushed it because I didn't think it was related to this and I wanted to leave things pristine for investigation. Clearly I should have just gone for it!

I've actually already removed the -01 tag (multiple times!), and yeah will obviously remove the current -00 tag before trying again.

I was also trying to run idnits, but was stymied by the fact that the various make commands exposed by the template all delete the .xml file when they're done. I got to the point where I was about to remove that step from the makefile so I could look at the XML myself and run it through idnits, but then I got distracted by other things in my workday. Just did some trawling and discovered that, although make xml doesn't work, make draft-aaron-acme-ari.xml does, so now I can run idnits myself. Aaaaand I just discovered (no thanks to any help text on the idnits page itself) that it actually wants the text file, not the XML file. Hah! That'll show me for not checking my assumptions :)

Thanks for the tip about the abstract. I'll work something up and then try tagging -00 again.

martinthomson commented 2 years ago

If you need a file, just make it. For instance, you can run make draft-aaron-acme-ari-00.xml at any time to pull the tagged version out. If you list a target on the command line, make won't delete it. (I use this for debugging, but in generally you don't want these intermediate files sitting around, they aren't really that useful.)

aarongable commented 2 years ago

Yep, that's what I ended up discovering! Was just surprised that make pdf works but make xml doesn't.

Regardless, I merged your PR and a couple others, tagged it, and it appears to have worked. Thanks again!