Skip to content
Snippets Groups Projects

Fix temp file being deleted after the request while importing a GitLab project

Merged James Lopez requested to merge fix/gitlab-import-project-file-fix into master

Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151

In production, the temporary uploaded file is getting deleted straight after the request so the Sidekiq worker is unable to find it in /tmp

Also, improved erroring/logging of this situation.

Merge request reports

Pipeline #3582873 passed

Pipeline passed for c3b6eadc on fix/gitlab-import-project-file-fix

Approval is optional

Merged by avatar (Apr 23, 2025 3:45pm UTC)

Merge details

  • Changes merged into master with 07ea22e5.
  • Deleted the source branch.

Pipeline #3583171 passed

Pipeline passed for 07ea22e5 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
10 10 end
11 11
12 12 def execute
13 Gitlab::ImportExport::FileImporter.import(archive_file: @archive_file,
14 shared: @shared)
15 if check_version! && [project_tree, repo_restorer, wiki_restorer, uploads_restorer].all?(&:restore)
13 if import_file && check_version! && [project_tree, repo_restorer, wiki_restorer, uploads_restorer].all?(&:restore)
16 14 project_tree.restored_project
17 15 else
18 16 raise Projects::ImportService::Error.new(@shared.errors.join(', '))
19 17 end
18
19 remove_import_file
Please register or sign in to reply
Loading