Hi All, I'm trying to setup Growthbook + Proxy, bu...
# ask-questions
b
Hi All, I'm trying to setup Growthbook + Proxy, but for some reason everytime I launch the proxy, growthbook stops working, throwing HTTP 502 errors. Env Vars on GB:
Copy code
PROXY_ENABLED:        1
PROXY_HOST_PUBLIC:    <https://growthbook-proxy.development.domain.com>
API_HOST:             <https://growthbook-api.development.domain.com>
APP_ORIGIN:           <https://growthbook.development.domain.com>
SECRET_API_KEY:       xxxxxxxxxxxxxxxxx
Env Vars on Proxy:
Copy code
GROWTHBOOK_API_HOST:  <https://growthbook-api.development.domain.com>
SECRET_API_KEY:       xxxxxxxxxxxxxxxxx
The proxy logs show the following:
Copy code
yarn run v1.22.19
$ wsrun -p <@U052WVA1MH6>/proxy -c start
<@U052WVA1MH6>/proxy
 | $ node dist/index.js
 | (node:47) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
 | (Use `node --trace-deprecation ...` to show where the warning was created)
 | GrowthBook proxy running over HTTP1.1, port 3300
 | {"level":40,"time":1721983880775,"pid":47,"hostname":"growthbook-proxy-55b7dc9466-5kqfq","msg":"connection polling: no connections found"}
 | {"level":30,"time":1721983880776,"pid":47,"hostname":"growthbook-proxy-55b7dc9466-5kqfq","msg":"using in-memory cache"}
 | {"level":50,"time":1721983939604,"pid":47,"hostname":"growthbook-proxy-55b7dc9466-5kqfq","msg":"connection polling error: status code is 502"}
And GB logs show the following
Copy code
{"level":30,"time":1721983880413,"pid":75,"hostname":"growthbook-78d789674b-cgb8x","req":{"id":52,"method":"GET","url":"/api/v1/sdk-connections?withProxy=1&limit=100&offset=0","query":{"withProxy":"1","limit":"100","offset":"0"},"params":{},"headers":{"host":"<http://growthbook-api.development.domain.com|growthbook-api.development.domain.com>","user-agent":"GrowthBook Proxy","x-amzn-trace-id":"Root=1-66a36388-04d4b108646cc7ca134ce017","x-forwarded-for":"10.30.80.211","x-forwarded-host":"<http://growthbook-api.development.domain.com|growthbook-api.development.domain.com>","x-forwarded-port":"80","x-forwarded-proto":"http","x-forwarded-server":"traefik-db9d84ffc-vgcw4","x-real-ip":"10.30.80.211"},"remoteAddress":"::ffff:10.30.87.241","remotePort":33550},"organization":{"id":"org_em7e25lyg18k7e","name":"Super Journey Testing"},"apiKey":"SECRET_API_KEY","organization":{"id":"org_em7e25lyg18k7e","name":"Super Journey Testing"},"apiKey":"SECRET_API_KEY","res":{"statusCode":200,"headers":{"ratelimit-limit":60,"ratelimit-remaining":59,"ratelimit-reset":37,"content-type":"application/json; charset=utf-8","content-length":"95","vary":"Accept-Encoding"}},"responseTime":18,"msg":"request completed"}
{"level":30,"time":1721984059622,"pid":75,"hostname":"growthbook-78d789674b-cgb8x","req":{"id":53,"method":"GET","url":"/api/v1/sdk-connections?withProxy=1&limit=100&offset=0","query":{"withProxy":"1","limit":"100","offset":"0"},"params":{},"headers":{"host":"<http://growthbook-api.development.domain.com|growthbook-api.development.domain.com>","user-agent":"GrowthBook Proxy","x-amzn-trace-id":"Root=1-66a3643b-506535c529ae45b7454f18ea","x-forwarded-for":"10.30.77.193","x-forwarded-host":"<http://growthbook-api.development.domain.com|growthbook-api.development.domain.com>","x-forwarded-port":"80","x-forwarded-proto":"http","x-forwarded-server":"traefik-db9d84ffc-hbg4g","x-real-ip":"10.30.77.193"},"remoteAddress":"::ffff:10.30.79.44","remotePort":42874},"organization":{"id":"org_em7e25lyg18k7e","name":"Super Journey Testing"},"apiKey":"SECRET_API_KEY","organization":{"id":"org_em7e25lyg18k7e","name":"Super Journey Testing"},"apiKey":"SECRET_API_KEY","res":{"statusCode":200,"headers":{"ratelimit-limit":60,"ratelimit-remaining":59,"ratelimit-reset":38,"content-type":"application/json; charset=utf-8","content-length":"95","vary":"Accept-Encoding"}},"responseTime":16,"msg":"request completed"}
The SECRET_API_KEY is the same on both containers. The screenshot attached is what the browser shows when the proxy is running. As soon as I stop the Proxy, Growthbook works fine again. Any idea/suggestion?
h
Can you clarify what you mean by GrowthBook stops working? Does the GB app crash/exit? Or do your SDK integrations which communicate with the GB app fail? A 502 typically means some sort of networking / firewall issue, so I'd check that each node is able to ping the other. You can also see if the https://growthbook-proxy.development.domain.com/healthcheck endpoint works when calling it directly
b
Thanks @happy-autumn-40938 Checking the healthcheck URL shows this:
But if I refresh I occasionally get a 502 on that too.
r
Hi Kevin, checking in on this. Were you able to locate the cause of the 502 errors?
141 Views