strong-magazine-72005
10/31/2023, 1:13 PM| {"level":50,"time":1698754816784,"pid":43,"hostname":"localhost","err":{"type":"SyntaxError","message":"Unexpected token < in JSON at position 0","stack":"SyntaxError: Unexpected token < in JSON at position 0\n at JSON.parse (<anonymous>)\n at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)\n at successSteps (node:internal/deps/undici/undici:6636:27)\n at node:internal/deps/undici/undici:1236:60\n at node:internal/process/task_queues:140:7\n at AsyncResource.runInAsyncScope (node:async_hooks:203:9)\n at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"},"msg":"polling error"}
Additionally, on inspecting the website's network tabs, the API calls are successful through the proxy URL. However, all eventstream requests are failing, displaying "No channel found."
Interestingly, when I use the normal Growthbook URL instead of the proxy, the eventstream works without issues.
I'd appreciate any insights or guidance on this matter. I have attached some screenshots.
Thank you.rhythmic-agent-34208
10/31/2023, 1:13 PMfresh-football-47124
brief-honey-45610
10/31/2023, 11:55 PMhappy-autumn-40938
11/01/2023, 12:10 AMstrong-magazine-72005
11/01/2023, 2:18 AMhttps
( it will always be redirected to https even with http 0)
I can see env variables to let growthboob proxy handle SSL termination, but it wants a CERT and Key.
As I have mentioned above, cloud run ( the service I am using ) supports streaming data
How do you suggest I approach this?happy-autumn-40938
11/01/2023, 5:03 PM<https://api.growthbook.io>
, but not sure if this makes a real difference.strong-magazine-72005
11/02/2023, 4:40 AM{
"level": 50,
"time": 1698901060057,
"pid": 43,
"hostname": "localhost",
"msg": "connection polling error: status code is 400"
}
which persists in browser network tab as well, when hitting below url
<https://proxy.growthbook.houseofmath.com/sub/sdk-Zy6VD3oefJVPa4qZ>
happy-autumn-40938
11/02/2023, 6:11 AMNODE_TLS_REJECT_UNAUTHORIZED=0
environment variable on the proxy to see if it helps. On this point, I realized there is a bug with this parameter and have just pushed a proxy update (v1.1.3) ... it might be good to update to this version. If you did want to try terminating SSL it definitely gets trickier: You'd need to string encode the contents of your .pem files into the HTTPS_KEY
and HTTPS_CERT
env vars.strong-magazine-72005
11/02/2023, 6:15 AMhappy-autumn-40938
11/02/2023, 6:20 AMstrong-magazine-72005
11/02/2023, 6:20 AM"msg":"connection polling error
happy-autumn-40938
11/02/2023, 6:23 AMstrong-magazine-72005
11/02/2023, 6:24 AMNODE_TLS_REJECT_UNAUTHORIZED=0
happy-autumn-40938
11/02/2023, 6:24 AMstrong-magazine-72005
11/02/2023, 6:28 AMhappy-autumn-40938
11/02/2023, 6:36 AMapiHost
to "<https://cdn.growthbook.io>"
and everything should work just fine. As long as your SDK is able to make a successful call to the /api/features endpoint (either on cdn.growthbook.io or on your private proxy url) then all your experiments & flags will run fine.strong-magazine-72005
11/02/2023, 6:39 AMhappy-autumn-40938
11/02/2023, 6:43 AMstrong-magazine-72005
11/02/2023, 6:45 AMhappy-autumn-40938
11/02/2023, 6:46 AMbackgroundSync: false
into the context.strong-magazine-72005
11/02/2023, 6:47 AMhappy-autumn-40938
11/02/2023, 6:49 AMstreamingHost: <https://cdn.growthbook.io>
into the SDK context (and remove the backgroundSync: false part)strong-magazine-72005
11/02/2023, 6:51 AMhappy-autumn-40938
11/02/2023, 6:51 AM