1

I am trying to migrate my repository from gitlab.com to my newly installed self-hosted Gitlab which is on my company's internal infrastructure - gitlab-private. I was working on gitlab.com but now we have got out own gitlab installed on-premise so instead of creating new repo I want to import all the projects.

I have tried to follow these steps https://docs.gitlab.com/ee/integration/gitlab.html to integrate my gitlab-private to gitlab.com. Once we done with all the steps, we see a option of signing via gitlab.com on the sign-in page. And when i try to sign-in to my it gives a pop-up asking for authorisation and when i click allow, it loads for sometime and then i get the 500 error.

I am not really able to understand what is wrong here. I checked the logs and nothing is there except this -

Rack::Timeout::RequestTimeoutException (Request ran for longer than 60000ms):

config/initializers_before_autoloader/100_patch_omniauth_oauth2.rb:11:in `callback_phase'
lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
lib/gitlab/metrics/transaction.rb:61:in `run'
lib/gitlab/metrics/rack_middleware.rb:16:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
ee/lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/multipart.rb:140:in `call'
lib/gitlab/middleware/read_only/controller.rb:51:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:60:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'

==> /var/log/gitlab/gitlab-workhorse/current <==
{"correlation_id":"ddre45456f","duration_ms":60013,"host":"gitlab-private","level":"info","method":"GET","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"127.0.0.1:0","remote_ip":"127.0.0.1","status":500,"system":"http","time":"2020-09-23T20:24:12+01:00","uri":"/users/auth/gitlab/callback?code=dsjkfbdsbjhsdbhvbsnvhsvbdhjvsdfgfdgfdu0026state=sdfgfsfgsdfdsfgdfgsfdgdfgd","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36","written_bytes":2926}

==> /var/log/gitlab/nginx/gitlab_access.log <==
10.9.12.224 - - [23/Sep/2020:20:24:12 +0100] "GET /users/auth/gitlab/callback?code=dsjkfbdsbjhsdbhvbsnvhsvbdhjvsdfgfdgfdu0026state&state=sdfgfsfgsdfdsfgdfgsfdgdfgd HTTP/1.1" 500 2926 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36" -

NOTE - my gitlab-private instance does not have any external connectivity to the outside world

Let me know if someone can advice.

mikita agrawal
  • 571
  • 1
  • 12
  • 27

1 Answers1

0

If you have no external connectivity such a integration is not possible.

What you are trying to achieve here is an oAuth2 SSO. For this to work your instance has to be reachable from the oAuth2 provider, which is Gitlab.com in your case. Further your instance has to be able to reach Gitlab.com to do the necessary handshakes.

As you are trying only to migrate the projects it will be much easier to simply export your project on Gitlab.com and then import it again on your private instance.

secustor
  • 3,001
  • 2
  • 14
  • 20