Problem
Failed to create VCS connection to Gitlab CE
Error shows:
Error
There was a problem connecting the OAuth client to the VCS provider.
Please verify the URL credentials and permissions of the OAuth application and try again
Cause
-
Error seen in logs is different than the usual error of VCS creation where it shows decode issue with ruby library
- From container output <tfe-atlas>
docker logs tfe-atlas
2023-02-10 12:35:53 [ERROR] [591ec8ff-a1da-4f33-b7ea-019ef6350ba4] exception=Gitlab::Error::Parsing message=The response is not a valid JSON backtrace
=["/app/vendor/bundle/ruby/2.7.0/gems/gitlab-4.18.0/lib/gitlab/request.rb:38:in `rescue in decode'"
"/app/vendor/bundle/ruby/2.7.0/gems/gitlab-4.18.0/lib/gitlab/request.rb:35:in `decode'"
"/app/vendor/bundle/ruby/2.7.0/gems/gitlab-4.18.0/lib/gitlab/request.rb:19:in `parse'"
/lib/action_controller/metal.rb:190:in `dispatch'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_controller/metal.rb:254:in `dispatch'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:33:in `serve'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:49:in `serve'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:50:in `block in serve'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:32:in `each'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/journey/router.rb:32:in `serve'"
"/app/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:842:in `call'"
"/app/vendor/bundle/ruby/2.7.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202:in `call!'"
"/app/vendor/bundle/ruby/2.7.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169:in `call'"
"/app/vendor/bundle/ruby/2.7.0/gems/rack-attack-6.6.1/lib/rack/attack.rb:103:in `call'"
....
"/app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.12/lib/puma/server.rb:727:in `handle_request'"
"/app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.12/lib/puma/server.rb:476:in `process_client'"
"/app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.12/lib/puma/server.rb:332:in `block in run'"
"/app/vendor/bundle/ruby/2.7.0/gems/puma-4.3.12/lib/puma/thread_pool.rb:134:in `block in spawn_thread'"]
- From container output <tfe-nginx> which is showing code 502
docker logs tfe-nginx
202x-02-1xT14:35:04.716020198Z 10.160.253.68 - - [17/Feb/2023:14:35:04 +0000]
"GET /api/v2/organizations/org_name/workspaces?
fields%5Bworkspace%5D%5B%5D=current_run&fields%5Bworkspace%5D%5B%5D=latest_change_at&fields%5Bworkspace%5D%5B%5D=name&fields%5Bworkspace%5D%5B%5D=vcs_repo_identifier&fields%5Bworkspace%5D%5B%5D=locked&fields%5Bworkspace%5D%5B%5D=tag_names&fields%5Bworkspace%5D%5B%5D=project&fields%5Brun%5D%5B%5D=status&include=current_run&organization_name=org_name&page%5Bnumber%5D=1&page%5Bsize%5D=20&sort=name
HTTP/1.1" 502 552 "https://tfe01-fqdn/app/org-name/workspaces" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
Solutions:
- Following the install reference guide reconfiguring-the-proxy
- On the https://<tfe_instance_url>:8800/settings add hosts to `Proxy bypass`
- Restart TFE components
Additional Information
-
In some cases, you need to amend the configuration file as per this article