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

[Bug] GitHub API failure? "You have sent an invalid request. Please do not send this request again." #137

Open
IMB11 opened this issue Dec 14, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@IMB11
Copy link

IMB11 commented Dec 14, 2024

Description

https://github.com/IMB11/xanders-sodium-options/actions/runs/12333368646/job/34422360355

Error: HttpError: 400 (Bad Request, {"message":"You have sent an invalid request. Please do not send this request again.","request_id":"2FC0:33579C:84AFE8:912D63:675DFF3F","documentation_url":"https://developer.github.com/v3/"})

Expected Behavior

It uploading to github releases.

Actual Behavior

It doesnt.

Version

Latest - v3.3

Environment

GitHub Actions

Configuration

name: Distribute JARs
on:
  release:
    types: [published]

jobs:
  build:
    runs-on: "ubuntu-latest"
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4
      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          distribution: corretto
          cache: gradle
          java-version: 21
      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v3
        with:
          gradle-version: "8.10"
      - name: Build JARs
        uses: Wandalen/wretry.action@master
        with:
          command: "gradle chiseledBuild"
          attempt_limit: 3
      - name: Upload Built JARs
        uses: actions/upload-artifact@v4
        with:
          name: built-jars
          path: |
            ./versions/**/build/libs/*.jar
  distribute:
    needs: build
    runs-on: "ubuntu-latest"
    strategy:
      matrix:
        game_version: [ "1.21.1", "1.21.3", "1.21.4" ]
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4
      - name: Download Built JARs
        uses: actions/download-artifact@v4
        with:
          name: built-jars
          path: ./versions
      - name: Publish to Modrinth, CurseForge, etc.
        uses: Kir-Antipov/[email protected]
        with:
          files: |
            versions/${{ matrix.game_version }}/build/libs/!(*-@(dev|sources|javadoc)).jar
            versions/${{ matrix.game_version }}/build/libs/*-@(dev|sources|javadoc).jar
          version: ${{ github.ref_name }}+${{ matrix.game_version }}
          modrinth-id: ${{ vars.MODRINTH_ID }}
          modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
          curseforge-id: ${{ vars.CURSEFORGE_ID }}
          curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
          github-token: ${{ secrets.CLASSIC_GITHUB_TOKEN }}

Logs

Run Kir-Antipov/[email protected]
  with:
    files: versions/1.21.1/build/libs/!(*-@(dev|sources|javadoc)).jar
  versions/1.21.1/build/libs/*-@(dev|sources|javadoc).jar
  
    version: 2.3.0+1.21.1
    modrinth-id: sTkQBVyo
    modrinth-token: ***
    curseforge-id: 678306
    curseforge-token: ***
    modrinth-featured: ${undefined}
    modrinth-unfeature-mode: subset
    github-tag: ${undefined}
    github-generate-changelog: ${undefined}
    github-draft: ${undefined}
    github-prerelease: ${undefined}
    github-commitish: ${undefined}
    github-discussion: ${undefined}
    files-primary: ${undefined}
    files-secondary: ${undefined}
    name: ${undefined}
    version-type: ${undefined}
    changelog: ${undefined}
    changelog-file: ${undefined}
    loaders: ${undefined}
    game-versions: ${undefined}
    dependencies: ${undefined}
    version-resolver: ${undefined}
    game-version-filter: releases
    java: ${undefined}
    retry-attempts: 2
    retry-delay: 10000
    fail-mode: fail
    modrinth-files: ${undefined}
    curseforge-files: ${undefined}
    github-files: ${undefined}
    modrinth-files-primary: ${undefined}
    curseforge-files-primary: ${undefined}
    github-files-primary: ${undefined}
    modrinth-files-secondary: ${undefined}
    curseforge-files-secondary: ${undefined}
    github-files-secondary: ${undefined}
    modrinth-name: ${undefined}
    curseforge-name: ${undefined}
    github-name: ${undefined}
    modrinth-version: ${undefined}
    curseforge-version: ${undefined}
    github-version: ${undefined}
    modrinth-version-type: ${undefined}
    curseforge-version-type: ${undefined}
    github-version-type: ${undefined}
    modrinth-changelog: ${undefined}
    curseforge-changelog: ${undefined}
    github-changelog: ${undefined}
    modrinth-changelog-file: ${undefined}
    curseforge-changelog-file: ${undefined}
    github-changelog-file: ${undefined}
    modrinth-loaders: ${undefined}
    curseforge-loaders: ${undefined}
    github-loaders: ${undefined}
    modrinth-game-versions: ${undefined}
    curseforge-game-versions: ${undefined}
    github-game-versions: ${undefined}
    modrinth-dependencies: ${undefined}
    curseforge-dependencies: ${undefined}
    github-dependencies: ${undefined}
    modrinth-version-resolver: ${undefined}
    curseforge-version-resolver: ${undefined}
    github-version-resolver: ${undefined}
    modrinth-game-version-filter: ${undefined}
    curseforge-game-version-filter: ${undefined}
    github-game-version-filter: ${undefined}
    modrinth-java: ${undefined}
    curseforge-java: ${undefined}
    github-java: ${undefined}
    modrinth-retry-attempts: ${undefined}
    curseforge-retry-attempts: ${undefined}
    github-retry-attempts: ${undefined}
    modrinth-retry-delay: ${undefined}
    curseforge-retry-delay: ${undefined}
    github-retry-delay: ${undefined}
    modrinth-fail-mode: ${undefined}
    curseforge-fail-mode: ${undefined}
    github-fail-mode: ${undefined}
📤 Uploading assets to CurseForge
✅ Successfully published assets to CurseForge in 1699 ms
📤 Uploading assets to Modrinth
🔽 Initiating unfeaturing of older Modrinth project versions
✅ Successfully published assets to Modrinth in 1660 ms
📤 Uploading assets to GitHub
Error: HttpError: 400 (Bad Request, {"message":"You have sent an invalid request. Please do not send this request again.","request_id":"2FC0:33579C:84AFE8:912D63:675DFF3F","documentation_url":"https://developer.github.com/v3/"})

Other Information

No response

@IMB11 IMB11 added the bug Something isn't working label Dec 14, 2024
@Kir-Antipov
Copy link
Owner

I adore the low-key threatening "Please do not send this request again."

Is this issue reproducible for you? I can't seem to trigger it on my end. Did it work previously? Could this be related to the token and/or its permissions?

@IMB11
Copy link
Author

IMB11 commented Dec 15, 2024

Not sure, this is the only time I have ever encountered this

@Kir-Antipov
Copy link
Owner

Oh, I see now. If you take a closer look at the logs, you'll notice that the github-token input is not listed there. This occurs when the input receives an empty value (because GitHub treats an empty string as "unset", which forced me to use a special default value, ${undefined}, for each of my inputs). So, yeah, ${{ secrets.CLASSIC_GITHUB_TOKEN }} is empty in this context, meaning this is indeed a token issue. (Honestly, GitHub API error messages could use some work...)

If it weren't for a regression discussed in #106 (already fixed in my local tree, so this will be resolved once I finalize v4), mc-publish wouldn't have even attempted to publish assets to GitHub.

@IMB11
Copy link
Author

IMB11 commented Dec 16, 2024

Will v4 development be open source any time soon?

@Kir-Antipov
Copy link
Owner

Of course! I'm pretty sure everything will be up and running before 1.22 drops. It could have been much sooner, but I went through some tough times. Thankfully, things are a bit better now :)

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