Update ImportExportUploader workhorse_local_upload_path

Merged George Koltsov requested to merge georgekoltsov/fix-import-export-uploader into master

What does this MR do?

Currently Group Import API does not work on packaged installations due to ImportExportUploader.workhorse_local_upload_path returning /public/tmp/uploads directory to workhorse, when uploading a Group Export archive.

==> /var/log/gitlab/gitlab-workhorse/current <==
{"correlation_id":"hrkzWeU67Y5","error":"handleFileUploads: extract files from multipart: persisting multipart file: uploadLocalFile: mkdir \"/opt/gitlab/embedded/service/gitlab-rails/public/tmp/uploads\": mkdir /opt/gitlab/embedded/service/gitlab-rails/public/tmp: permission denied","level":"error","method":"POST","msg":"error","time":"2020-02-21T10:24:15Z","uri":"/api/v4/groups/import"}

When workhorse tries to create such directory, it fails, because of lacking permissions. git user that is used there does not have any write permissions in this directory except to uploads dir, which is a symlink to a gitlab/uploads folder.

We should be uploading tmp file uploads to /public/uploads/tmp/uploads instead.

This MR changes workhorse_local_upload_path to include uploads in the returned path. This is similar to what FileUploader has for it's workhorse local upload path.


Does this MR meet the acceptance criteria?


Availability and Testing


If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by George Koltsov