splitio / split-synchronizer

Golang agent for Split SDKs
Other
16 stars 15 forks source link

Connection refused error when initialising Synchronizer but curl works fine #245

Open av-mandiant opened 10 months ago

av-mandiant commented 10 months ago

Split Synchronizer - Version: 5.4.0

Unable to use synchronizer service in kubernetes setup.

I'm getting connect-refused error from synchronizer container but if I exec inside the container and do a curl call to same URL it passes with HTTP 200 status code.

===Log snippet from container===

➜  ~/code git:(synchronizer_setup) $ kubectl logs -f split-synchronizer-87856ddf8-v7v9c          

     __      ____        _ _ _
    / /__   / ___| _ __ | (_) |_
   / / \ \  \___ \| '_ \| | | __|
   \ \  \ \  ___) | |_) | | | |_
    \_\ / / |____/| .__/|_|_|\__|
       /_/        |_|

Split Synchronizer - Version: 5.4.0 (18b8201) 
Split-Sync - DEBUG - 2023/10/27 00:14:48 client.go:60: [GET]  https://sdk.split.io/api/splitChanges?since=1698365688257
Split-Sync - DEBUG - 2023/10/27 00:14:48 client.go:64: Authorization [ApiKey]:  <api-key>
Split-Sync - DEBUG - 2023/10/27 00:14:48 client.go:73: Headers: map[Accept-Encoding:[gzip] Content-Type:[application/json] Splitsdkmachineip:[<ip>] Splitsdkmachinename:[<ip>] Splitsdkversion:[SplitSyncProducerMode-5.4.0]]
Split-Sync - ERROR - 2023/10/27 00:14:48 client.go:79: Error requesting data to API:  https://sdk.split.io/api/splitChanges?since=1698365688257 Get "https://sdk.split.io/api/splitChanges?since=1698365688257": dial tcp 151.101.3.9:443: connect: connection refused
Split-Sync - ERROR - 2023/10/27 00:14:48 http_fetchers.go:55: Error fetching split changes  Get "https://sdk.split.io/api/splitChanges?since=1698365688257": dial tcp 151.101.3.9:443: connect: connection refused
Split-Sync - ERROR - 2023/10/27 00:14:48 main.go:73: Failed to initialize the split sync:  initialization error: invalid SDK key

===Output from CURL===

➜  ~/code git:(synchronizer_setup) $ kubectl exec -it split-synchronizer-68d9d75f75-c99pk -- bash
split-synchronizer-68d9d75f75-c99pk:/# curl -i  https://sdk.split.io/api/splitChanges?since=1698365757211 -H "Authorization: Bearer $SPLIT_SYNC_APIKEY"
HTTP/2 200 
content-type: application/json; charset=utf-8
..<lot of other headers>...
date: Fri, 27 Oct 2023 00:39:33 GMT
content-length: 56

{"till":1698365757211,"since":1698365757211,"splits":[]}split-synchronizer-68d9d75f75-c99pk:/# 
exit
agustinona commented 10 months ago

Hi @av-mandiant a connection refused error would indicate some kind of networking issue. Are you running a networking sidecar (like istio) for your container or is there any other network provisioning that needs to complete upon spinning up the container before making requests?