reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.34k stars 2.17k forks source link

Missing environment variables #6403

Closed yunda closed 2 years ago

yunda commented 2 years ago

Issue Description

Getting missing environment variables error while trying to start the app in Docker for the first time:

Missing environment variables:

    STRIPE_API_KEY: A private Stripe API key

I checked the reaction/.env file and it appears to be empty.

Full log:

> reaction-api@4.1.5 start

> node --experimental-modules --experimental-json-modules ./src/index.js

> reaction-api@4.1.5 start

> node --experimental-modules --experimental-json-modules ./src/index.js

(node:19) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time

(Use `node --trace-warnings ...` to show where the warning was created)

================================

 Missing environment variables:

    STRIPE_API_KEY: A private Stripe API key

 Exiting with error code 1

================================

npm notice 

npm notice New patch version of npm available! 8.3.0 -> 8.3.1

npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.3.1>

npm notice Run `npm install -g npm@8.3.1` to update!

npm notice 

(node:20) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time

(Use `node --trace-warnings ...` to show where the warning was created)

================================

 Missing environment variables:

    STRIPE_API_KEY: A private Stripe API key

 Exiting with error code 1

================================

(node:20) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time

(Use `node --trace-warnings ...` to show where the warning was created)

================================

 Missing environment variables:

    STRIPE_API_KEY: A private Stripe API key

 Exiting with error code 1

================================

> reaction-api@4.1.5 start

> node --experimental-modules --experimental-json-modules ./src/index.js

Steps to Reproduce

  1. git clone https://github.com/reactioncommerce/reaction-development-platform.git
  2. cd reaction-development-platform
  3. make

Versions

4.1.5

brent-hoover commented 2 years ago

@yunda The .env.example provided does provide this key (or a placeholder for it), did you copy that file over?

https://github.com/reactioncommerce/reaction/blob/ff37192ffa0fcef7fe069423f7ed00e1c01b869e/.env.example#L3

brent-hoover commented 2 years ago

Closing due to inactivity

timmoti commented 2 years ago

Hello.

I would like to report the same problem as well.

I tried:

  1. Copying the 3 variables as is in .env.example over to the supplied empty .env file
  2. Creating a stripe account and pointing the STRIPE_API_KEY variable to the secret test account API key.

When I try restarting the container reaction_api_1 via the docker desktop, I get the same Missing environment variables error in the logs.

Any ideas?