Table of Contents
Argo CD - Fix exceeded max combined manifest file size
Summary: How to fix the error exceeded max combined manifest file size in argocd.
Date: 27 February 2025
A while ago I suddenly came across this error in Argo CD when trying to do a sync:
ComparisonError: rpc error: code = Unknown desc = Manifest generation error (cached): failed to get potentially valid manifests: exceeded max combined manifest file size
This error is caused because the combined file size of all the manifests in the repository you want to sync with is too large.
Background
If you would check the Argo CD settings documentation you would find the following setting:
reposerver.max.combined.directory.manifests.size: '10M'
Above the setting, the following explaination is given:
# Max combined manifest file size for a single directory-type Application. In-memory manifest representation may be as # much as 300x the manifest file size. Limit this to stay within the memory limits of the repo-server while allowing # for 300x memory expansion and N Applications running at the same time. # (example 10M max * 300 expansion * 10 Apps = 30G max theoretical memory usage).
As you can see, changing this settings might have a serious impact on the memory usage of the repo-server, and should be handled with care. To be sure this is indeed the problem you're facing, you could check the actual size of the manifests in the repository you're trying to sync with. In my case I recently added the kube-prometheus-stack manifest created by helm. That manifest is about 5 MB which pushed the combined size over the limit.
Fix
In my case I could spare the memory, and the error was prevening changes to be deployed, so I decided to increase the limit.
To increase the limit, you can edit the 'argocd-cmd-params-cm' configmap in the argocd namespace:
- Using kubectk you can edit the configmap with the following command:
kubectl edit configmap argocd-cmd-params-cm -n argocd
- Locate the setting
reposerver.max.combined.directory.manifests.size
and change the value to a higher value:reposerver.max.combined.directory.manifests.size: 15M
- Save the configmap and exit the editor.
- You should see a message like
Result: configmap/argocd-cmd-params-cm edited
Now we need to load the setting into Argo CD. Using the following command you can reload the Argo CD repo server:
kubectl rollout restart deploy argo-cd-argocd-repo-server -n argocd
After the restart of the repo server, you should be able to sync the application without the error.
Note: the restart of the repo server can take a long time, depending on various factors.