# Too many arguments on the command line

**URL:** <https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248>\
**Category:** CWL Questions\
**Created:** [December 2, 2020, 9:36am UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248 "2020-12-02T09:36:30Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![matmanc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/matmanc/32/113_2.png) [@matmanc](https://cwl.discourse.group/u/matmanc)\
**Post date:** [December 4, 2020, 3:40pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/22 "2020-12-04T15:40:22Z")

</div>

Oks then should I wait for a fix?  
Unfortunately cwltool is not an option as I cant submit slurm jobs with it.  
So I guess I will just to work around this issue in the workflow directly in the meantime.

---

<div class="post-metadata">

**Author:** ![DailyDreaming](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/dailydreaming/32/117_2.png) [@DailyDreaming](https://cwl.discourse.group/u/DailyDreaming)\
**Post date:** [December 4, 2020, 9:39pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/23 "2020-12-04T21:39:13Z")

</div>

Hi @matmanc, I’ve created a Toil issue: [https://github.com/DataBiosphere/toil/issues/3358](https://github.com/DataBiosphere/toil/issues/3358) and will work on providing a fix for you.

---

<div class="post-metadata">

**Author:** ![mrc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/mrc/32/3_2.png) [@mrc](https://cwl.discourse.group/u/mrc)\
**Post date:** [December 6, 2020, 9:34am UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/24 "2020-12-06T09:34:03Z")

</div>

While a fix is being developed, can you try this workaround first?

```auto
ulimit -s unlimited

```

---

<div class="post-metadata">

**Author:** ![tetron](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/tetron/32/40_2.png) [@tetron](https://cwl.discourse.group/u/tetron)\
**Post date:** [December 7, 2020, 4:27pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/25 "2020-12-07T16:27:25Z")

</div>

So close, that could work on a single node, but probably not when the jobs go to slurm. Unless there’s a way to set ulimits with slurm.

---

<div class="post-metadata">

**Author:** ![mrc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/mrc/32/3_2.png) [@mrc](https://cwl.discourse.group/u/mrc)\
**Post date:** [December 7, 2020, 4:29pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/26 "2020-12-07T16:29:06Z")

</div>

> **[Slurm Workload Manager - Frequently Asked Questions](https://slurm.schedmd.com/faq.html#rlimit)**

---

<div class="post-metadata">

**Author:** ![mrc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/mrc/32/3_2.png) [@mrc](https://cwl.discourse.group/u/mrc)\
**Post date:** [December 7, 2020, 4:29pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/27 "2020-12-07T16:29:32Z")

</div>

I think it is a reasonable request for a cluster admin.

---

<div class="post-metadata">

**Author:** ![tetron](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/tetron/32/40_2.png) [@tetron](https://cwl.discourse.group/u/tetron)\
**Post date:** [December 7, 2020, 4:41pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/28 "2020-12-07T16:41:51Z")

</div>

@matmanc So that gives you something else to try, at least.

---

<div class="post-metadata">

**Author:** ![matmanc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/matmanc/32/113_2.png) [@matmanc](https://cwl.discourse.group/u/matmanc)\
**Post date:** [December 8, 2020, 5:13pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/29 "2020-12-08T17:13:23Z")

</div>

Thanks! I think I will wait for the fix. Meanwhile we rewrote the workflow to avoid these situations. Basically collecting the infos from the different directories first and the aggregating the files. This is obviously a temporary workaround. So I hope the fix will be available soon.

---

<div class="post-metadata">

**Author:** ![tetron](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/tetron/32/40_2.png) [@tetron](https://cwl.discourse.group/u/tetron)\
**Post date:** [December 11, 2020, 8:58pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/30 "2020-12-11T20:58:41Z")

</div>

If you have been following along on github, the Toil team takes it seriously and they are working on it.

---

<div class="post-metadata">

**Author:** ![steve](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@steve](https://cwl.discourse.group/u/steve)\
**Post date:** [February 8, 2021, 5:39pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/31 "2021-02-08T17:39:22Z")

</div>

I have been having similar issues. I was trying to get around it by using InitialWorkDirRequirement to put all the input files into a directory.

```auto
requirements:
  InitialWorkDirRequirement:
    listing:
      - entryname: some_dir # <- put all the input files into a dir
        writable: true
        entry: "$({class: 'Directory', listing: inputs.input_files})"

```

This seems to “fix” the Singularity CLI arg issues because when you do this, the only `--bind` arg that it uses is the one for the directory that you put all the files into.

However, I ended up running into this issue instead:

> <https://github.com/common-workflow-language/cwltool/issues/1403>
>
> When you try to stage input files with an InitialWorkDirRequirement, and the files have the same name, they normally trigger an...

So, it appears that this solution might work well if you are sure that your input files /dirs all have unique basenames, but you will have problems if the names conflict.

---

<div class="post-metadata">

**Author:** ![steve](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@steve](https://cwl.discourse.group/u/steve)\
**Post date:** [February 8, 2021, 5:43pm UTC](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248/32 "2021-02-08T17:43:21Z")

</div>

Also worth noting that Singularity might not immediately break from these issues with long command lines; I had cases where it would stall out completely, as reported in here; [Singularity exec stops working when command line args are too long · Issue #5815 · hpcng/singularity · GitHub](https://github.com/hpcng/singularity/issues/5815)

[Previous page](https://cwl.discourse.group/t/too-many-arguments-on-the-command-line/248.md?page=1)
