Github import times out

I have 2 Gitlab servers set up almost identically, one being a test server and the other production. They are both on the current latest version and both are running in docker. On the test server I am able to import private repositories from github.com. It’s flakey but it works. On the production server, I press the “github” button, enter a token (unless cached) and after 1 minute it reports a 500 error. The logs indicate a timeout (see below). I have used tcpdump to establish that exchange is taking place to and from github.com, although being https I can’t see the contents. The two servers are on different networks but I have checked with IT and there are no firewall restrictions in place. The debugging isn’t very helpful as there doesn’t seem to be any way to see what requests are being sent to Github and what the responses are. Anyone else seen this and have any idea as to the cause?


gitlab | ==> /var/log/gitlab/gitlab-rails/production.log <==
gitlab |
gitlab | Rack::Timeout::RequestTimeoutException (Request ran for longer than 60000ms):
gitlab |
gitlab | lib/gitlab/octokit/middleware.rb:13:in call' gitlab | lib/gitlab/legacy_github_import/client.rb:145:in each_response_page’
gitlab | lib/gitlab/legacy_github_import/client.rb:137:in request' gitlab | lib/gitlab/legacy_github_import/client.rb:61:in method_missing’
gitlab | app/controllers/import/github_controller.rb:111:in client_repos' gitlab | app/controllers/import/github_controller.rb:37:in status’
gitlab | app/controllers/application_controller.rb:491:in set_current_admin' gitlab | lib/gitlab/session.rb:11:in with_session’
gitlab | app/controllers/application_controller.rb:482:in set_session_storage' gitlab | lib/gitlab/i18n.rb:55:in with_locale’
gitlab | lib/gitlab/i18n.rb:61:in with_user_locale' gitlab | app/controllers/application_controller.rb:476:in set_locale’
gitlab | lib/gitlab/error_tracking.rb:50:in with_context' gitlab | app/controllers/application_controller.rb:541:in sentry_context’
gitlab | app/controllers/application_controller.rb:469:in block in set_current_context' gitlab | lib/gitlab/application_context.rb:52:in block in use’
gitlab | lib/gitlab/application_context.rb:52:in use' gitlab | lib/gitlab/application_context.rb:20:in with_context’
gitlab | app/controllers/application_controller.rb:462:in set_current_context' gitlab | lib/gitlab/metrics/elasticsearch_rack_middleware.rb:24:in call’
gitlab | lib/gitlab/metrics/redis_rack_middleware.rb:22:in call' gitlab | lib/gitlab/middleware/rails_queue_duration.rb:29:in call’
gitlab | lib/gitlab/metrics/rack_middleware.rb:17:in block in call' gitlab | lib/gitlab/metrics/transaction.rb:54:in run’
gitlab | lib/gitlab/metrics/rack_middleware.rb:17:in call' gitlab | lib/gitlab/request_profiler/middleware.rb:17:in call’
gitlab | lib/gitlab/middleware/go.rb:20:in call' gitlab | lib/gitlab/etag_caching/middleware.rb:13:in call’
gitlab | lib/gitlab/middleware/multipart.rb:140:in call' gitlab | lib/gitlab/middleware/read_only/controller.rb:51:in call’
gitlab | lib/gitlab/middleware/read_only.rb:18:in call' gitlab | lib/gitlab/middleware/same_site_cookies.rb:27:in call’
gitlab | lib/gitlab/middleware/basic_health_check.rb:25:in call' gitlab | lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in call’
gitlab | lib/gitlab/middleware/request_context.rb:23:in call' gitlab | config/initializers/fix_local_cache_middleware.rb:9:in call’
gitlab | lib/gitlab/metrics/requests_rack_middleware.rb:60:in call' gitlab | lib/gitlab/middleware/release_env.rb:12:in call’

Update, I finally resolved this. The information in the logs was useless but I found a command line to do the import here: https://docs.gitlab.com/ee/administration/raketasks/github_import.html. This revealed that it couldn’t resolve api.github.com. It turned out that the DNS server I was using wasn’t behaving. I switched to one that did and the import now works fine.

1 Like

any actual solution for this. I’m facing the same issue and I don’t want to use cli import.

This issue happens if Gitlab can’t resolve/ping github.com and api.github.com