Skip to content

[Bug]: "exec /manager: argument list too long" in bootstrap-controller #6234

Description

@maxcoolmakarov

Is there an existing issue already for this bug?

  • I have searched for an existing issue, and could not find anything. I believe this is a new bug.

I have read the troubleshooting guide

  • I have read the troubleshooting guide and I think this is a new bug.

I am running a supported version of CloudNativePG

  • I have read the troubleshooting guide and I think this is a new bug.

Contact Details

[email protected]

Version

1.24.0

What version of Kubernetes are you using?

1.28

What is your Kubernetes environment?

Cloud: Other

How did you install the operator?

Helm

What happened?

I have a k8s managed cluster and a namespace with thousands of pods with different VENV. My cnpg worked fine for over a year and suddenly, newly created clusters or rebooted old ones start hanging in pending status due to sidecar container error.
Log:
exec /manager: argument list too long
Exactly same cluster manifest worked fine in other namespaces, so the problem relays to bash problem with large amount of VENVs in one namespace.

Proposed solution:

Add an ability to set Pod parameter: enableServiceLinks: false to any created CNPG pod.

Current working solution is to use kyverno:

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: disable-service-links-for-database
spec:
  rules:
    - name: set-enable-service-links-false
      match:
        resources:
          kinds:
            - Pod
          namespaces:
            - <some namespace>
      mutate:
        patchesJson6902: |
          - op: replace
            path: /spec/enableServiceLinks
            value: false

and with enableServiceLinks=false clusters are able to start again

Cluster resource

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bug 🐛
    and removed
    triage
    on Dec 3, 2024
  2. added
    enhancement 🪄
    on Dec 3, 2024
  3. gbartolini commented on Dec 3, 2024

    @gbartolini
    Contributor

    Have you considered reducing the number of services deployed by the operator with disableDefaultServices? See https://cloudnative-pg.io/documentation/current/service_management/

  4. gecube commented on Dec 9, 2024

    @gecube

    @gbartolini Hi! Thanks for the attention. I want to emphasise that disableDefaultServices would not help as the issue is not linked directly to number of services deployed by cnpg, but rather to number of services in the same NS. And these services could be managed by other means. I think the proper solution would be to allow the cluster operator to change some fields from Pod Template Spec in cnpg cluster definition.

  5. self-assigned this
    on Dec 12, 2024
  6. mnencia commented on Jan 31, 2025

    @mnencia
    Member

    Now you can fix this issue by using the new cnpg.io/podPatch annotation. I.e.,

      annotations:
        cnpg.io/podPatch: |
          [
          	{
          		"op": "add",
          		"path": "/spec/enableServiceLinks",
          		"value": false
          	}
          ]
    
  7. added a commit that references this issue on Jan 31, 2025
    02e4e4d
  8. simplysoft commented on Apr 19, 2025

    @simplysoft

    Did experience this issue as well. Gave cnpg.io/podPatch a try, but it does not seem to fix it in our case. We got the exec /manager: argument list too long for the initdb jobs

  9. added a commit that references this issue on Oct 25, 2025
    53b34dc
  10. added a commit that references this issue on Jul 15, 2026
    dc10955
  11. added a commit that references this issue on Nov 25, 2026
    bbad214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug 🐛enhancement 🪄

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions