question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Argument list too long when logs encounter large output

See original GitHub issue

Describe the bug

Multiple GitHub-provided actions are failing in their post-run steps due to an Argument list too long error.

To Reproduce

  1. Initiate the following workflow provided below from a user of my action. This workflow will fetch data from an API and save it as a JSON file so subsequent steps can do something with it. The action is not saving it as an environment variable, just a json file through Nodes fs.writeFile function.
name: Refresh Feed
on:
  workflow_dispatch:
jobs:
  refresh-feed:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v3
  
      - name: Fetch API Data 📦
        uses: JamesIves/fetch-api-data-action@releases/v2
        with:
          endpoint: https://api.scryfall.com/catalog/card-names
          configuration: '{ "method": "GET" }'
          save-location: assets
          save-name: test
          set-output: false
  1. You will get the following runner-related error. The same will occur if set-output is true in the fetch-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

  • ubuntu-latest

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

##[debug]Evaluating condition for step: 'Post Checkout 🛎️'
##[debug]Evaluating: always()
##[debug]Evaluating always:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Post Checkout 🛎️
##[debug]Loading inputs
##[debug]Evaluating: github.repository
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'repository'
##[debug]=> 'JamesIves/reddit-viewer'
##[debug]Result: 'JamesIves/reddit-viewer'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Post job cleanup.
Error: An error occurred trying to start process '/home/runner/runners/[2](https://github.com/JamesIves/reddit-viewer/runs/5440253729?check_suite_focus=true#step:8:2).288.1/externals/node16/bin/node' with working directory '/home/runner/work/reddit-viewer/reddit-viewer'. Argument list too long
##[debug]System.ComponentModel.Win[3](https://github.com/JamesIves/reddit-viewer/runs/5440253729?check_suite_focus=true#step:8:3)2Exception (7): An error occurred trying to start process '/home/runner/runners/2.288.1/externals/node1[6](https://github.com/JamesIves/reddit-viewer/runs/5440253729?check_suite_focus=true#step:8:6)/bin/node' with working directory '/home/runner/work/reddit-viewer/reddit-viewer'. Argument list too long
##[debug]   at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt[32](https://github.com/JamesIves/reddit-viewer/runs/5440253729?check_suite_focus=true#step:8:32) userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
##[debug]   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
##[debug]   at System.Diagnostics.Process.Start()
##[debug]   at GitHub.Runner.Sdk.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
##[debug]   at GitHub.Runner.Common.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
##[debug]   at GitHub.Runner.Worker.Handlers.DefaultStepHost.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, CancellationToken cancellationToken)
##[debug]   at GitHub.Runner.Worker.Handlers.NodeScriptActionHandler.RunAsync(ActionRunStage stage)
##[debug]   at GitHub.Runner.Worker.ActionRunner.RunAsync()
##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
##[debug]Finishing: Post Checkout 🛎️

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

20reactions
jsimonicommented, Apr 12, 2022

I am also getting the Argument list too long error when trying to work with a larger (~ 7k characters) terraform plan output between multiple steps in my workflow.

4reactions
jketchamcommented, Mar 16, 2022

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 $GITHUB_ENV that was too large (in my case a diff for kubernetes changes). Removing that env variable fixed the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The “Argument List Too Long” Error in Linux Commands
In this tutorial, we'll look at the “argument list too long” problem, often encountered while working with a large number of files.
Read more >
Argument list too long error for rm, cp, mv commands
The reason this occurs is because bash actually expands the asterisk to every matching file, producing a very long command line. Try this:...
Read more >
"Argument list too long": How do I deal with it, without ...
So, a solution is to increase the amount of space available for the stack. ... You may need to play around with how...
Read more >
The Argument list too long Error in Linux Commands
In this article, we will discuss the error message that is displayed when you try to execute a command on your Linux system...
Read more >
"argument list too long" error with very large CI/CD variable
This occurs when a CI/CD variable contains a very large value. Some customers have come across this specifically by adding a large amount...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found