dune-release icon indicating copy to clipboard operation
dune-release copied to clipboard

Getting Invalid token 'HTTP/1.1 422 Unprocessable Entity'

Open bikallem opened this issue 5 years ago • 20 comments

dune-release is giving an error below. I am not sure how to resolve it. Any pointers?

[?] Create release v1.0.1 on [email protected]:lemaetech/http-mutlipart-formdata.git? [Y/n]              │
y                                                                                                     │
[-] Creating release v1.0.1 on [email protected]:lemaetech/http-mutlipart-formdata.git via github's API  │
dune-release: [ERROR] Line 2, bytes 0-33:                                                             │
  Invalid token 'HTTP/1.1 422 Unprocessable Entity'

bikallem avatar Dec 04 '20 09:12 bikallem

update It seems to be able to create the release in a github repo okay. However, dune-release dies after that step, i.e. it doesn't create a pull request to opam repository.

bikallem avatar Dec 04 '20 09:12 bikallem

Could you run it again with -vvv and paste the output here so we have a bit more data about what's going on and where this error is coming from?

Have you already used dune-release to release this package in the past? Just trying to assess whether this is a bug we introduced or if it might have always been there.

NathanReb avatar Dec 04 '20 09:12 NathanReb

Sure, here's the log below,

bikal@localhost ~/g/http-mutlipart-formdata (master)> dune-release tag
[-] Extracting tag from first entry in CHANGES.md
[-] Using tag "v1.0.1"
[?] Create git tag v1.0.1 for HEAD? [Y/n]
y
[+] Tagged HEAD with version v1.0.1
bikal@localhost ~/g/http-mutlipart-formdata (master)> dune-release -vvv
dune-release: [INFO] dune-release 1.4.0 running
[-] Building source archive
dune-release: [EXEC:28142] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28143] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28144] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28145] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28146] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28147] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28148] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28149] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'v1.0.1']
dune-release: [EXEC:28150] ['git' '--git-dir' '.git' 'show' '-s'
                            '--format=%ct' 'v1.0.1^{commit}']
dune-release: [EXEC:28151] ['git' '--git-dir' '.git' 'clone' '--local' '.git'
                            '_build/http-multipart-formdata-v1.0.1.build']
dune-release: [EXEC:28153] ['git' '--git-dir'
                            '_build/http-multipart-formdata-v1.0.1.build/.git'
                            '--work-tree'
                            '_build/http-multipart-formdata-v1.0.1.build/'
                            'checkout' '--quiet' '-b'
                            'dune-release-dist-v1.0.1' 'v1.0.1']
dune-release: [EXEC:28154] ['dune' 'subst']
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/CHANGES.md
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/LICENSE
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/Makefile
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/README.md
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/highlight.pack.js
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/.dune-keep
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/Multipart
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/Multipart/Part
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/Multipart/Part/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/Multipart/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/Part
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/Part/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata__Multipart
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata__Multipart/.dune-keep
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata__Multipart/Part
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata__Multipart/Part/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/Http_multipart_formdata__Multipart/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/http-multipart-formdata/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/index.html
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/docs/odoc.css
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/dune
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/dune-project
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/http-multipart-formdata.opam
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/src
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/src/dune
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/src/http_multipart_formdata.ml
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/src/http_multipart_formdata.mli
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/src/index.mld
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/test
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/test/dune
dune-release: [INFO] Archiving http-multipart-formdata-v1.0.1/test/test.ml
dune-release: [EXEC:28161] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28162] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28163] ['bzip2']
[+] Wrote archive _build/http-multipart-formdata-v1.0.1.tbz
dune-release: [EXEC:28164] ['tar' '-xjf'
                            'http-multipart-formdata-v1.0.1.tbz']

[-] Linting distrib in _build/http-multipart-formdata-v1.0.1
[ OK ] File README is present.
[ OK ] File LICENSE is present.
[ OK ] File CHANGES is present.
[ OK ] File opam is present.
dune-release: [EXEC:28166] ['opam' '--version']
dune-release: [INFO] Parsing opam file http-multipart-formdata.opam
dune-release: [EXEC:28167] ['true']
dune-release: [EXEC:28168] ['opam' 'lint' '-s'
                            'http-multipart-formdata.opam']
[ OK ] lint opam file http-multipart-formdata.opam.
[ OK ] opam field description is present
dune-release: [EXEC:28169] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28170] ['git' '--git-dir'
                            '/home/bikal/github/http-mutlipart-formdata/.git'
                            '--work-tree'
                            '/home/bikal/github/http-mutlipart-formdata/'
                            'describe' '--always' 'HEAD']
[ OK ] opam fields homepage and dev-repo can be parsed by dune-release
[ OK ] Skipping doc field linting, no doc field found
[ OK ] lint _build/http-multipart-formdata-v1.0.1 success

[-] Building package in _build/http-multipart-formdata-v1.0.1
dune-release: [EXEC:28171] ['true']
dune-release: [EXEC:28172] ['dune' 'build' '-p' 'http-multipart-formdata']
Done: 36/40 (jobs: 1)[ OK ] package builds

[-] Running package tests in _build/http-multipart-formdata-v1.0.1
dune-release: [EXEC:28193] ['true']
dune-release: [EXEC:28194] ['dune' 'runtest' '-p' 'http-multipart-formdata']
        test alias test/runtest
Testing `M'.
This run has ID `F916A940-2C87-4103-94D0-BFB9330AE66C'.

  [OK]          Single Values          0   file1.
  [OK]          Single Values          1   file2.
  [OK]          Single Values          2   file3.
  [OK]          Single Values          3   text1.
  [OK]          Single Values          4   text2.
  [OK]          Multi Values           0   file1.
  [OK]          Multi Values           1   text1.

Full test results in `~/github/http-mutlipart-formdata/_build/http-multipart-formdata-v1.0.1/_build/default/test/_build/_tests/M'.
Test Successful in 0.000s. 7 tests run.
Done: 21/23 (jobs: 1)[ OK ] package tests
dune-release: [EXEC:28210] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28211] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28212] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28213] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'HEAD^{commit}']

[+] Distribution for http-multipart-formdata 1.0.1
[+] Commit 33fc0bca7fd1966c0ac435b4d1f94742ad8cd480
[+] Archive _build/http-multipart-formdata-v1.0.1.tbz
dune-release: [EXEC:28214] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28215] ['git' '--git-dir' '.git' '--work-tree' './'
                            'status' '--porcelain']
dune-release: [INFO] Parsing opam file http-multipart-formdata.opam
[-] Skipping documentation publication for package http-multipart-formdata: no doc field in http-multipart-formdata.opam
[-] Publishing distribution
dune-release: [EXEC:28216] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28217] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
[-] Publishing to github
dune-release: [EXEC:28218] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28219] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28220] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28221] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28222] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28223] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'v1.0.1']
dune-release: [EXEC:28224] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28225] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:28226] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:28227] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'v1.0.1']
[?] Push tag v1.0.1 to [email protected]:lemaetech/http-mutlipart-formdata.git? [Y/n]
y
[-] Pushing tag v1.0.1 to [email protected]:lemaetech/http-mutlipart-formdata.git
dune-release: [EXEC:28256] ['git' '--git-dir' '.git' 'push' '--force'
                            '[email protected]:lemaetech/http-mutlipart-formdata.git'
                            'v1.0.1']
[?] Create release v1.0.1 on [email protected]:lemaetech/http-mutlipart-formdata.git? [Y/n]
y
[-] Creating release v1.0.1 on [email protected]:lemaetech/http-mutlipart-formdata.git via github's API
dune-release: [ERROR] Line 2, bytes 0-33:
  Invalid token 'HTTP/1.1 201 Created
  HTTP/1.1 20'

bikallem avatar Dec 04 '20 09:12 bikallem

It seems like this might be coming from curly's parsing. Which curl version are you running?

NathanReb avatar Dec 04 '20 09:12 NathanReb

It seems to be something else, could you run it with --dry-run -vvv please see if the error still shows up there?

NathanReb avatar Dec 04 '20 10:12 NathanReb

You can probably simply run dune-release publish distrib --dry-run -vvv btw, no need to run it all again from scratch!

NathanReb avatar Dec 04 '20 10:12 NathanReb

It seems to be something else, could you run it with --dry-run -vvv please see if the error still shows up there?

Yep it still does. Here is just the error bit.

[-] Creating release v1.0.1 on [email protected]:lemaetech/http-mutlipart-formdata.git via github's API
-: exec: curl --user lemaetech:${token} --location --silent --show-error
     --config - --dump-header - --data
     { "tag_name" : "v1.0.1", "body" : "CHANGES:\n\n- Fixes error prone equal - [#10](https://github.com/lemaetech/http-multipart-formdata/issues/10)\n" }
dune-release: [ERROR] Could not retrieve release ID from response

bikallem avatar Dec 04 '20 10:12 bikallem

I couldn't reproduce this error with the same data (I tried master and 1.4.0), I see you made a release 2 weeks ago did you create it by hand or did you manage to find what the problem was?

gpetiot avatar Dec 18 '20 15:12 gpetiot

I made the release by hand at that time. I tried it again with another package and it seems to work. Maybe it is something specific to that package.

bikallem avatar Dec 26 '20 16:12 bikallem

I'm getting a very similar issue. Having deleted release files and tags. I built the latest master and ran

 ../dune-release/_build/default/bin/main.exe publish --verbosity=debug distrib 2>&1 | tee err

The zipball and tar.gz were both uploaded. Then I got

main.exe: [ERROR] Line 2, bytes 0-33:
  Invalid token 'HTTP/1.1 201
  HTTP/1.1 201
  Ser'

I have also seen 422s as well but that may have been when I had existing releases and tags. Here's the full debug output:

main.exe: [INFO] dune-release %VERSION% running
[-] Publishing distribution
main.exe: [INFO] Parsing opam file jsonxt.opam
[-] Publishing to github
main.exe: [EXEC:10907] ['git' 'rev-parse' '--git-dir']
main.exe: [EXEC:10908] ['git' '--git-dir' '.git' '--work-tree' './'
                        'describe' '--always' 'HEAD']
main.exe: [EXEC:10909] ['git' 'rev-parse' '--git-dir']
main.exe: [EXEC:10910] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                        'v1.0.0']
main.exe: [EXEC:10911] ['git' 'rev-parse' '--git-dir']
main.exe: [EXEC:10912] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                        'v1.0.0']
main.exe: [EXEC:10913] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                        'v1.0.0^0']
main.exe: [EXEC:10914] ['git' '--git-dir' '.git' 'ls-remote' '--quiet'
                        '--tags'
                        'https://github.com/stevebleazard/ocaml-jsonxt.pre-release.git'
                        'v1.0.0']
[?] Push tag v1.0.0 to [email protected]:stevebleazard/ocaml-jsonxt.pre-release.git? [Y/n]
[-] Pushing tag v1.0.0 to [email protected]:stevebleazard/ocaml-jsonxt.pre-release.git
main.exe: [EXEC:10917] ['git' '--git-dir' '.git' 'push' '--force'
                        '[email protected]:stevebleazard/ocaml-jsonxt.pre-release.git'
                        'v1.0.0']
/home/steve/.config/dune/github.token does not exist!

To create a new token, please visit:

   https://github.com/settings/tokens/new

And create a token with a nice name and and the public_repo scope only.

Copy the token
here: main.exe: [DEBUG] [curl] executing request: { meth=GET;
                  url="https://api.github.com/repos/stevebleazard/ocaml-jsonxt/releases/tags/1.0.0";
                  headers=""; body="" }
main.exe: [DEBUG] [curl] with args: --user
                  stevebleazard:315cb281afa576981535fa81b3f156eeb71fe0b6
                  --location --silent --show-error --config - --dump-header -
main.exe: [DEBUG] [curl] response received: {code=301;
                  headers=X-GitHub-Request-Id: E8F2:A2FC:2A30212:2E8E57E:6032C11A

X-GitHub-Request-Id: E8F2:A2FC:2A30212:2E8E57E:6032C11A

Vary: Accept-Encoding, Accept, X-Requested-With

Vary: Accept-Encoding, Accept, X-Requested-With

Content-Security-Policy: default-src 'none'

Content-Security-Policy: default-src 'none'

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

X-XSS-Protection: 1; mode=block

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Frame-Options: deny

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Access-Control-Allow-Origin: *

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

x-ratelimit-used: 37

x-ratelimit-used: 37

X-RateLimit-Reset: 1613939798

X-RateLimit-Reset: 1613939798

X-RateLimit-Remaining: 4963

X-RateLimit-Remaining: 4963

X-RateLimit-Limit: 5000

X-RateLimit-Limit: 5000

X-GitHub-Media-Type: github.v3; format=json

X-GitHub-Media-Type: github.v3; format=json

Location: https://api.github.com/repositories/121134649/releases/tags/1.0.0

Location: https://api.github.com/repositories/121134649/releases/tags/1.0.0

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-OAuth-Scopes: repo, write:packages

X-OAuth-Scopes: repo, write:packages

Content-Length: 184

Content-Length: 184

Content-Type: application/json; charset=utf-8

Content-Type: application/json; charset=utf-8

Date: Sun, 21 Feb 2021 20:22:50 GMT

Date: Sun, 21 Feb 2021 20:22:50 GMT

Server: GitHub.com

HTTP/1.1 301
Server: GitHub.com
;
body="
HTTP/1.1 404
HTTP/1.1 404
Server: GitHub.com
Server: GitHub.com
Date: Sun, 21 Feb 2021 20:22:50 GMT
Date: Sun, 21 Feb 2021 20:22:50 GMT
Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
Content-Length: 126
Content-Length: 126
X-OAuth-Scopes: repo, write:packages
X-OAuth-Scopes: repo, write:packages
X-Accepted-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes: repo
X-GitHub-Media-Type: github.v3; format=json
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4962
X-RateLimit-Remaining: 4962
X-RateLimit-Reset: 1613939798
X-RateLimit-Reset: 1613939798
x-ratelimit-used: 38
x-ratelimit-used: 38
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: E8F2:A2FC:2A3022A:2E8E598:6032C11A
X-GitHub-Request-Id: E8F2:A2FC:2A3022A:2E8E598:6032C11A


{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-release-by-tag-name"
}
"}
[?] Create release 1.0.0 on https://github.com/stevebleazard/ocaml-jsonxt.pre-release.git? [Y/n]
[-] Creating release 1.0.0 on https://github.com/stevebleazard/ocaml-jsonxt.pre-release.git via github's API
main.exe: [DEBUG] [curl] executing request: { meth=POST;
                  url="https://api.github.com/repos/stevebleazard/ocaml-jsonxt/releases";
                  headers=""; body="" }
main.exe: [DEBUG] [curl] with args: --user
                  stevebleazard:315cb281afa576981535fa81b3f156eeb71fe0b6
                  --location --silent --show-error --config - --dump-header -
                  --data
                  {"tag_name":"v1.0.0","name":"1.0.0","body":"CHANGES:\n\n- Initial release\n"}
main.exe: [DEBUG] [curl] response received: {code=307;
                  headers=X-GitHub-Request-Id: E8F4:53A0:400C72F:4751843:6032C11E

X-GitHub-Request-Id: E8F4:53A0:400C72F:4751843:6032C11E

Vary: Accept-Encoding, Accept, X-Requested-With

Vary: Accept-Encoding, Accept, X-Requested-With

Content-Security-Policy: default-src 'none'

Content-Security-Policy: default-src 'none'

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

X-XSS-Protection: 1; mode=block

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Frame-Options: deny

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Access-Control-Allow-Origin: *

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

x-ratelimit-used: 39

x-ratelimit-used: 39

X-RateLimit-Reset: 1613939798

X-RateLimit-Reset: 1613939798

X-RateLimit-Remaining: 4961

X-RateLimit-Remaining: 4961

X-RateLimit-Limit: 5000

X-RateLimit-Limit: 5000

X-GitHub-Media-Type: github.v3; format=json

X-GitHub-Media-Type: github.v3; format=json

Location: https://api.github.com/repositories/121134649/releases

Location: https://api.github.com/repositories/121134649/releases

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-OAuth-Scopes: repo, write:packages

X-OAuth-Scopes: repo, write:packages

Content-Length: 173

Content-Length: 173

Content-Type: application/json; charset=utf-8

Content-Type: application/json; charset=utf-8

Date: Sun, 21 Feb 2021 20:22:54 GMT

Date: Sun, 21 Feb 2021 20:22:54 GMT

Server: GitHub.com

HTTP/1.1 307
Server: GitHub.com
;
body="
HTTP/1.1 201
HTTP/1.1 201
Server: GitHub.com
Server: GitHub.com
Date: Sun, 21 Feb 2021 20:22:54 GMT
Date: Sun, 21 Feb 2021 20:22:54 GMT
Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
Content-Length: 2057
Content-Length: 2057
Cache-Control: private, max-age=60, s-maxage=60
Cache-Control: private, max-age=60, s-maxage=60
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
ETag: "38ca557d2c99874ea9c2571ba757ea928c81689885fb0702945227ac903f2cf4"
ETag: "38ca557d2c99874ea9c2571ba757ea928c81689885fb0702945227ac903f2cf4"
X-OAuth-Scopes: repo, write:packages
X-OAuth-Scopes: repo, write:packages
X-Accepted-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes: repo
Location: https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38396699
Location: https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38396699
X-GitHub-Media-Type: github.v3; format=json
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4960
X-RateLimit-Remaining: 4960
X-RateLimit-Reset: 1613939798
X-RateLimit-Reset: 1613939798
x-ratelimit-used: 40
x-ratelimit-used: 40
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: E8F4:53A0:400C75D:4751876:6032C11E
X-GitHub-Request-Id: E8F4:53A0:400C75D:4751876:6032C11E


{
  "url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38396699",
  "assets_url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38396699/assets",
  "upload_url": "https://uploads.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38396699/assets{?name,label}",
  "html_url": "https://github.com/stevebleazard/ocaml-jsonxt.pre-release/releases/tag/v1.0.0",
  "id": 38396699,
  "author": {
    "login": "stevebleazard",
    "id": 24507968,
    "node_id": "MDQ6VXNlcjI0NTA3OTY4",
    "avatar_url": "https://avatars.githubusercontent.com/u/24507968?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/stevebleazard",
    "html_url": "https://github.com/stevebleazard",
    "followers_url": "https://api.github.com/users/stevebleazard/followers",
    "following_url": "https://api.github.com/users/stevebleazard/following{/other_user}",
    "gists_url": "https://api.github.com/users/stevebleazard/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/stevebleazard/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/stevebleazard/subscriptions",
    "organizations_url": "https://api.github.com/users/stevebleazard/orgs",
    "repos_url": "https://api.github.com/users/stevebleazard/repos",
    "events_url": "https://api.github.com/users/stevebleazard/events{/privacy}",
    "received_events_url": "https://api.github.com/users/stevebleazard/received_events",
    "type": "User",
    "site_admin": false
  },
  "node_id": "MDc6UmVsZWFzZTM4Mzk2Njk5",
  "tag_name": "v1.0.0",
  "target_commitish": "master",
  "name": "1.0.0",
  "draft": false,
  "prerelease": false,
  "created_at": "2021-02-21T17:22:15Z",
  "published_at": "2021-02-21T20:22:54Z",
  "assets": [

  ],
  "tarball_url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/tarball/v1.0.0",
  "zipball_url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/zipball/v1.0.0",
  "body": "CHANGES:\n\n- Initial release\n"
}
"}
main.exe: [ERROR] Line 2, bytes 0-33:
  Invalid token 'HTTP/1.1 201
  HTTP/1.1 201
  Ser'

stevebleazard avatar Feb 21 '21 20:02 stevebleazard

This might be another instance of a bug we've seen before where upgrading dune-release corrupts the github token. Deleting the token file and trying to re-release should work as dune-release will prompt you for the token again.

The token file is stored in $XDG_CONFIG_DIR/dune/github.token. If you're running a linux distribution it's most likely in ~/.config/dune/github.token. Please try deleting it and releasing again and let me know how that goes!

NathanReb avatar Feb 22 '21 09:02 NathanReb

To make sure everything was clean I deleted the token, created a new repo (with the same content except I updated the .opam file) and used the following steps:

  • dune-release tag
  • dune-release lint
  • dune-release distrib
  • dune-release publish distrib

I still got the same error. Here's the jsonxt.opam file:

opam-version: "1.2"
maintainer: "Steve Bleazard <[email protected]>"
authors: "Steve Bleazard <[email protected]>"
homepage: "https://github.com/stevebleazard/ocaml-jsonxt.test"
bug-reports: "https://github.com/stevebleazard/ocaml-jsonxt/issues"
license: "MIT"
dev-repo: "[email protected]:stevebleazard/ocaml-jsonxt.test.git"
doc: "https://stevebleazard.github.io/ocaml-jsonxt.test"
synopsis: "JSON parsers parsers for string, files and more"
build: [
  ["dune" "subst"] {pinned}
  ["dune" "build" "-p" name "-j" jobs]
  ["dune" "build" "-p" name "-j" jobs "@runtest"] {with-test}
  ["dune" "build" "-p" name "-j" jobs "@doc"] {with-doc}
]

depends: [
  "ocaml"               {>= "4.03.0"}
  "dune"                {build}
  "alcotest"            {with-test}
  "cmdliner"            {with-test}
  "core_kernel"         {with-test}
  "fmt"                 {with-test}
  "ppx_sexp_conv"       {with-test}
]

Let me know if there is anything I can do to help track this down.

stevebleazard avatar Feb 22 '21 10:02 stevebleazard

After re-creating the test repo and re-running I get the 422 error. In this case I tagged with a version of 1.0.0

../dune-release/_build/default/bin/main.exe publish distrib --verbosity=debug
main.exe: [INFO] dune-release %VERSION% running
[-] Publishing distribution
main.exe: [INFO] Parsing opam file jsonxt.opam
[-] Publishing to github
main.exe: [EXEC:12274] ['git' 'rev-parse' '--git-dir']
main.exe: [EXEC:12275] ['git' '--git-dir' '.git' '--work-tree' './'
                        'describe' '--always' 'HEAD']
main.exe: [EXEC:12276] ['git' 'rev-parse' '--git-dir']
main.exe: [EXEC:12277] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                        '1.0.0']
main.exe: [EXEC:12278] ['git' 'rev-parse' '--git-dir']
main.exe: [EXEC:12279] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                        '1.0.0']
main.exe: [EXEC:12280] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                        '1.0.0^0']
main.exe: [EXEC:12281] ['git' '--git-dir' '.git' 'ls-remote' '--quiet'
                        '--tags'
                        'https://github.com/stevebleazard/ocaml-jsonxt.test.git'
                        '1.0.0']
[?] Push tag 1.0.0 to [email protected]:stevebleazard/ocaml-jsonxt.test.git? [Y/n]
[-] Pushing tag 1.0.0 to [email protected]:stevebleazard/ocaml-jsonxt.test.git
main.exe: [EXEC:12284] ['git' '--git-dir' '.git' 'push' '--force'
                        '[email protected]:stevebleazard/ocaml-jsonxt.test.git'
                        '1.0.0']
main.exe: [DEBUG] [curl] executing request: { meth=GET;
                  url="https://api.github.com/repos/stevebleazard/ocaml-jsonxt/releases/tags/1.0.0";
                  headers=""; body="" }
main.exe: [DEBUG] [curl] with args: --user
                  stevebleazard:6186b188ee9d871d5a206e70cdadaff2901d2481
                  --location --silent --show-error --config - --dump-header -
main.exe: [DEBUG] [curl] response received: {code=301;
                  headers=X-GitHub-Request-Id: 9E22:53A0:569959D:6070E9E:6033A640

X-GitHub-Request-Id: 9E22:53A0:569959D:6070E9E:6033A640

Vary: Accept-Encoding, Accept, X-Requested-With

Vary: Accept-Encoding, Accept, X-Requested-With

Content-Security-Policy: default-src 'none'

Content-Security-Policy: default-src 'none'

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

X-XSS-Protection: 1; mode=block

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Frame-Options: deny

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Access-Control-Allow-Origin: *

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

x-ratelimit-used: 3

x-ratelimit-used: 3

X-RateLimit-Reset: 1614000971

X-RateLimit-Reset: 1614000971

X-RateLimit-Remaining: 4997

X-RateLimit-Remaining: 4997

X-RateLimit-Limit: 5000

X-RateLimit-Limit: 5000

X-GitHub-Media-Type: github.v3; format=json

X-GitHub-Media-Type: github.v3; format=json

Location: https://api.github.com/repositories/121134649/releases/tags/1.0.0

Location: https://api.github.com/repositories/121134649/releases/tags/1.0.0

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-OAuth-Scopes: public_repo

X-OAuth-Scopes: public_repo

Content-Length: 184

Content-Length: 184

Content-Type: application/json; charset=utf-8

Content-Type: application/json; charset=utf-8

Date: Mon, 22 Feb 2021 12:40:32 GMT

Date: Mon, 22 Feb 2021 12:40:32 GMT

Server: GitHub.com

HTTP/1.1 301
Server: GitHub.com
;
body="
HTTP/1.1 200
HTTP/1.1 200
Server: GitHub.com
Server: GitHub.com
Date: Mon, 22 Feb 2021 12:40:32 GMT
Date: Mon, 22 Feb 2021 12:40:32 GMT
Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
Content-Length: 2050
Content-Length: 2050
Cache-Control: private, max-age=60, s-maxage=60
Cache-Control: private, max-age=60, s-maxage=60
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
ETag: "e27e146adc8e000be31442ba5fd5489be1d52c41526a99ccb0fd3785315c30a4"
ETag: "e27e146adc8e000be31442ba5fd5489be1d52c41526a99ccb0fd3785315c30a4"
last-modified: Thu, 01 Jan 1970 00:00:00 GMT
last-modified: Thu, 01 Jan 1970 00:00:00 GMT
X-OAuth-Scopes: public_repo
X-OAuth-Scopes: public_repo
X-Accepted-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes: repo
X-GitHub-Media-Type: github.v3; format=json
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4996
X-RateLimit-Remaining: 4996
X-RateLimit-Reset: 1614000971
X-RateLimit-Reset: 1614000971
x-ratelimit-used: 4
x-ratelimit-used: 4
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: 9E22:53A0:56995E9:6070EDF:6033A640
X-GitHub-Request-Id: 9E22:53A0:56995E9:6070EDF:6033A640


{
  "url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38421959",
  "assets_url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38421959/assets",
  "upload_url": "https://uploads.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/releases/38421959/assets{?name,label}",
  "html_url": "https://github.com/stevebleazard/ocaml-jsonxt.pre-release/releases/tag/1.0.0",
  "id": 38421959,
  "author": {
    "login": "stevebleazard",
    "id": 24507968,
    "node_id": "MDQ6VXNlcjI0NTA3OTY4",
    "avatar_url": "https://avatars.githubusercontent.com/u/24507968?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/stevebleazard",
    "html_url": "https://github.com/stevebleazard",
    "followers_url": "https://api.github.com/users/stevebleazard/followers",
    "following_url": "https://api.github.com/users/stevebleazard/following{/other_user}",
    "gists_url": "https://api.github.com/users/stevebleazard/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/stevebleazard/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/stevebleazard/subscriptions",
    "organizations_url": "https://api.github.com/users/stevebleazard/orgs",
    "repos_url": "https://api.github.com/users/stevebleazard/repos",
    "events_url": "https://api.github.com/users/stevebleazard/events{/privacy}",
    "received_events_url": "https://api.github.com/users/stevebleazard/received_events",
    "type": "User",
    "site_admin": false
  },
  "node_id": "MDc6UmVsZWFzZTM4NDIxOTU5",
  "tag_name": "1.0.0",
  "target_commitish": "master",
  "name": null,
  "draft": false,
  "prerelease": false,
  "created_at": "2021-02-22T09:05:04Z",
  "published_at": "2021-02-22T12:36:11Z",
  "assets": [

  ],
  "tarball_url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/tarball/1.0.0",
  "zipball_url": "https://api.github.com/repos/stevebleazard/ocaml-jsonxt.pre-release/zipball/1.0.0",
  "body": "CHANGES:\n\n- Initial release\n"
}
"}
[?] Create release 1.0.0 on https://github.com/stevebleazard/ocaml-jsonxt.test.git? [Y/n]
[-] Creating release 1.0.0 on https://github.com/stevebleazard/ocaml-jsonxt.test.git via github's API
main.exe: [DEBUG] [curl] executing request: { meth=POST;
                  url="https://api.github.com/repos/stevebleazard/ocaml-jsonxt/releases";
                  headers=""; body="" }
main.exe: [DEBUG] [curl] with args: --user
                  stevebleazard:6186b188ee9d871d5a206e70cdadaff2901d2481
                  --location --silent --show-error --config - --dump-header -
                  --data
                  {"tag_name":"1.0.0","name":"1.0.0","body":"CHANGES:\n\n- Initial release\n"}
main.exe: [DEBUG] [curl] response received: {code=307;
                  headers=X-GitHub-Request-Id: 9E24:ED2E:30742A0:35D59EB:6033A65B

X-GitHub-Request-Id: 9E24:ED2E:30742A0:35D59EB:6033A65B

Vary: Accept-Encoding, Accept, X-Requested-With

Vary: Accept-Encoding, Accept, X-Requested-With

Content-Security-Policy: default-src 'none'

Content-Security-Policy: default-src 'none'

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

X-XSS-Protection: 1; mode=block

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Frame-Options: deny

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Access-Control-Allow-Origin: *

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

x-ratelimit-used: 5

x-ratelimit-used: 5

X-RateLimit-Reset: 1614000971

X-RateLimit-Reset: 1614000971

X-RateLimit-Remaining: 4995

X-RateLimit-Remaining: 4995

X-RateLimit-Limit: 5000

X-RateLimit-Limit: 5000

X-GitHub-Media-Type: github.v3; format=json

X-GitHub-Media-Type: github.v3; format=json

Location: https://api.github.com/repositories/121134649/releases

Location: https://api.github.com/repositories/121134649/releases

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-Accepted-OAuth-Scopes: admin:repo_hook, delete_repo, read:repo_hook, repo, repo:status, repo_deployment, security_events, write:repo_hook

X-OAuth-Scopes: public_repo

X-OAuth-Scopes: public_repo

Content-Length: 173

Content-Length: 173

Content-Type: application/json; charset=utf-8

Content-Type: application/json; charset=utf-8

Date: Mon, 22 Feb 2021 12:40:59 GMT

Date: Mon, 22 Feb 2021 12:40:59 GMT

Server: GitHub.com

HTTP/1.1 307
Server: GitHub.com
;
body="
HTTP/1.1 422
HTTP/1.1 422
Server: GitHub.com
Server: GitHub.com
Date: Mon, 22 Feb 2021 12:40:59 GMT
Date: Mon, 22 Feb 2021 12:40:59 GMT
Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
Content-Length: 243
Content-Length: 243
X-OAuth-Scopes: public_repo
X-OAuth-Scopes: public_repo
X-Accepted-OAuth-Scopes: repo
X-Accepted-OAuth-Scopes: repo
X-GitHub-Media-Type: github.v3; format=json
X-GitHub-Media-Type: github.v3; format=json
X-RateLimit-Limit: 5000
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4994
X-RateLimit-Remaining: 4994
X-RateLimit-Reset: 1614000971
X-RateLimit-Reset: 1614000971
x-ratelimit-used: 6
x-ratelimit-used: 6
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: 9E24:ED2E:30742D1:35D5A28:6033A65B
X-GitHub-Request-Id: 9E24:ED2E:30742D1:35D5A28:6033A65B


{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
"}
main.exe: [ERROR] Line 2, bytes 0-33:
  Invalid token 'HTTP/1.1 422
  HTTP/1.1 422
  Ser'

stevebleazard avatar Feb 22 '21 13:02 stevebleazard

It looks like github has weird behaviour when the name contains a dot, So when I deployed to jsonxt.test, it appeared in the jsonxt.pre-release repo, possible as well as jsonxt.test. I also see the extension (.test for example) being removed in some cases in the logging.

Replacing the dot with a hyphen and re-releasing using the master branch of dune-release and it worked. I will try to replicate again with master and then with the current release

stevebleazard avatar Feb 22 '21 21:02 stevebleazard

The issue appears to be caused by dots in the repo name. Removing the dots and everything worked as expected

stevebleazard avatar Feb 26 '21 12:02 stevebleazard

Hi, there have been improvements to the inference of user and repo from the uri in #348, do you observe this same issue (with the original repo name) since this has been merged into master?

(I quickly wrote some unit test locally and Pkg.user_and_repo_from_uri https://github.com/stevebleazard/ocaml-jsonxt.test.git is able to infer ("stevebleazard", "ocaml-jsonxt.test"))

gpetiot avatar Feb 26 '21 13:02 gpetiot

Let me run some tests and update the ticket, I'm not even sure this is a dune-release issue as when I was testing with jsonxt.test some of the debug output referred to jsonxt.pre-release (see last debug output).

stevebleazard avatar Feb 27 '21 12:02 stevebleazard

Testing

  • Cloned and built the master branch of dune-release
  • Created a new testrepo.test
  • Added files to the repo and commit/pushed
  • tag release: ../dune-release/_build/install/default/bin/dune-release tag
  • build the distrib: ../dune-release/_build/install/default/bin/dune-release distrib
  • try to publish: ../dune-release/_build/install/default/bin/dune-release publish distrib
-bash-4.2$ ../dune-release/_build/install/default/bin/dune-release publish distrib --verbosity=debug 2>&1 | tee /tmp/test.err
dune-release: [INFO] dune-release %VERSION% running
[-] Publishing distribution
dune-release: [INFO] Parsing opam file jsonxt.opam
[-] Publishing to github
dune-release: [EXEC:12228] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:12229] ['git' '--git-dir' '.git' '--work-tree' './'
                            'describe' '--always' 'HEAD']
dune-release: [EXEC:12230] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:12231] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'v1.0.0']
dune-release: [EXEC:12232] ['git' 'rev-parse' '--git-dir']
dune-release: [EXEC:12233] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'v1.0.0']
dune-release: [EXEC:12234] ['git' '--git-dir' '.git' 'rev-parse' '--verify'
                            'v1.0.0^0']
dune-release: [EXEC:12235] ['git' '--git-dir' '.git' 'ls-remote' '--quiet'
                            '--tags'
                            'https://github.com/stevebleazard/testrepo.test.git'
                            'v1.0.0']
[?] Push tag v1.0.0 to [email protected]:stevebleazard/testrepo.test.git? [Y/n]

[-] Pushing tag v1.0.0 to [email protected]:stevebleazard/testrepo.test.git
dune-release: [EXEC:12239] ['git' '--git-dir' '.git' 'push' '--force'
                            '[email protected]:stevebleazard/testrepo.test.git'
                            'v1.0.0']
dune-release: [DEBUG] [curl] executing request: { meth=GET;
                      url="https://api.github.com/repos/stevebleazard/testrepo/releases/tags/1.0.0";
                      headers=""; body="" }
dune-release: [DEBUG] [curl] with args: --user
                      stevebleazard:ca48b64afb67a342c711b8aaaa546b9889e3c14f
                      --location --silent --show-error --config -
                      --dump-header -
dune-release: [DEBUG] [curl] response received: {code=404;
                      headers=X-GitHub-Request-Id: EC4C:10B0:3F4CB0:461E8A:603A7306

X-GitHub-Request-Id: EC4C:10B0:3F4CB0:461E8A:603A7306

Vary: Accept-Encoding, Accept, X-Requested-With

Vary: Accept-Encoding, Accept, X-Requested-With

Content-Security-Policy: default-src 'none'

Content-Security-Policy: default-src 'none'

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

X-XSS-Protection: 1; mode=block

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Frame-Options: deny

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Access-Control-Allow-Origin: *

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

x-ratelimit-used: 1

x-ratelimit-used: 1

X-RateLimit-Reset: 1614446870

X-RateLimit-Reset: 1614446870

X-RateLimit-Remaining: 4999

X-RateLimit-Remaining: 4999

X-RateLimit-Limit: 5000

X-RateLimit-Limit: 5000

X-GitHub-Media-Type: github.v3; format=json

X-GitHub-Media-Type: github.v3; format=json

X-Accepted-OAuth-Scopes: repo

X-Accepted-OAuth-Scopes: repo

X-OAuth-Scopes: public_repo

X-OAuth-Scopes: public_repo

Content-Length: 126

Content-Length: 126

Content-Type: application/json; charset=utf-8

Content-Type: application/json; charset=utf-8

Date: Sat, 27 Feb 2021 16:27:50 GMT

Date: Sat, 27 Feb 2021 16:27:50 GMT

Server: GitHub.com

HTTP/1.1 404
Server: GitHub.com
;
body="
{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-release-by-tag-name"
}
"}
[?] Create release 1.0.0 on https://github.com/stevebleazard/testrepo.test.git? [Y/n]

[-] Creating release 1.0.0 on https://github.com/stevebleazard/testrepo.test.git via github's API
dune-release: [DEBUG] [curl] executing request: { meth=POST;
                      url="https://api.github.com/repos/stevebleazard/testrepo/releases";
                      headers=""; body="" }
dune-release: [DEBUG] [curl] with args: --user
                      stevebleazard:ca48b64afb67a342c711b8aaaa546b9889e3c14f
                      --location --silent --show-error --config -
                      --dump-header - --data
                      {"tag_name":"v1.0.0","name":"1.0.0","body":"CHANGES:\n\n- Initial release\n"}
dune-release: [DEBUG] [curl] response received: {code=404;
                      headers=X-GitHub-Request-Id: EC4E:10C41:112F696:11B1E80:603A730B

X-GitHub-Request-Id: EC4E:10C41:112F696:11B1E80:603A730B

Vary: Accept-Encoding, Accept, X-Requested-With

Vary: Accept-Encoding, Accept, X-Requested-With

Content-Security-Policy: default-src 'none'

Content-Security-Policy: default-src 'none'

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin

X-XSS-Protection: 1; mode=block

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff

X-Frame-Options: deny

X-Frame-Options: deny

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Strict-Transport-Security: max-age=31536000; includeSubdomains; preload

Access-Control-Allow-Origin: *

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset

x-ratelimit-used: 2

x-ratelimit-used: 2

X-RateLimit-Reset: 1614446870

X-RateLimit-Reset: 1614446870

X-RateLimit-Remaining: 4998

X-RateLimit-Remaining: 4998

X-RateLimit-Limit: 5000

X-RateLimit-Limit: 5000

X-GitHub-Media-Type: github.v3; format=json

X-GitHub-Media-Type: github.v3; format=json

X-Accepted-OAuth-Scopes: repo

X-Accepted-OAuth-Scopes: repo

X-OAuth-Scopes: public_repo

X-OAuth-Scopes: public_repo

Content-Length: 117

Content-Length: 117

Content-Type: application/json; charset=utf-8

Content-Type: application/json; charset=utf-8

Date: Sat, 27 Feb 2021 16:27:55 GMT

Date: Sat, 27 Feb 2021 16:27:55 GMT

Server: GitHub.com

HTTP/1.1 404
Server: GitHub.com
;
body="
{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
"}
dune-release: [ERROR] Github API error:
    Could not retrieve release ID from response
    Github API returned: "Not Found"
    See the documentation "https://docs.github.com/rest/reference/repos#create-a-release" that might help you resolve this error.

Looking at the debug it looks like one of the curl statements is using testrepo and not testrepo.test:

dune-release: [DEBUG] [curl] executing request: { meth=POST;
                      url="https://api.github.com/repos/stevebleazard/testrepo/releases";
                      headers=""; body="" }
dune-release: [DEBUG] [curl] with args: --user
                      stevebleazard:ca48b64afb67a342c711b8aaaa546b9889e3c14f
                      --location --silent --show-error --config -
                      --dump-header - --data
                      {"tag_name":"v1.0.0","name":"1.0.0","body":"CHANGES:\n\n- Initial release\n"}
dune-release: [DEBUG] [curl] response received: {code=404;
                      headers=X-GitHub-Request-Id: EC4E:10C41:112F696:11B1E80:603A730B

stevebleazard avatar Feb 27 '21 17:02 stevebleazard

FYI @stevebleazard there's your token in that trace. I would advise revoking it (if github's token scrubbing didn't already find it)

emillon avatar Mar 03 '21 10:03 emillon

FYI @stevebleazard there's your token in that trace. I would advise revoking it (if github's token scrubbing didn't already find it)

Thanks, I've been revoking the tokens after each debug session

stevebleazard avatar Mar 03 '21 14:03 stevebleazard