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

Problem getting the app running locally #269

Open
grski opened this issue Nov 9, 2023 · 13 comments
Open

Problem getting the app running locally #269

grski opened this issue Nov 9, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@grski
Copy link

grski commented Nov 9, 2023

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

@grski grski added the bug Something isn't working label Nov 9, 2023
@arielweinberger
Copy link
Member

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
Copy link
Author

grski commented Nov 9, 2023

@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
Copy link
Author

grski commented Nov 9, 2023

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

@arielweinberger
Copy link
Member

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?

@arielweinberger
Copy link
Member

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
Copy link
Author

grski commented Nov 9, 2023

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
Copy link
Author

grski commented Nov 9, 2023

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

@grski
Copy link
Author

grski commented Nov 9, 2023

@webrulon
Copy link

I started experiencing the same issue.

@grski
Copy link
Author

grski commented Nov 11, 2023

Any update here? Can I help in any way?

@arielweinberger
Copy link
Member

arielweinberger commented Nov 12, 2023

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
Copy link
Author

grski commented Nov 12, 2023

@arielweinberger thank you, not a problem at all!

@Hicham-azer
Copy link

Hicham-azer commented Nov 23, 2023

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

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

No branches or pull requests

4 participants