SonarQube Not Connecting with Github

Validate Github on ALM Gateway Timeout

Hello,
I am having some problems integrating Github into my SonarQube instance.

I have followed all the necessary steps in order to connect with GitHub. I followed everything from this doc.

When I click “save configuration” or “check configuration”, the API call https://sonar.mycustomdomain.com/api/alm_settings/validate?key=<key> simply fails with a 502 gateway timeout (after 30 seconds).

While the documentation tells you to put as a callback https://sonar.mycustomdomain.com, the actual sonar instance tells me to also add /oauth2/callback, becoming https://sonar.mycustomdomain.com/oauth2/callback. I have tried both with and without the /oauth2/callback with no success.

SonarQube Info

Edition: Developer
Version: 8.9 from Docker hub using image lts-developer

Deployed with CloudFormation using this tutorial

My current GH App settings:

Homepage URL: https://www.sonarqube.org
Callback URL: https://sonar.mycustomdomain.com/oauth2/callback
Webhook URL: https://sonar.mycustomdomain.com

My current Sonar Instance settings:

sonar.core.serverBaseURL_property: https://sonar.mycustomdomain.com

Any help would be greatly appreciated, I cant figure out what im doing wrong!

1 Like

Hi,

Welcome to the community!

What’s your SonarQube version?

 
Ann

Hello! Thanks for reaching out!

Im using version 8.9 from Docker image lts-developer (Developer Edition)

Hi,

Thanks!

Can you verify whether this 502 is coming from SonarQube itself or is being passed through from GitHub? Your server logs should help you figure that out.

 
Ann

I really really hope this is helpful

2022-09-14 14:49:122022.09.14 18:49:12 WARN web[AYLndJyfhSmpMglCAZ/G][o.s.a.c.g.GithubApplicationClientImpl] Failed to request https://api.github.com/app
2022.09.14 18:49:12 WARN web[AYLndJyfhSmpMglCAZ/G][o.s.a.c.g.GithubApplicationClientImpl] Failed to request https://api.github.com/app
2022-09-14 14:49:12java.net.SocketTimeoutException: connect timed out
2022-09-14 14:49:12at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
2022-09-14 14:49:12at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
2022-09-14 14:49:12at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
2022-09-14 14:49:12at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
2022-09-14 14:49:12at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
2022-09-14 14:49:12at java.base/java.net.Socket.connect(Unknown Source)
2022-09-14 14:49:12at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:120)
2022-09-14 14:49:12at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
2022-09-14 14:49:12at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
2022-09-14 14:49:12at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
2022-09-14 14:49:12at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
2022-09-14 14:49:12at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
2022-09-14 14:49:12at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
2022-09-14 14:49:12at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
2022-09-14 14:49:12at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
2022-09-14 14:49:12at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
2022-09-14 14:49:12at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
2022-09-14 14:49:12at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)

Hi,

It looks like SonarQube is unable to talk to GitHub. You may need to check with your network folks and make sure SonarQube can get out to the internet.

 
HTH,
Ann

Thank you for confirming its a network issue on our end! Will check whats wrong with it

1 Like