azabrha opened a new issue, #12654:
URL: https://github.com/apache/apisix/issues/12654
### Description
# Issue: Unable to Increase Client Max Body Size in APISIX Docker Compose
Setup Leads to Sync Configuration Error in ADC
## Description
I'm encountering an error when trying to sync configurations using ADC
(APISIX Dashboard CLI) with APISIX running in a Docker Compose setup. The error
indicates that the request body size exceeds the maximum allowed limit (2710395
> 1572864). I've attempted to increase the `client_max_body_size` in the APISIX
configuration, but it doesn't resolve the issue.
This prevents me from syncing larger configurations, and I need guidance on
how to properly increase this limit in a Docker Compose environment.
## Environment
- OS: Linux Ubuntu 22.04
- APISIX Version: 3.12.0-debian (using Docker image
`apisix:${APISIX_IMAGE_TAG:-3.12.0-debian}`)
- ADC Version: 0.20.0 (via `adc -version`)
- etcd Version: bitnami/etcd:3.5.11
- Setup: Docker Compose
## Steps to Reproduce
1. Set up APISIX with Docker Compose using the default configuration.
2. Attempt to add the following to the APISIX config.yaml:
```
nginx_config:
http:
client_max_body_size: 10m
```
3. Restart the APISIX container.
4. Run ADC to sync a configuration that results in a request body larger
than ~1.5MB (e.g., with multiple services/routes).
5. Observe the error in ADC and APISIX logs.
## Expected Behavior
The `client_max_body_size` setting should take effect, allowing larger
request bodies during configuration sync.
## Actual Behavior
The limit remains at 1572864 bytes, and the sync fails with the following
errors:
### ADC Error Log
```
[12:58:33 PM] [ADC] › ▶ start Load local configuration
[12:58:33 PM] [ADC] › ▶ start Load ......./o2a_v1.0.0.yaml
[12:58:33 PM] [ADC] › ✔ success Load ......./o2a_v1.0.0.yaml
[12:58:33 PM] [ADC] › ▶ start Load ......./global-rules.yaml
[12:58:33 PM] [ADC] › ✔ success Load ......./global-rules.yaml
[12:58:33 PM] [ADC] › ▶ start Merge local configurations
[12:58:33 PM] [ADC] › ✔ success Merge local configurations
[12:58:33 PM] [ADC] › ▶ start Resolve value variables
[12:58:33 PM] [ADC] › ✔ success Resolve value variables
[12:58:33 PM] [ADC] › ✔ success Load local configuration
[12:58:33 PM] [ADC] › ▶ start Lint configuration
[12:58:33 PM] [ADC] › ✔ success Lint configuration
[12:58:33 PM] [ADC] › ▶ start Load remote configuration
[12:58:33 PM] [ADC] › ▶ start Fetch all configuration
[12:58:33 PM] [APISIX] › ▶ start Fetch stream_routes
[12:58:33 PM] [APISIX] › ✔ success Fetch stream_routes
[12:58:33 PM] [APISIX] › ▶ start Fetch services
[12:58:33 PM] [APISIX] › ✔ success Fetch services
[12:58:33 PM] [APISIX] › ▶ start Fetch routes
[12:58:33 PM] [APISIX] › ✔ success Fetch routes
[12:58:33 PM] [APISIX] › ▶ start Fetch consumers
[12:58:33 PM] [APISIX] › ✔ success Fetch consumers
[12:58:33 PM] [APISIX] › ▶ start Fetch ssls
[12:58:33 PM] [APISIX] › ✔ success Fetch ssls
[12:58:33 PM] [APISIX] › ▶ start Fetch plugin_configs
[12:58:33 PM] [APISIX] › ✔ success Fetch plugin_configs
[12:58:33 PM] [APISIX] › ▶ start Fetch global_rules
[12:58:33 PM] [APISIX] › ✔ success Fetch global_rules
[12:58:33 PM] [APISIX] › ▶ start Fetch upstreams
[12:58:33 PM] [APISIX] › ✔ success Fetch upstreams
[12:58:33 PM] [APISIX] › ▶ start Fetch plugin_metadata
[12:58:33 PM] [APISIX] › ✔ success Fetch plugin_metadata
[12:58:33 PM] [ADC] › ✔ success Fetch all configuration
[12:58:33 PM] [ADC] › ✔ success Load remote configuration
[12:58:33 PM] [ADC] › ▶ start Diff configuration
[12:58:33 PM] [ADC] › ✔ success Diff configuration
[12:58:33 PM] [ADC] › ▶ start Sync configuration
[12:58:33 PM] [ADC] › ✖ error Sync configuration
[12:58:33 PM] [ADC] › ✖ fatal Error: invalid request body: request size
2710395 is greater than the maximum size 1572864 allowed
at dist/apps/cli/main.js:30:260515
at Observable.init [as _subscribe] (dist/apps/cli/main.js:9:246279)
at Observable._trySubscribe (dist/apps/cli/main.js:9:163330)
at dist/apps/cli/main.js:9:163222
at Object.exports.errorContext (dist/apps/cli/main.js:9:178170)
at Observable.subscribe (dist/apps/cli/main.js:9:163047)
at dist/apps/cli/main.js:9:291359
at OperatorSubscriber._this._error (dist/apps/cli/main.js:9:184433)
at OperatorSubscriber.Subscriber.error (dist/apps/cli/main.js:9:166431)
at OperatorSubscriber.Subscriber._error (dist/apps/cli/main.js:9:166893)
```
### APISIX Container Error Log
```
2025/10/07 13:01:02 [error] 49#49: *16716 [lua] init.lua:206: handler():
failed to read request body: request size 2710395 is greater than the maximum
size 1572864 allowed, client: xxxxx, server: , request: "PUT
/apisix/admin/services/e0e87326fc26eae5dd81f489ab74882b41bdd796 HTTP/1.1",
host: "localhost:9180"
```
## Additional Context
- I've tried setting `client_max_body_size: 10m` in the `nginx_config.http`
section of config.yaml and restarting the container, but the limit doesn't
change.
- The request is being made to the admin API endpoint
(`/apisix/admin/services/...`).
- Is there a specific way to override this in Docker Compose? Perhaps via
environment variables, custom Nginx config, or another method?
Any help on increasing this limit would be appreciated!
### Environment
## Environment
- OS: Linux Ubuntu 22.04
- APISIX Version: 3.12.0-debian (using Docker image
`apisix:${APISIX_IMAGE_TAG:-3.12.0-debian}`)
- ADC Version: 0.20.0 (via `adc -version`)
- etcd Version: bitnami/etcd:3.5.11
- Setup: Docker Compose
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]