https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
f

freezing-finland-88631

06/14/2022, 8:15 PM
I’ve just hosted Growthbook on AWS ECS. Previously I had created a few metrics / experiments when I was running the container locally, and had the local container pointing to a remote Mongo DB. When I moved to ECS, I’m noticing requests to the
/organization/definitions
API endpoint fail, and I’m seeing this in the container logs:
Copy code
Unexpected end of JSON input\n at JSON.parse (<anonymous>)\n at Object.decryptDataSourceParams (/usr/local/src/app/packages/back-end/dist/services/datasource.js:29:17)\n at Snowflake.setParams (/usr/local/src/app/packages/back-end/dist/integrations/Snowflake.js:11:36)\n at new SqlIntegration (/usr/local/src/app/packages/back-end/dist/integrations/SqlIntegration.js:17:14)\n at new Snowflake (/usr/local/src/app/packages/back-end/dist/integrations/Snowflake.js:9:1)\n at Object.getSourceIntegrationObject (/usr/local/src/app/packages/back-end/dist/services/datasource.js:69:15)\n at /usr/local/src/app/packages/back-end/dist/controllers/organizations.js:128:50\n at Array.map (<anonymous>)\n at /usr/local/src/app/packages/back-end/dist/controllers/organizations.js:127:38\n at Generator.next (<anonymous>)\n at fulfilled (/usr/local/src/app/packages/back-end/dist/controllers/organizations.js:5:58)","type":"Error","msg":"Unexpected end of JSON input"}
Per the docs I set
NODE_ENV
to
production
, and set a
JWT_SECRET
and
ENCRYPTION_KEY
. Could the fact that I saved the experiments without an encryption key when developing locally, and am trying to read those experiments in prod, be part of the issue?
f

future-teacher-7046

06/14/2022, 8:17 PM
Yes, it's the
ENCRYPTION_KEY
that's causing that error. The data source credentials were encrypted with one key and now it can't be decrypted
f

freezing-finland-88631

06/14/2022, 8:18 PM
I see, so does the local container generate an
ENCRYPTION_KEY
of its own if I don’t explicitly set one?
f

future-teacher-7046

06/14/2022, 8:18 PM
I think it uses the string
dev
by default
f

freezing-finland-88631

06/14/2022, 8:22 PM
I see. I tried setting to
dev
for now but saw:
Copy code
throw new Error("Cannot use ENCRYPTION_KEY=dev in production. Please set to a long random string.");
I’m happy to delete the experiment definitions from Mongo and start over if that’s easiest?
f

future-teacher-7046

06/14/2022, 8:23 PM
Yeah, unfortunately I think deleting the data source and metrics and adding them again is probably the easiest. We should build a better way to recover from that state since I imagine you're not the first one to have this problem
f

freezing-finland-88631

06/14/2022, 9:14 PM
cool no worries, not a huge deal to re-create and I was able to export most from the
config.yml
217 Views