Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to upload artifact, will retry error=POST ipsw_3.1.200_aarch64.apk: 404 Not Found #3605

Closed
3 tasks done
blacktop opened this issue Nov 29, 2022 · 27 comments
Closed
3 tasks done
Assignees
Labels
bug Something isn't working
Milestone

Comments

@blacktop
Copy link

blacktop commented Nov 29, 2022

What happened?

      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_macOS_arm64.tar.gz.sbom name=ipsw_3.1.200_macOS_arm64.tar.gz.sbom
      • failed to upload artifact, will retry        artifact=ipsw_3.1.200_aarch64.apk error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84405069/assets?name=ipsw_3.1.200_aarch64.apk: 404 Not Found [] try=1
      • uploading to release                         file=dist/ipsw_3.1.200_aarch64.apk name=ipsw_3.1.200_aarch64.apk
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_ios_arm64.tar.gz.sbom name=ipsw_3.1.200_ios_arm64.tar.gz.sbom
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_macOS_x86_64.tar.gz.sbom name=ipsw_3.1.200_macOS_x86_64.tar.gz.sbom
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_linux_arm64.tar.gz.sbom name=ipsw_3.1.200_linux_arm64.tar.gz.sbom
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_macOS_arm64_extras.tar.gz.sbom name=ipsw_3.1.200_macOS_arm64_extras.tar.gz.sbom
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_linux_x86_64.tar.gz.sbom name=ipsw_3.1.200_linux_x86_64.tar.gz.sbom
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_macOS_x86_64_extras.tar.gz.sbom name=ipsw_3.1.200_macOS_x86_64_extras.tar.gz.sbom
      • uploading to release                         file=/Users/blacktop/Developer/Github/blacktop/ipsw/dist/ipsw_3.1.200_macOS_universal.tar.gz.sbom name=ipsw_3.1.200_macOS_universal.tar.gz.sbom
      • uploading to release                         file=dist/checksums.txt name=checksums.txt
      • uploading to release                         file=dist/checksums.txt.sig name=checksums.txt.sig
      • failed to upload artifact, will retry        artifact=ipsw_3.1.200_aarch64.apk error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84405069/assets?name=ipsw_3.1.200_aarch64.apk: 404 Not Found [] try=1
      • uploading to release                         file=dist/ipsw_3.1.200_aarch64.apk name=ipsw_3.1.200_aarch64.apk
      • failed to upload artifact, will retry        artifact=ipsw-3.1.200.aarch64.rpm error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84405069/assets?name=ipsw-3.1.200.aarch64.rpm: 404 Not Found [] try=1

How can we reproduce this?

run make release in my ipsw project

goreleaser version

❯ goreleaser -v
goreleaser version 1.13.1
commit: b0ffc7af05aa391b766e8e26f5ad5ec37c640d6e
built at: 2022-11-29T01:03:51Z
built by: goreleaser
goos: darwin
goarch: arm64
module version: v1.13.1, checksum: h1:9yTCn5UE3+1wNtVB3ybUAwjioLq79UyfGz8D+iPOcRk=

https://goreleaser.com

GoReleaser Check

  • goreleaser check shows no errors

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

I did search for other open and closed issues before opening this, but this isn't just the 422 Validation Failed [{Resource:ReleaseAsset Field:name Code:already_exists Message:}] but also WHY is nfpm making aarch64 pkgs all of the sudden?

ipsw_3.1.200_aarch64.apk: 404 Not Found could that have something to do with it? I've tried using a pre-1.13 version of goreleaser, I've tried using a VPN and my phone as a hotspot to factor out internet and get the same issues.

@blacktop blacktop added bug Something isn't working triage Issue pending triage by one of the maintainers labels Nov 29, 2022
@blacktop
Copy link
Author

I apologize if this is a repeat issue, I've been trying to get this to work most of the day 😬 if it is a dup, feel free to close.

@caarlos0
Copy link
Member

very weird, I looked into your config and have no idea why the error is happening.

the aarch64 pkg will always be made if there's an aarch64 binary - and there is one in your config.

@blacktop
Copy link
Author

Ya, but aarch64 is not a valid GOARCH and the previous release did NOT make them and had the same config?

https://github.com/blacktop/ipsw/releases/tag/v3.1.199

@blacktop
Copy link
Author

So I just tried HEADing one of the artifacts in the release draft and got

❯ http HEAD https://github.com/blacktop/ipsw/releases/download/untagged-01a47e6939d15870508d/ipsw_3.1.200_macOS_universal.tar.gzn Contents Restored on Nov 28, 2022 at 9:08 PM
HTTP/1.1 404 Not Found
Cache-Control: no-cache
Content-Encoding: gzip
Content-Length: 29
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; img-src 'self' data:; script-src 'self'; style-src 'unsafe-inline'
Content-Type: text/plain; charset=utf-8
Date: Tue, 29 Nov 2022 15:44:49 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-GitHub-Request-Id: C913:1A88:151E1AE:1FB2B02:638628F0
X-XSS-Protection: 0

A 404??

BUT when I click on the file it downloads no problem and untars properly etc 😕

@blacktop
Copy link
Author

definitely seems like Github is return 404 when it shouldn't?

@blacktop
Copy link
Author

Here is the same test but with the tar.gz from the previous release -

❯ http HEAD https://github.com/blacktop/ipsw/releases/download/v3.1.199/ipsw_3.1.199_macOS_universal.tar.gz
HTTP/1.1 302 Found
Cache-Control: no-cache
Content-Length: 0
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events *.actions.githubusercontent.com wss://*.actions.githubusercontent.com online.visualstudio.com/api/v1/locations github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com objects-origin.githubusercontent.com secured-user-images.githubusercontent.com/ opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/
Content-Type: text/html; charset=utf-8
Date: Tue, 29 Nov 2022 15:50:27 GMT
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/146060123/d58945ef-bd28-4e1d-908e-621996eed904?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221129%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221129T155027Z&X-Amz-Expires=300&X-Amz-Signature=7981ac81a8b6e8a312fe1cdba585667d62db7abb3af83d1463b70e9c9e6af465&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=146060123&response-content-disposition=attachment%3B%20filename%3Dipsw_3.1.199_macOS_universal.tar.gz&response-content-type=application%2Foctet-stream
Referrer-Policy: no-referrer-when-downgrade
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-GitHub-Request-Id: C938:04A9:1425A4E:1E5B309:63862A42
X-XSS-Protection: 0

@blacktop
Copy link
Author

Ok more tests, I turned the DRAFT release into a REAL latest release and all the links now no longer return 404, so I think Github is returning 404 for non-authd sessions to the links because it's a draft? Maybe that's also why you are (goreleaser is) getting the 404s and then thinking it needs to RETRY the upload and then get the Already exists error?

@blacktop
Copy link
Author

I have NO idea why I'd have this issue and no one else would unless Github does weird A/B testing and my account is getting this behavior and others are not?

@caarlos0
Copy link
Member

Ok more tests, I turned the DRAFT release into a REAL latest release and all the links now no longer return 404, so I think Github is returning 404 for non-authd sessions to the links because it's a draft? Maybe that's also why you are (goreleaser is) getting the 404s and then thinking it needs to RETRY the upload and then get the Already exists error?

yeah, if you try anon access to drafts it won't work I imagine.

GoReleaser though, is not doing anon access... so IDK what's going on there either 🤔

Can you confirm (probably via API) that its the right release ID? (in your first comment it was 84405069). Maybe you have multiple drafts with the same name and GoReleaser is getting a different one each time, or something like that? (kinda shooting in the dark now because I honestly don't know what could be 🫠)

@blacktop
Copy link
Author

I just let v3.1.200 fail and then did v3.1.201 and v.3.1.202 to see (as they wouldn't have stale metadata in github etc) and they all are failing in the same way with the 404s 😭

      • uploading to release                         file=dist/ipsw_3.1.202_arm64.deb name=ipsw_3.1.202_arm64.deb
      • uploading to release                         file=dist/ipsw_3.1.202_arm64.deb name=ipsw_3.1.202_arm64.deb
      • uploading to release                         file=dist/ipsw_3.1.202_aarch64.apk name=ipsw_3.1.202_aarch64.apk
      • uploading to release                         file=dist/ipsw_3.1.202_aarch64.apk name=ipsw_3.1.202_aarch64.apk
      • uploading to release                         file=dist/ipsw_3.1.202_amd64.deb name=ipsw_3.1.202_amd64.deb
      • uploading to release                         file=dist/ipsw-3.1.202.aarch64.rpm name=ipsw-3.1.202.aarch64.rpm
      • uploading to release                         file=dist/ipsw_3.1.202_x86_64.apk name=ipsw_3.1.202_x86_64.apk
      • uploading to release                         file=dist/ipsw-3.1.202.aarch64.rpm name=ipsw-3.1.202.aarch64.rpm
      • failed to upload artifact, will retry        artifact=ipsw_3.1.202_arm64.deb error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84479039/assets?name=ipsw_3.1.202_arm64.deb: 404 Not Found [] try=1
      • uploading to release                         file=dist/ipsw_3.1.202_arm64.deb name=ipsw_3.1.202_arm64.deb
      • failed to upload artifact, will retry        artifact=ipsw_3.1.202_aarch64.apk error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84479039/assets?name=ipsw_3.1.202_aarch64.apk: 404 Not Found [] try=1
      • uploading to release                         file=dist/ipsw_3.1.202_aarch64.apk name=ipsw_3.1.202_aarch64.apk
      • failed to upload artifact, will retry        artifact=ipsw_3.1.202_aarch64.apk error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84479039/assets?name=ipsw_3.1.202_aarch64.apk: 404 Not Found [] try=1
      • uploading to release                         file=dist/ipsw_3.1.202_aarch64.apk name=ipsw_3.1.202_aarch64.apk
      • failed to upload artifact, will retry        artifact=ipsw_3.1.202_arm64.deb error=POST https://uploads.github.com/repos/blacktop/ipsw/releases/84479039/assets?name=ipsw_3.1.202_arm64.deb: 404 Not Found [] try=1

@blacktop
Copy link
Author

I even created a NEW github-token that is SUPER permissive just incase it was that

@blacktop
Copy link
Author

However, you can see that goreleaser is actually creating releases w/ all the artifacts uploaded (even the one's it says are 404s) - https://github.com/blacktop/ipsw/releases/tag/v3.1.202

So is there a way to ignore the 404 errors and continue in goreleaser or something I could comment out and try a local build in the meantime?

@caarlos0
Copy link
Member

unfortunately no... and its always the nfpm packages that fail?

can you check your dist, maybe the files are zeroed somehow, and bug is somewhere else?

@caarlos0
Copy link
Member

FWIW #3608 should help when we need to open issues to github, as they ask for the request id :|

@blacktop
Copy link
Author

unfortunately no... and its always the nfpm packages that fail?

can you check your dist, maybe the files are zeroed somehow, and bug is somewhere else?

LOL I commented out the ENTIRE nfpms configs and it worked..... 😵‍💫

@blacktop
Copy link
Author

going back through my commit history on my goreleaser config and I DO see that I added

- file_name_template: "{{ .ConventionalFileName }}"

recently because I saw you add it

Could THAT be it??

@caarlos0
Copy link
Member

weird... according to docs, it shouldn't even return 404 🤔
https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset

can you share here one of the files that failed?

also, maybe try to upload it using the api directly, and seeing if it happens? If so, the response should have a x-github-request-id header, which you can use to open a support case to github...

@caarlos0
Copy link
Member

Could THAT be it??

shouldn't... unless... your config is creating multiple packages with the same name?

@blacktop
Copy link
Author

...

I removed the file_name_template: "{{ .ConventionalFileName }}" and.... it is no longer creating the aarch64 files ...and....

it works perfectly ... again... 🤢🤮

@caarlos0
Copy link
Member

You do have some file named arm64 though, no?

@caarlos0
Copy link
Member

The conventional file name literally only changes the name template, nothing else

@blacktop
Copy link
Author

You do have some file named arm64 though, no?

Ya https://github.com/blacktop/ipsw/releases/tag/v3.1.202

@blacktop
Copy link
Author

The conventional file name literally only changes the name template, nothing else

Ya I have no idea, but I DO have a pretty complex goreleaser build matrix so maybe ConventionalFileName somehow was renaming 2 files to be the same name?

@blacktop
Copy link
Author

I just know it seemed like the first 404 failure was always some aarch64 nfpm pkg

@blacktop
Copy link
Author

I'm just glad we figured this out as it was driving me crazy! I def felt like it wasn't the typical "sometimes it doesn't upload release assets properly" bug. 😥

@caarlos0
Copy link
Member

hmm if that's what happens, #3607 should help

@caarlos0
Copy link
Member

and looking the logs you provided again, definitely looks like there are more than one packages with the same filename, so that's probably it.

#3607 will help by warning these conditions so its easier to spot what's wrong. other than that, not much I can do.

will close this.

@caarlos0 caarlos0 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2022
@caarlos0 caarlos0 added bug Something isn't working and removed bug Something isn't working triage Issue pending triage by one of the maintainers labels Nov 29, 2022
@caarlos0 caarlos0 added this to the v1.14.0 milestone Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants