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

Latest Tag Version errors with Type: clojure.lang.ExceptionInfo and Use a file because the release data may be too large for an inline curl arg #56

Open
mdcsaenz-ck opened this issue Sep 15, 2021 · 10 comments

Comments

@mdcsaenz-ck
Copy link

mdcsaenz-ck commented Sep 15, 2021

Greetings, here is the code for the githubaction run I had and here:

 - id: tag_release
        uses: rymndhng/[email protected]
        with:
          bump_version_scheme: minor
          tag_prefix: ""
          # temporary
          max_commits: 1

Here is the error:

Run rymndhng/[email protected]
  with:
    bump_version_scheme: minor
    max_commits: 1
  env:
    GITHUB_TOKEN: ***
    INCOMING_WEBHOOK_URL: ***
    PORT: 3001
    PROJECT_ID: ourcompany-907
/usr/bin/docker run --name b361ee218e2cfc8f74d1bad7e73660b905477_585ccd --label 7b361e --workdir /github/workspace --rm -e GITHUB_TOKEN -e INCOMING_WEBHOOK_URL -e PORT -e PROJECT_ID -e INPUT_BUMP_VERSION_SCHEME -e INPUT_TAG_PREFIX -e INPUT_MAX_COMMITS -e INPUT_RELEASE_BODY -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ourrepo/ourrepo":"/github/workspace" 7b361e:e218e2cfc8f74d1bad7e73660b905477
Starting process...
Received context {:token ***, :repo ourcompany/ourrepo, :sha 0ebdc5b5388f6af146e59b57e34115127745eb00, :input/max-commits 1, :input/release-body , :input/tag-prefix , :bump-version-scheme minor, :dry-run false}
Fetching related data...
Generating release...
Executing Release
 {
  "tag_name" : "4.49.0",
  "target_commitish" : "0ebdc5b5388f6af146e59b57e34115127745eb00",
  "name" : "4.49.0",
  "body" : "Version 4.49.0\n\n\n### Commits\n\n- [0ebdc5b5] Update build.yml\n",
  "draft" : false,
  "prerelease" : false
}
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  babashka.curl: status 422
Location: /var/src/release-on-push-action/src/release_on_push_action/core.clj:119:5

----- Context ------------------------------------------------------------------
115:   ;; Use a file because the release data may be too large for an inline curl arg
116:   (let [file (java.io.File/createTempFile "release" ".json")]
117:     (.deleteOnExit file)
118:     (json/encode-stream new-release-data (clojure.java.io/writer file))
119:     (curl/post (format "https://api.github.com/repos/%s/releases" (:repo context))
         ^--- babashka.curl: status 422
120:                {:body    file
121:                 :headers {"Authorization" (str "token " (:token context))}})))
122: 
123: (defn set-output-escape
124:   "Escapes text for the set-output command in Github Actions.

----- Locals -------------------------------------------------------------------
context:          {:token "***", :repo "ourcompany/ourrepo", :sha "0ebdc5b5388f6af146e59b57e34115127745eb00", :input/max-commits 1, :input/release-body "", :input/tag-prefix "", :bump-version-scheme "minor", :dry-run false}
new-release-data: {:tag_name "4.49.0", :target_commitish "0ebdc5b5388f6af146e59b57e34115127745eb00", :name "4.49.0", :body "Version 4.49.0\n\n\n### Commits\n\n- [0ebdc5b5] Update build.yml\n", :draft false, :prerelease false}
file:             #object[java.io.File 0x6ff20b47 "/tmp/release12591324607771915577.json"]

----- Stack trace --------------------------------------------------------------
babashka.curl/post                              - <built-in>
release-on-push-action.core/create-new-release! - /var/src/release-on-push-action/src/release_on_push_action/core.clj:119:5
release-on-push-action.core/create-new-release! - /var/src/release-on-push-action/src/release_on_push_action/core.clj:114:1
release-on-push-action.core/apply               - /var/src/release-on-push-action/src/release_on_push_action/core.clj:163:20
release-on-push-action.core                     - /var/src/release-on-push-action/src/release_on_push_action/core.clj:163:11
/apply#if                                       - <expr>:156:8
                                                - <expr>:156:7
clojure.core/apply                              - <built-in>
user                                            - <expr>:1:52

I also attempted with master and it broke. Any assistance will be helpful as its it hindering us from building :( Thank you.

@mdcsaenz-ck
Copy link
Author

mdcsaenz-ck commented Sep 15, 2021

It seems that it still grabs the WHOLE body, not just the last X commits . when you do max_commits. Also it seems like babashka.curl: status 422 for line 119 in /var/src/release-on-push-action/src/release_on_push_action/core.clj:119:5

@rymndhng
Copy link
Owner

According to Github's API, 422 implies that there client errors in the schema of the payload. source.

The error seems to indicate that it could be an unexpected error in the JSON body to the /release endpoint, specifically this snippet.

{
  "tag_name" : "4.49.0",
  "target_commitish" : "0ebdc5b5388f6af146e59b57e34115127745eb00",
  "name" : "4.49.0",
  "body" : "Version 4.49.0\n\n\n### Commits\n\n- [0ebdc5b5] Update build.yml\n",
  "draft" : false,
  "prerelease" : false
}

It appears that max_commits is working as intended as there is only 1 bullet point in the body.

I attempted to resubmit this payload on my own test repo and was able to create the tag. I'll try to add some more logging in the next release to help debug this scenario. In the mean time, could you try re-running the job to rule out that this is an intermittent error on github's side?

@rymndhng
Copy link
Owner

@mdcsaenz-ck The latest version v0.22.0 should have additional logging to show body of the Github API Response when creating a release fails.

@kaush-13
Copy link
Contributor

kaush-13 commented Dec 8, 2021

@mdcsaenz-ck Is your last release marked as a prerelease? I accidentally flipped mine to prerelease and got the 422 error

@choogiesaur
Copy link

Having this issue as well, @mdcsaenz-ck were you able to solve it?

@ctoestreich
Copy link

This is still an issue in 0.28.0

@phat-go2joy
Copy link

I have the same issue "babashka.curl: status 422" in v0.27.0 with message "Use a file because the release data may be too large for an inline curl arg" :(

@panchalbhavesh
Copy link

Any workaround to resolve the issue?

@doctornkz-intelas
Copy link

Got the same issue just from nowhere. Any ideas on how to mitigate that?

@leshz
Copy link

leshz commented Jun 28, 2024

I encountered the same problem. After searching for some information, I found that the issue might be the permissions that actions have on the repository. You need to enable the read/write permissions. That's all.

Settings -> Actions -> General -> Workflow permissions -> Read and write permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants