Hi Team, Connection between GB proxy and GB Api s...
# ask-questions
a
Hi Team, Connection between GB proxy and GB Api seems not smooth.
Copy code
"msg":"connection polling error: status code is 400"
when i try manually curl the GB Api
Copy code
curl -X GET <https://cdn.growthbook.io/api/v1/sdk-connections>\?withProxy\=1\&limit\=100\&offset\=0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $BEARER" \
-H "User-Agent: GrowthBook Proxy" --verbose
Output:
Copy code
<?xml version="1.0" encoding="UTF-8"?>
* Connection #0 to host <http://cdn.growthbook.io|cdn.growthbook.io> left intact
<Error><Code>InvalidArgument</Code><Message>Unsupported Authorization Type</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>Bearer secret_readonly_7GNSLiDqUbvCyndDbudC4cAmRNjV5taRXAGxpnw</ArgumentValue><RequestId>FDB6WQH4SQR40FM2</RequestId><HostId>opS43/LkqOhoMtvwDxviOtI1FOxyPMg5GhhM2rPSJd2iymSmL5Epdu8oUoWa97ZdpmwPKGaucuY=</HostId></Error>
Trying with secret key within https://app.growthbook.io/account/personal-access-tokens or https://app.growthbook.io/settings/keys seems not works, any help will appreciated. Thank you
a
Experiencing the same issue. Any help?
f
was it ever working?
@happy-autumn-40938 can you help when able?
h
Confirmed. The connection polling endpoint does not seem to be working when mixing a self-hosted proxy with GB Cloud API. Does the proxy still work for you? It should in theory still be able to proxy traffic even without being able to poll for connection changes? If not, there is one more thing you can try to get unblocked until we're able to investigate this further: There is a env var flag on the proxy called
CREATE_CONNECTIONS_FROM_ENV
that lets you manually seed the connections when the proxy boots (set to
"true"
or
"1"
). Then, you can pass in the connections you want to proxy using this format:
Copy code
CONNECTION.1.API_KEY="api_1234"
CONNECTION.1.SIGNING_KEY="secret_1234"

CONNECTION.2.API_KEY="api_abcd"
CONNECTION.2.SIGNING_KEY="secret_abcd"
CONNECTION.2.USE_ENCRYPTION="1"
CONNECTION.2.ENCRYPTION_KEY="enc_12345"

# etc...
Finally turn off
POLL_FOR_CONNECTIONS
so that you won't keep seeing "connection polling error" in the logs.
Update: Just noticed you are using
<https://cdn.growthbook.io/api/v1/sdk-connections>
. Can you instead try it with:
<https://api.growthbook.io/api/v1/sdk-connections>
(api.growthbook.io)?
a
Let me try to change the API and provide an update here shortly.
It works with https://api.growthbook.io/api/v1/sdk-connections. Thanks @happy-autumn-40938
🎉 1