Importing project via API with Object Store Direct Upload fails with EntityTooLarge
Summary
In some cases (large project imports) through the API when Object Store is configured with direct upload, the import fails even when increasing the max upload size in the GitLab admin area as mentioned in the docs.
This was reported by a Large Ultimate Customer (in ZD - internal only) on 12.10.2 initially.
Steps to reproduce
(Note, the steps are from 12.10 as reported by the customer, I may be missing something but I'll try to reproduce on latest as well)
-
Setup object storage for uploads as follows:
gitlab_rails['uploads_object_store_enabled'] = true gitlab_rails['uploads_object_store_direct_upload'] = true gitlab_rails['uploads_object_store_background_upload'] = false gitlab_rails['uploads_object_store_proxy_download'] = true
-
Attempt to import through the API:
curl -v --request POST --header "PRIVATE-TOKEN: $TOKEN" --form "path=$PROJECT_PATH" --form "file=@/path/to/export.tar.gz" --form "namespace=1" --form "overwrite=true" https://$GITLAB_DOMAIN/api/v4/projects/import
Disabling direct upload and using background upload instead gets this to work. UI import also works.
What is the current bug behavior?
Receive a "Request entity too large" response from the API endpoint, despite increasing the max uploads size in the GitLab settings and setting the nginx client_max_body_size
to 0.
What is the expected correct behavior?
API imports should work as per above, instead of throwing the Request entity too large error
Relevant logs and/or screenshots
< HTTP/1.1 100 Continue
< HTTP/1.1 413 Request Entity Too Large
< Server: nginx
< Date: Fri, 14 Aug 2020 07:48:23 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 25
< Connection: keep-alive
< X-Content-Type-Options: nosniff
* HTTP error before end of send, stop sending
<
Request Entity Too Large
* Closing connection 0
workhorse:
{"correlation_id":"oZj4qu***","error":"entity is too large","level":"error","method":"POST","msg":"error","time":"2020-08-14T06:32:42Z","uri":"/api/v4/projects/import"}
Possible fixes
There seems to be an ErrEntityTooLarge thrown in workhorse when the remote FileStore responds with entity too large.