Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asks for .env file when there's nothing like that in the documentation #302

Closed
abhinav-koodoo opened this issue May 17, 2024 · 16 comments · Fixed by #307
Closed

Asks for .env file when there's nothing like that in the documentation #302

abhinav-koodoo opened this issue May 17, 2024 · 16 comments · Fixed by #307
Labels
bug Something isn't working

Comments

@abhinav-koodoo
Copy link

Report

After following the steps from the documentation, I encounter the following error:

env file /Users/whatever/work/experiments/pezzo/.env not found: stat /Users/whatever/work/experiments/pezzo/.env: no such file or directory

Expected behavior

Expected it to run the containers necessary to run pezzo.

Steps to reproduce the problem

  1. Clone the pezzo repository
  2. Run cd pezzo
  3. Run docker compose up

Logs (if applicable)

> docker compose up

WARN[0000] The "SUPERTOKENS_DATABASE_URL" variable is not set. Defaulting to a blank string.
env file /Users/whatever/work/experiments/pezzo/.env not found: stat /Users/whatever/work/experiments/pezzo/.env: no such file or directory

Pezzo version

0.8.0

How do you use Pezzo?

Local Development Setup

@abhinav-koodoo abhinav-koodoo added the bug Something isn't working label May 17, 2024
@johnnyoshika
Copy link
Contributor

I'm seeing the same.

docker compose up -> pezzo/.env.docker not found
docker-compose up -> pezzo/.env not found

@dmthomson
Copy link

Same

@nsvrana
Copy link

nsvrana commented Jun 1, 2024

This was broken in commit, when the .env files were added to gitignore and deleted.

@LouisLecouturier
Copy link

Any solutions ?

@abhinav-koodoo
Copy link
Author

@LouisLecouturier one option may be to revert to before the breaking commit that @nsvrana identified. Haven't tested it myself though.

@nsvrana
Copy link

nsvrana commented Jun 5, 2024 via email

@NoDataFound
Copy link

Issue

$ sudo docker-compose -f docker-compose.infra.yaml up

WARN[0000] The "SUPERTOKENS_DATABASE_URL" variable is not set. Defaulting to a blank string. 
Failed to load pezzo/.env.docker: open pezzo/.env.docker: no such file or directory

Workaround

$ echo 'SUPERTOKENS_DATABASE_URL=' > pezzo/.env.docker

$ sudo docker-compose -f docker-compose.infra.yaml up
WARN[0000] The "SUPERTOKENS_DATABASE_URL" variable is not set. Defaulting to a blank string. 
[+] Running 56/7
 ⠹ postgres 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulling                           11.2s 
 ✔ local-kms 4 layers [⣿⣿⣿⣿]      0B/0B      Pulled                                5.1s 
 ✔ supertokens 9 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                         9.7s 
 ⠹ redis-stack-server 12 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulling            11.2s 
 ⠹ pezzo-prisma-migrate 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulling        11.2s 
 ⠹ clickhouse 7 layers [⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulling                          11.2s 
 ⠙ pezzo-clickhouse-migrate Pulling                                               11.2s 

@abhinav-koodoo
Copy link
Author

@NoDataFound My error looks different than yours. Missing .env vs. .env.docker

@dumbsheep1990
Copy link

file: docs/deployment/docker-compose.mdx

After I added the env.local file using the cat command according to the documentation in the above directory of the project, docker-compose -f docker-compose.infra.yaml ran successfully.

@dumbsheep1990
Copy link

image

@dumbsheep1990
Copy link

then cd apps/server and apps/console, cp .env.example to .env.

@dumbsheep1990
Copy link

Are you ready to close source? I modified a large number of dockerfile configuration files. The service started successfully, but when I access the homepage, I cannot create an account or register. There is no default account information in the official documents.

@foreveryh
Copy link

PINO_PRETTIFY="true"
DATABASE_URL=postgresql://postgres:postgres@postgres:5432/pezzo
SUPERTOKENS_CONNECTION_URI="http://supertokens:3567"
CONSOLE_HOST="http://pezzo-console:4200"
KAFKA_BROKERS="kafka:9092"
OPENSEARCH_URL="http://opensearch:9200"
REDIS_URL="redis://redis-stack-server:6379"

NX_BASE_API_URL="http://localhost:3000"
NX_SUPERTOKENS_API_DOMAIN="http://localhost:3000"
NX_SUPERTOKENS_WEBSITE_DOMAIN="http://localhost:4200"
NX_DEBUG_MODE="true"

@Kaiohz
Copy link

Kaiohz commented Jul 23, 2024

with this .env file :

PINO_PRETTIFY="true" SUPERTOKENS_CONNECTION_URI="http://localhost:3567" CONSOLE_HOST="http://localhost:4200" KAFKA_BROKERS="localhost:9092" OPENSEARCH_URL="http://localhost:9200" REDIS_URL="redis://localhost:6379"NX_BASE_API_URL="http://localhost:3000" NX_SUPERTOKENS_API_DOMAIN="http://localhost:3000" NX_SUPERTOKENS_WEBSITE_DOMAIN="http://localhost:4200" NX_DEBUG_MODE="true"

and this .env.docker file :

SUPERTOKENS_DATABASE_URL= DATABASE_URL=postgresql://postgres:postgres@localhost:5433/pezzo

i just let this line in the docker-compose:

env_file: - ./.env

i am finally able to launch the docker compose up command but still have a problem with prisma migrate that can't reach the database

thanks @NoDataFound for the clue on .env.docker

@ranst91
Copy link
Collaborator

ranst91 commented Jul 23, 2024

Thanks @NoDataFound, @foreveryh and the rest for reporting this and finding some ways around.
I have now finally set up a solution in the PR mentioned above

If you experience any issue after the solution is implemented, do let me know!

@DerekChia
Copy link

I had some trouble getting this to work but managed to overcome it. Here's what I did to get docker compose up running. I hope this helps whoever needs it.

  1. You will be greeted with the following warning.
❯ docker compose up
WARN[0000] The "SUPERTOKENS_DATABASE_URL" variable is not set. Defaulting to a blank string. 

The solution is to replace this line

POSTGRES_CONNECTION_URI: "${SUPERTOKENS_DATABASE_URL}"
with POSTGRES_CONNECTION_URI: postgres://postgres:postgres@postgres:5432/supertokens.

  1. Next, remove this line
    version: "3"
    , specifically version: "3" because it isn't needed to get rid of the warning.
WARN[0000] /Users/dc/Desktop/github/pezzo/docker-compose.infra.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
  1. Copy this file (https://github.com/pezzolabs/pezzo/blob/main/.env.example), rename it accordingly and place it on all the paths where it is complaining.
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/.env not found: stat /Users/dc/Desktop/github/pezzo/.env: no such file or directory
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/.env not found: stat /Users/dc/Desktop/github/pezzo/.env: no such file or directory
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/apps/proxy/.env not found: stat /Users/dc/Desktop/github/pezzo/apps/proxy/.env: no such file or directory
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/.env.docker not found: stat /Users/dc/Desktop/github/pezzo/.env.docker: no such file or directory
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/apps/console/.env not found: stat /Users/dc/Desktop/github/pezzo/apps/console/.env: no such file or directory
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/.env.local not found: stat /Users/dc/Desktop/github/pezzo/.env.local: no such file or directory
❯ docker compose up
env file /Users/dc/Desktop/github/pezzo/apps/server/.env.local not found: stat /Users/dc/Desktop/github/pezzo/apps/server/.env.local: no such file or directory
  1. Now, finally you will be able to run docker compose up successfully. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.