-
Notifications
You must be signed in to change notification settings - Fork 964
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
Argument list too long when logs encounter large output #1733
Comments
Hi @JamesIves, |
Hi @JamesIves, |
I am somewhat confused about how I can run the exact same workflow in a different project and get different results. I read up on the error so I'm somewhat familiar with it but I don't really know how this is causing it? Could the size of the contents of the repo be the problem? And if so is there a hard upper limit? |
I further researched and concluded that this is not a runner bug, so I'll leave this issue closed for now. Please take a look at this issue, it is about a similar/same bug as the one you reported. |
In case it's helpful to anyone else that runs into this, I ran into this error with post-run steps, and it was because I had an environment variable set in |
I am also getting the |
Why was this closed? I'm having lot's of trouble trying to upload longer text streams |
The issue is still present on v6.4.0
|
I got the same one today Post Run actions/checkout@v3 |
Definitely still valid. We got the issue trying to store the |
The best way to work around this is to store large outputs in a file instead of in an env var. |
Still no fix? We got the same issue with a very long Terraform plan output. |
I found this stack overflow article where a user suggests truncating the tfplan result if the plan is too long. add these to your workflow:
|
My solution is to run the terraform show inside the comment step: - name: Plan
id: plan
working-directory: ${{ inputs.working_directory }}
run: terraform plan -out tf.plan
- name: Comment Plan
uses: actions/github-script@v7
continue-on-error: true
with:
script: |
const fs = require('fs');
const { execSync } = require('child_process');
// Get the terraform plan output
const planOutput = execSync('terraform show -no-color tf.plan', {
cwd: '${{ inputs.working_directory }}'
}).toString();
const {data: comments} = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
})
const botComment = comments.find(comment => comment.user.id === 41898282 && comment.body.includes("${{ github.workflow }}"))
if (!botComment) {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Terraform Plan for ${{ github.workflow }}:\n\`\`\`${planOutput}\`\`\``
})
} else {
github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: `Terraform Plan for ${{ github.workflow }}:\n\`\`\`${planOutput}\`\`\``
})
} |
Describe the bug
Multiple GitHub-provided actions are failing in their post-run steps due to an
Argument list too long
error.To Reproduce
fs.writeFile
function.set-output
is true in thefetch-api-data
step as that makes the action save it as an environment variable:An error occurred trying to start process '/home/runner/runners/2.288.1/externals/node16/bin/node' with working directory '/home/runner/work/project/project'. Argument list too long
.Having looked at this briefly I suspect this is occurring as there's some degree of logging that occurs behind the scenes that are causing the argument list to overflow. If you toggle
ACTIONS_STEP_DEBUG
to true in the secrets menu you see this. The data parsed is large but I'm not really sure why this would be a problem.Expected behavior
I am not really sure. If this is indeed the runner causing this due to logging I would expect there to be some form of fail-safe to prevent it from crashing.
Runner Version and Platform
What's not working?
An error occurred trying to start process '/home/runner/runners/2.288.1/externals/node16/bin/node' with working directory '/home/runner/work/project/project'. Argument list too long
.Job Log Output
The text was updated successfully, but these errors were encountered: