pezzolabs / pezzo

🕹️ Open-source, developer-first LLMOps platform designed to streamline prompt design, version management, instant delivery, collaboration, troubleshooting, observability and more.
https://pezzo.ai
Apache License 2.0
2.45k stars 202 forks source link

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

Closed abhinav-koodoo closed 2 months ago

abhinav-koodoo commented 4 months ago

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

johnnyoshika commented 4 months ago

I'm seeing the same.

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

dmthomson commented 4 months ago

Same

nsvrana commented 4 months ago

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

LouisLecouturier commented 4 months ago

Any solutions ?

abhinav-koodoo commented 4 months ago

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

nsvrana commented 4 months ago

I looked at all the .env files in the previous commits and only a few were not empty. I moved the few environment variables into my docker compose instead. The application still would not start after that and I haven’t spent more time troubleshooting.

I don’t think there is much focus on the self-hosting aspect.


From: Abhinav Das @.> Sent: Wednesday, June 5, 2024 8:22:05 AM To: pezzolabs/pezzo @.> Cc: Nicholas Vrana @.>; Mention @.> Subject: Re: [pezzolabs/pezzo] Asks for .env file when there's nothing like that in the documentation (Issue #302)

@LouisLecouturierhttps://github.com/LouisLecouturier one option may be to revert to before the breaking commit that @nsvranahttps://github.com/nsvrana identified. Haven't tested it myself though.

— Reply to this email directly, view it on GitHubhttps://github.com/pezzolabs/pezzo/issues/302#issuecomment-2149698959, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABAH3O24Z2Q37RWO277NYUTZF37G3AVCNFSM6AAAAABH4GYRFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGY4TQOJVHE. You are receiving this because you were mentioned.Message ID: @.***>

NoDataFound commented 4 months ago

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 commented 3 months ago

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

dumbsheep1990 commented 3 months ago

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 commented 3 months ago

image

dumbsheep1990 commented 3 months ago

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

dumbsheep1990 commented 3 months ago

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 commented 2 months ago

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 commented 2 months ago

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:

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 commented 2 months ago

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 commented 1 month ago

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 https://github.com/pezzolabs/pezzo/blob/938bf61125ed06174cf55196d99b89695115f873/docker-compose.infra.yaml#L78 with POSTGRES_CONNECTION_URI: postgres://postgres:postgres@postgres:5432/supertokens.

  2. Next, remove this line https://github.com/pezzolabs/pezzo/blob/938bf61125ed06174cf55196d99b89695115f873/docker-compose.infra.yaml#L1 , 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. :)