/usr/bin/env: ‘bash’: Argument list too long


I can’t start docker-compose due to the error “/usr/bin/env: ‘bash’: Argument list too long” on Linux Mint on kernels 5.18 and above and Docker Compose version v2.21.0.

E.g. docker-compose -f docker-composer.yml -up -d hangs for 5+ minutes then returns the error above.

What I’ve tried to troubleshoot:

Running the latest version (24.0.6) and the version before of docker engine.
I’ve tried upgrading LM from 20.3 to 21 (Ubuntu Jammy base) and the Linux kernel from 5.18.15 to 6.2.0-34 (I can’t go lower than 5.18 due to driver/chipset support for 12th Gen Intel(R) Core™ i9-12900KF).
Switching from UEFI to CSM.
Purging everything docker related and a bunch of other packages like node in case I have some funky configuration that’s causing it.
Throwing salt over my shoulder and chanting.

I’ve googled a fair bit, but can’t find anything specific to Docker that might explain the issue.

I’m wondering if it’s something that I’ve overlooked in respect of some legacy environment config that’s getting pulled in or a weird combination of the newer intel chipset ± Linux Mint,
I’ve had no issues to date on OSX.

Any help would be hugely appreciated.

This turned out to be an environment issue where docker-compose was in a loop trying to load a dangling link (/opt/warden/bin/bash) in my outdated $PATH.

Random cause, but unfortunate that it took sifting through a strace to find an ENOENT rather than being surfaced by docker logging/error reporting.

Anyway, please close the post.