pezzolabs/pezzo

Problem getting the app running locally

grski opened this issue · 20 comments

grski commented

Report

First of all - awesome stuff!

I followed the insctruction from the docs and from the README.
On top of that I've copied the envs from server and console into .env file at the root.
Tried runnign both through:
docker-compose -f docker-compose.infra.yaml up
npx nx serve server npx nx serve console

and just docker compose up

in both cases after login i'm facing an error when trying to get to the console:

Expected behavior

No response

Steps to reproduce the problem

  1. bring the app up locally
  2. signup
  3. try to access localhost:4200

Logs (if applicable)

redacted

Pezzo version

latest git clone

How do you use Pezzo?

Docker Compose

Thanks for reporting! Based on the details provided, it seems that you mixed between the instructions of setting up Pezzo in development mode VS spinning up the working stack for usage only. Which means we should probably improve the docs.

What is your goal? Do you want to modify the code? Or just run it locally and experiment?

grski commented

@arielweinberger
Just want to get it up and running so I can later learn how to deploy it.

I first tried the full docker appoach:

  1. tried docker compose up, but that got me an error about .env.local which was not present (at the root dir level) so i created one by copying .env contents from server and console
  2. then it worked, the services started properly
  3. I was able to signup but after trying to log in, I got this:
[{"message":"Forbidden","locations":[{"line":2,"column":3}],"extensions":{"code":"FORBIDDEN"}}],"data":null,"status":200,"headers":{}},"request":{"query":"query GetOrg($data: OrganizationWhereUniqueInput!, $includeInvitations: Boolean = false, $includeMembers: Boolean = true) {\n organization(data: $data) {\n id\n name\n members [u/include](https://www.reddit.com/u/include/)(if: $includeMembers) {\n id\n role\n user {\n id\n name\n email\n }\n }\n invitations [u/include](https://www.reddit.com/u/include/)(if: $includeInvitations) {\n id\n email\n role\n invitedBy {\n photoUrl\n }\n }\n }\n}","variables":{"data":{"id":"clorncfeu0000n70h9749mixa"},"includeMembers":false,"includeInvitations":false}}}

after that I brough down the docker containers, tried to set it up locally

  1. docker compose up for infra
  2. migrations
  3. run server & console

and i got the same error this way
Thanks for the response!

grski commented

also if you help me out with that I'd be happy to contribute back by improving the readme or docs if I can :)

Cool! Let's stick to the first path of just running docker-compose up. After doing that, can you please inspect the compose stack and make sure all services are up and running (green)?

Also, can you share the logs coming from the server container in the stack?

Update: I think this is caused by an issue with signing up/in via email and password (vs SSO using Google). Will continue to investigate.

grski commented

So, let's start from the start:

git clone https://github.com/pezzolabs/pezzo.git
Cloning into 'pezzo'...
remote: Enumerating objects: 8493, done.
remote: Counting objects: 100% (3772/3772), done.
remote: Compressing objects: 100% (1798/1798), done.
remote: Total 8493 (delta 2433), reused 2537 (delta 1914), pack-reused 4721
Receiving objects: 100% (8493/8493), 27.11 MiB | 24.02 MiB/s, done.
Resolving deltas: 100% (4859/4859), done.
cd pezzo
docker compose up
Failed to load /Users/grski/dev/pezzo/.env.local: open /Users/grski/dev/pezzo/.env.local: no such file or directory
cat apps/server/.env >> .env.local
cat apps/console/.env >> .env.local
cat .env
cat .env.local
PINO_PRETTIFY="true"
DATABASE_URL=postgresql://postgres:postgres@localhost:5433/pezzo
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"

then docker ps:

CONTAINER ID   IMAGE                                           COMMAND                   CREATED              STATUS                        PORTS                                                                                                      NAMES
29d72e33f6b1   ghcr.io/pezzolabs/pezzo/console:latest          "./scripts/entrypoin…"    About a minute ago   Up About a minute             80/tcp, 0.0.0.0:4200->8080/tcp, :::4200->8080/tcp                                                          pezzo-pezzo-console-1
2bca6bd8e645   ghcr.io/pezzolabs/pezzo/server:latest           "node main.js"            About a minute ago   Up About a minute (healthy)   0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                                                  pezzo-pezzo-server-1
a808ada94058   opensearchproject/opensearch-dashboards:2.5.0   "./opensearch-dashbo…"    About a minute ago   Up About a minute (healthy)   0.0.0.0:5601->5601/tcp, :::5601->5601/tcp                                                                  opensearch-dashboards
a041e688a8ef   supertokens/supertokens-postgresql:5.0          "docker-entrypoint.s…"    About a minute ago   Up About a minute (healthy)   0.0.0.0:3567->3567/tcp, :::3567->3567/tcp                                                                  pezzo-supertokens-1
a2e7cb5048c7   redis/redis-stack-server:7.2.0-v0               "/entrypoint.sh"          About a minute ago   Up About a minute (healthy)   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                                  redis-stack-server
b1cadfa3f546   opensearchproject/opensearch:2.5.0              "./opensearch-docker…"    About a minute ago   Up About a minute (healthy)   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 9300/tcp, 0.0.0.0:9600->9600/tcp, :::9600->9600/tcp, 9650/tcp   opensearch-node1
a07b136255fa   postgres:15-alpine3.17                          "docker-entrypoint.s…"    About a minute ago   Up About a minute (healthy)   0.0.0.0:5433->5432/tcp, :::5433->5432/tcp                                                                  pezzo-postgres-1
538db706616d   nsmithuk/local-kms:latest                       "/bin/sh -c 'echo \"S…"   About a minute ago   Up About a minute             0.0.0.0:9981->9981/tcp, :::9981->9981/tcp 

meaning all is up and running.

grski commented

Then I go through signup - that works. When I click the 'signup' the requests pass but all I see is:
image

I started experiencing the same issue.

grski commented

Any update here? Can I help in any way?

Hey folks, I'm still investigating the root cause. It's pretty recent. If you want to run Pezzo and try it out, I suggest trying v0.6.9 (in the compose files), prior to a recent update we've made, where this is a non issue. Upgrading once fixed should be straightforward - there are no breaking changes. Sorry about that.

grski commented

@arielweinberger thank you, not a problem at all!

@grski @arielweinberger Hello guys, any updates in this issue? I faced the issue even with v0.6.9 !

@grski @arielweinberger Hello Folks, Do we have any update here ?

@dmockingbird551 I have tried to reproduce the issue and failed. Since it was created some things have changes. Can you try to see if it still happens to you and share new logs?
I will try to help as much as possible

@Hicham-azer fyi

@ranst91 Getting the same issue

> add_bins_new % git clone https://github.com/pezzolabs/pezzo.git
Cloning into 'pezzo'...
remote: Enumerating objects: 9135, done.
remote: Counting objects: 100% (205/205), done.
remote: Compressing objects: 100% (149/149), done.
remote: Total 9135 (delta 67), reused 142 (delta 50), pack-reused 8930
Receiving objects: 100% (9135/9135), 29.56 MiB | 8.87 MiB/s, done.
Resolving deltas: 100% (5363/5363), done.

> add_bins_new % cd pezzo

> pezzo % docker compose up

WARN[0000] The "SUPERTOKENS_DATABASE_URL" variable is not set. Defaulting to a blank string.
WARN[0000] /Users/deepak/add_bins_new/pezzo/docker-compose.infra.yaml: `version` is obsolete
env file /Users/deepak/add_bins_new/pezzo/.env not found: stat /Users/deepak/add_bins_new/pezzo/.env: no such file or directory
> pezzo %

This log seems to happen because of missing .env file.
This section of the readme was updated to reflect this requirement:
https://github.com/pezzolabs/pezzo?tab=readme-ov-file#set-up-the-environment-files

Can we please fix this issue ? I'm not able to use ( I see similar problems in running locally in other threads) this awesome library because of these issues.

@dmockingbird551 use the .env.example file to create a .env (and possibly also a .env.docker) files (include your actual credentials in the new files)

If you are still unable to use, the logs should tell a different story, feel free to post the new errors here