Git Product home page Git Product logo

Comments (8)

rktjmp avatar rktjmp commented on July 20, 2024

I initially tired to get some better logging out, but never got anything useful: neovim/neovim#15709 (comment)

In the process of adding a retry loop to the releaser, I did see an new error I hadn't seen before. Whether this is the actual cause or just another issue (too many retries in a short period?) We see the error now because removed errexit from the shebang so retries could be attempted.

https://github.com/rktjmp/neovim/runs/3913719270?check_suite_focus=true

 {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
  }
  Notice: Attempt asset curl request
  Notice: Asset upload success
  {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
  }
  Notice: Attempt asset curl request
  Notice: Asset upload success
  {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
  }
  Notice: Attempt asset curl request
  Notice: Asset upload success
  {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
  }
  Notice: Attempt asset curl request
  Notice: Asset upload success
  {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-release-asset"
  }
  Notice: Attempt asset curl request
  curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104
  Notice: Asset curl failed, status: 0, retry: 2
  Notice: Attempt asset curl request
  Notice: Asset curl failed, status: 0, retry: 1
  Notice: Attempt asset curl request
  curl: (56) Connection died, tried 5 times before giving up
  Error: failed to upload asset: nvim-win32.zip (see log for details)
  Notice: Asset curl failed, status: 0, retry: 0
  
  	ERR: Failed asset upload: nvim-win32.zip
  {
    "message": "Validation Failed",
    "request_id": "0401:3483:AE1C1A:1041AF3:616AB0F0",
    "documentation_url": "https://docs.github.com/rest",
    "errors": [
      {
        "resource": "ReleaseAsset",
        "code": "already_exists",
        "field": "name"
      }
    ]
  }

from github-release.

glacambre avatar glacambre commented on July 20, 2024

@rktjmp Sounds like you should break the loop on success?
https://github.com/rktjmp/github-release/blob/6d6369dbbc75cbecf1dcbfa6cee2952a57b0a6bf/entrypoint.sh#L242-L251

from github-release.

rktjmp avatar rktjmp commented on July 20, 2024

I set attempts to 0 to break it.

from github-release.

glacambre avatar glacambre commented on July 20, 2024

Oh, right, sorry 🤦.

from github-release.

rktjmp avatar rktjmp commented on July 20, 2024

The repeated messages you see are for the other assets (osx, linux, etc).

from github-release.

rktjmp avatar rktjmp commented on July 20, 2024

It seems that:

  • Curl makes an asset upload post request
  • This can result in an SSL error and/or connection reset which means we can't retrieve the status response code to infer success or failure.
  • The curl request does actually create an asset object in githubs system
  • The repeat retry attempt now fails with an actual error ("asset_exists") because of the previously reset request.

(Run with extra logging). You can see:

  • At the start, the assets for a release (id: 51474687) before uploading are empty:
  Notice: 51474687
  Notice: null
  Notice: [
  ]
  • A request is terminated for some reason (uploading macos asset)
Notice: Attempt asset nvim-macos.tar.gz curl request
  curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104
  Notice: Asset nvim-macos.tar.gz curl failed, status: 0, retry: 2
  Notice: failed to upload asset: nvim-macos.tar.gz (see log for details)
  • We detect that we got no status code, and check the assets for the release before retrying:
  Notice: [
    {
      "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47137459",
      "id": 47137459,
      "node_id": "RA_kwDOEqgIoM4Cz0Kz",
      "name": "nvim-linux64.tar.gz",
      ...
    },
    {
      "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47137460",
      "id": 47137460,
      "node_id": "RA_kwDOEqgIoM4Cz0K0",
      "name": "nvim-linux64.tar.gz.sha256sum",
      ...
    },
    {
      "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47137461",
      "id": 47137461,
      "node_id": "RA_kwDOEqgIoM4Cz0K1",
      "name": "nvim-macos.tar.gz",
      "label": "",
      "uploader": {
      },
      "content_type": "application/gzip",
      "state": "starter",
      "size": 9380438,
      "download_count": 0,
      "created_at": "2021-10-16T13:10:55Z",
      "updated_at": "2021-10-16T13:10:55Z",
      "browser_download_url": "https://github.com/rktjmp/neovim/releases/download/untagged-fc52a563814c7911925d/nvim-macos.tar.gz"
    }
  ]

As you can see, the asset object exists in some form now.

  • Since the curl request never gave a response, we re-attempt to upload and hit the "asset_exists" error:
  Notice: Attempt asset nvim-macos.tar.gz curl request
  Notice: failed to upload asset: nvim-macos.tar.gz (see log for details)
  
  	ERR: Failed asset upload: nvim-macos.tar.gz
  Notice: Asset nvim-macos.tar.gz curl failed, status: 0, retry: 1
  {
    "message": "Validation Failed",
    "request_id": "0400:6086:1189931:171F3D2:616ACF64",
    "documentation_url": "https://docs.github.com/rest",
    "errors": [
      {
        "resource": "ReleaseAsset",
        "code": "already_exists",
        "field": "name"
      }
    ]
  }

You can see the asset has a state of starter, vs uploaded. I can't see from that log whether the upload actually completed (9380438 bytes).

I will see about attempting to delete the asset before retrying.

I wonder if it could at all be related to a mismatch in the content-length header somehow, though that seems unlikely (-H "Content-Length: $(stat -c %s "$asset")" seems hard to mess up).

Edit:

I also noticed some requests return a 422, log though that run did not include the output from the request, attempting to retrigger the error...

2021-10-16T21:07:33.0145849Z ##[notice]Attempt asset nvim-linux64.tar.gz curl request
2021-10-16T21:07:33.0172238Z + file -b --mime-type /github/home/assets/nvim-linux64.tar.gz
2021-10-16T21:07:33.0182836Z + curl -sS -X POST --write-out '%{http_code}' -o /tmp/tmp.giOaml/nvim-linux64.tar.gz.json -H 'Authorization: token ***' -H 'Content-Length: 14380825' -H 'Content-Type: application/gzip' --upload-file /github/home/assets/nvim-linux64.tar.gz 'https://uploads.github.com/repos/rktjmp/neovim/releases/51482179/assets?name=nvim-linux64.tar.gz'
2021-10-16T21:07:33.5058356Z + status_code=422
2021-10-16T21:07:33.5059141Z + return 422
2021-10-16T21:07:33.5060509Z + '[' 166 '=' 201 ]

I did notice an error in the check against existing assets, which was causing basically delete /release/asset/null instead of a correct ID. After fixing that I have had two successful builds in a row after a long string of failures... Maybe the token was getting invalidated after making too many poor requests ...? It's very blackbox.

from github-release.

rktjmp avatar rktjmp commented on July 20, 2024

So, we now delete the failed upload (which actually is complete by the byte size), but it just continuously resets the connection for a particular file. Seems like something about a file just turns github sour and that's that until you re-build?

See:

  • Uploading nvim-win32.zip, connection resets
2021-10-17T04:18:30.0436373Z + curl -sS -X POST --write-out '%{http_code}' -o /tmp/tmp.EAMoHP/nvim-win32.zip.json -H 'Authorization: token ***' -H 'Content-Length: 33565152' -H 'Content-Type: application/zip' --upload-file /github/home/assets/nvim-win32.zip 'https://uploads.github.com/repos/rktjmp/neovim/releases/51487427/assets?name=nvim-win32.zip'
99Z curl: (55) OpenSSL SSL_write: Connection reset by peer, errno 104
2021-10-17T04:18:30.2443817Z ##[notice]Asset nvim-win32.zip curl failed, status: 0, retry: 1
2021-10-17T04:18:30.2448411Z + status_code=000
2021-10-17T04:18:30.2448795Z + return 000
2021-10-17T04:18:30.2449666Z + '[' 0 '=' 201 ]
2021-10-17T04:18:30.2450052Z + attempts=1
2021-10-17T04:18:30.2451119Z + echo '::notice::Asset nvim-win32.zip curl failed, status: 0, retry: 1'
2021-10-17T04:18:30.2452372Z + echo '::notice::failed to upload asset: nvim-win32.zip (see log for details)'
2021-10-17T04:18:30.2455304Z ##[notice]failed to upload asset: nvim-win32.zip (see log for details)
2021-10-17T04:18:30.2457358Z + printf '\n\tERR: Failed asset upload: %s\n' nvim-win32.zip
2021-10-17T04:18:30.2457816Z 
2021-10-17T04:18:30.2458469Z 	ERR: Failed asset upload: nvim-win32.zip
2021-10-17T04:18:30.2459531Z /entrypoint.sh: line 258: can't open /tmp/tmp.EAMoHP/nvim-win32.zip.json: no such file
  • We get the current assets after this failure
    • note: before we even start uploading we delete any previous assets, so this isn't a "left over" from a previous release.
2021-10-17T04:18:30.2460346Z + gh_release_api 51487427/assets
2021-10-17T04:18:30.2460805Z + url=51487427/assets
2021-10-17T04:18:30.2461188Z + method=GET
  • it returns json containing nvim-win32.zip, so we must delete this to re-try uploading (see previous comments).
    • note: it's actually "complete", in that it has the whole byte size as seen by the curl content-length header set by stat -c %s, but the internal state tracked by github is "starter", not "uploaded", so they don't consider it complete (?).
2021-10-17T04:18:30.2463293Z + curl -sS -H 'Authorization: token ***' -X GET https://api.github.com/repos/rktjmp/neovim/releases/51487427/assets
2021-10-17T04:18:30.4009058Z + resp='[
2021-10-17T04:18:30.4009999Z   {
2021-10-17T04:18:30.4011268Z     "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47173976",
2021-10-17T04:18:30.4011983Z     "id": 47173976,
2021-10-17T04:18:30.4012447Z     "node_id": "RA_kwDOEqgIoM4Cz9FY",
2021-10-17T04:18:30.4013304Z     "name": "nvim-linux64.tar.gz",
2021-10-17T04:18:30.4045567Z   },
2021-10-17T04:18:30.4045905Z   {
2021-10-17T04:18:30.4046561Z     "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47173978",
2021-10-17T04:18:30.4047239Z     "id": 47173978,
2021-10-17T04:18:30.4048189Z     "node_id": "RA_kwDOEqgIoM4Cz9Fa",
2021-10-17T04:18:30.4049490Z     "name": "nvim-linux64.tar.gz.sha256sum",
2021-10-17T04:18:30.4072894Z     "state": "uploaded",
2021-10-17T04:18:30.4077994Z   },
2021-10-17T04:18:30.4078319Z   {
2021-10-17T04:18:30.4079139Z     "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47173979",
2021-10-17T04:18:30.4079833Z     "id": 47173979,
2021-10-17T04:18:30.4081057Z     "node_id": "RA_kwDOEqgIoM4Cz9Fb",
2021-10-17T04:18:30.4082101Z     "name": "nvim-macos.tar.gz",
2021-10-17T04:18:30.4117898Z     "state": "uploaded",
2021-10-17T04:18:30.4123460Z   },
2021-10-17T04:18:30.4124111Z   {
2021-10-17T04:18:30.4124807Z     "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47174000",
2021-10-17T04:18:30.4125488Z     "id": 47174000,
2021-10-17T04:18:30.4125968Z     "node_id": "RA_kwDOEqgIoM4Cz9Fw",
2021-10-17T04:18:30.4126879Z     "name": "nvim-macos.tar.gz.sha256sum",
2021-10-17T04:18:30.4165576Z   },
2021-10-17T04:18:30.4165883Z   {
2021-10-17T04:18:30.4166559Z     "url": "https://api.github.com/repos/rktjmp/neovim/releases/assets/47174008",
2021-10-17T04:18:30.4167223Z     "id": 47174008,
2021-10-17T04:18:30.4167710Z     "node_id": "RA_kwDOEqgIoM4Cz9F4",
2021-10-17T04:18:30.4168466Z     "name": "nvim-win32.zip",
2021-10-17T04:18:30.4168923Z     "label": "",
2021-10-17T04:18:30.4169329Z     "uploader": {
2021-10-17T04:18:30.4169968Z       "login": "github-actions[bot]",
2021-10-17T04:18:30.4170978Z       "id": 41898282,
2021-10-17T04:18:30.4171473Z       "node_id": "MDM6Qm90NDE4OTgyODI=",
2021-10-17T04:18:30.4172446Z       "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
2021-10-17T04:18:30.4173288Z       "gravatar_id": "",
2021-10-17T04:18:30.4179442Z       "url": "https://api.github.com/users/github-actions%5Bbot%5D",
2021-10-17T04:18:30.4181065Z       "html_url": "https://github.com/apps/github-actions",
2021-10-17T04:18:30.4182321Z       "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
2021-10-17T04:18:30.4184047Z       "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
2021-10-17T04:18:30.4185386Z       "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
2021-10-17T04:18:30.4186733Z       "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
2021-10-17T04:18:30.4188805Z       "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
2021-10-17T04:18:30.4190495Z       "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
2021-10-17T04:18:30.4192256Z       "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
2021-10-17T04:18:30.4193569Z       "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
2021-10-17T04:18:30.4194989Z       "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
2021-10-17T04:18:30.4195808Z       "type": "Bot",
2021-10-17T04:18:30.4196220Z       "site_admin": false
2021-10-17T04:18:30.4196616Z     },
2021-10-17T04:18:30.4197061Z     "content_type": "application/zip",
2021-10-17T04:18:30.4197582Z     "state": "starter",
2021-10-17T04:18:30.4197994Z     "size": 33565152,
2021-10-17T04:18:30.4198388Z     "download_count": 0,
2021-10-17T04:18:30.4199590Z     "created_at": "2021-10-17T04:18:30Z",
2021-10-17T04:18:30.4200225Z     "updated_at": "2021-10-17T04:18:30Z",
2021-10-17T04:18:30.4202177Z     "browser_download_url": "https://github.com/rktjmp/neovim/releases/download/untagged-bc87fcc745a503c31a88/nvim-win32.zip"
2021-10-17T04:18:30.4203132Z   }
2021-10-17T04:18:30.4203693Z ]'
  • delete the asset
2021-10-17T04:18:30.4585723Z + asset_id=47174008
2021-10-17T04:18:30.4589015Z ##[notice]Attempt to get asset id of partial upload (may or may not exist): 47174008
2021-10-17T04:18:30.4594513Z + echo '::notice::Attempt to get asset id of partial upload (may or may not exist): 47174008'
2021-10-17T04:18:30.4596374Z + '[' -n 47174008 ]
2021-10-17T04:18:30.4598399Z ##[notice]Attempt asset delete
2021-10-17T04:18:30.4601525Z + echo '::notice::Attempt asset delete'
2021-10-17T04:18:30.4602420Z + gh_release_api assets/47174008 DELETE
2021-10-17T04:18:30.4603076Z + url=assets/47174008
2021-10-17T04:18:30.4603647Z + method=DELETE
2021-10-17T04:18:30.4606243Z + curl -sS -H 'Authorization: token ***' -X DELETE https://api.github.com/repos/rktjmp/neovim/releases/assets/47174008
2021-10-17T04:18:30.6477373Z + sleep 5
  • retry upload
2021-10-17T04:18:35.6490950Z + '[' 1 -gt 0 ]
2021-10-17T04:18:35.6494422Z ##[notice]Attempt asset nvim-win32.zip curl request
2021-10-17T04:18:35.6522318Z + upload_asset
2021-10-17T04:18:35.6524429Z + echo '::notice::Attempt asset nvim-win32.zip curl request'
2021-10-17T04:18:35.6526256Z + stat -c '%s' /github/home/assets/nvim-win32.zip
2021-10-17T04:18:35.6528279Z + file -b --mime-type /github/home/assets/nvim-win32.zip
2021-10-17T04:18:35.6533330Z + curl -sS -X POST --write-out '%{http_code}' -o /tmp/tmp.EAMoHP/nvim-win32.zip.json -H 'Authorization: token ***' -H 'Content-Length: 33565152' -H 'Content-Type: application/zip' --upload-file /github/home/assets/nvim-win32.zip 'https://uploads.github.com/repos/rktjmp/neovim/releases/51487427/assets?name=nvim-win32.zip'
  • connection resets again
2021-10-17T04:18:35.8648208Z curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 104
2021-10-17T04:18:35.8678098Z + status_code=000

repeat 2 more times until the job fails.

I did for a moment think GH is flagging the build as a virus, there is precedent on that (at least by some vendors) but I have seen the same failure for the macos build so I don't think that's it.

As said above, the byte size reported by GH is the byte size of the file we wanted to upload. Whether that reported size is "on disk" or just what we sent up, who knows. It's possible you could just ignore the error and it might all be OK, or the build would just be missing the win32 asset (or whatever did fail).

Full log

from github-release.

glacambre avatar glacambre commented on July 20, 2024

Neovim stopped relying on this action so it's probably impossible to tell if the issue is fixed now :)

from github-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.