Skip to content

Gitea importer broken in 18.3+ due to infinite redirect loops

Summary

Gitea importer is completely broken since GitLab 18.3 due to infinite redirect loops and 500 errors, making it impossible to import Gitea projects.

Steps to reproduce

  1. Navigate to New ProjectImportGitea
  2. Enter any valid Gitea host URL and personal access token (you might not make it this far)
  3. Click "List your Gitea repositories"
  4. Observe that the 500
  5. Try to refresh and/or navigate to any other GitLab page - you'll get "This endpoint has been requested too many times. Try again later."
  6. Try to access /import/gitea/new again - likely you will get a 500 error

Example Project

Any Gitea instance with valid repositories. The issue occurs regardless of the Gitea server or repositories being imported.

What is the current bug behavior?

  • Gitea import page gets stuck in infinite redirect loop when trying to list repositories
  • Browser hits redirect limit and stops loading
  • User gets "This endpoint has been requested too many times. Try again later." error
  • Import page becomes completely inaccessible, returning 500 errors
  • Gitea imports are completely unusable

What is the expected correct behavior?

  • Gitea import should work as it did in GitLab versions prior to 18.3
  • Users should be able to list Gitea repositories and import them successfully
  • Rate limiting should not prevent normal usage of the import functionality
  • If rate limiting is triggered, users should be able to retry after a reasonable wait time

Relevant logs and/or screenshots

From auth_json.log on a self-managed instance it appears to be rate limited:

{"severity":"ERROR","time":"2025-09-09T02:04:32.594Z","correlation_id":"01K4P3FDBC9KNW7SC1QSNMW4TG","meta.caller_id":"Import::GiteaController#status","meta.feature_category":"importers","meta.organization_id":1,"meta.remote_ip":"101.186.160.40","meta.user":"root","meta.user_id":1,"meta.client_id":"user/1","message":"Application_Rate_Limiter_Request","env":"gitea_import_request_limit","remote_ip":"101.186.160.40","method":"GET","path":"/import/gitea/status","user_id":1,"username":"root"}

Browser developer tools show continuous redirects to the same endpoint until redirect limit is reached.

Output of checks

This bug affects GitLab.com and self-managed instances running version 18.3 and later (I've tested on 18.3.1).

Possible fixes

  1. Rate limit is too restrictive: I suspect that the current rate limit of 1 request per minute per user is too low for normal import workflow
  2. Redirect loop: The redirect_back: true parameter in the rate limit check causes infinite redirects when the Gitea import page polls the status endpoint
  3. No recovery mechanism: Once rate limited, users cannot recover even after waiting extended periods