quenti-io / quenti

The open source Quizlet alternative.
https://quenti.io
GNU Affero General Public License v3.0
191 stars 22 forks source link

tRPC failed #266

Closed janareddyc7 closed 11 months ago

janareddyc7 commented 11 months ago

tRPC failed on recent.get: UNAUTHORIZED@quenti/next:dev: ❌ tse the ref parameter? RPC failed on recent.get: UNAUTHORIZED

do you know how to fix it

janareddyc7 commented 11 months ago

when i try to go to dashboard it says tRPC failed and routes me to login page

miapolis commented 11 months ago

Hi! By the looks of it you're not logged in when accessing that route. Did you properly configure the Google OAuth credentials and try signing in?

janareddyc7 commented 11 months ago

ya i did

janareddyc7 commented 11 months ago

@quenti/next:dev: ❌ tRPC failed on recent.get: UNAUTHORIZED @quenti/next:dev: ○ Compiling /api/auth/[...nextauth] ... @quenti/next:dev: ✓ Compiled /api/auth/[...nextauth] in 4.6s (4910 modules) @quenti/next:dev: Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter? @quenti/next:dev: ○ Compiling /auth/login ... @quenti/next:dev: ✓ Compiled /auth/login in 5.9s (5141 modules) @quenti/next:dev: ○ Compiling /api/trpc/[trpc] ... @quenti/next:dev: ✓ Compiled /api/trpc/[trpc] in 2.3s (2604 modules) @quenti/next:dev: ❌ tRPC failed on recent.get: UNAUTHORIZED @quenti/next:dev: ✓ Compiled in 5.3s (5478 modules)

janareddyc7 commented 11 months ago

It shows the skeleton loader on the dashboard then automaticly takes me in to the login page

janareddyc7 commented 11 months ago

is there any solution

janareddyc7 commented 11 months ago

Also why the env folder in packages contains a lot optional things

miapolis commented 11 months ago

I think I know what your issue might be. If you set up your oauth credentials properly, make sure you have a mysql database running and run yarn prisma db:push from the root directory. If NextAuth can't save your credentials to db it'll always throw unauthorized.

janareddyc7 commented 11 months ago

i use planetscale i already did that let me try again

miapolis commented 11 months ago

Also why the env folder in packages contains a lot optional things

There's a lot of other services Quenti relies on that technically won't prevent the app from starting. Cohere, Huggingface, R2, Resend and others are all optional but you'll have trouble using parts of the app that rely on them. https://github.com/quenti-io/quenti/issues/222#issuecomment-1793790236

janareddyc7 commented 11 months ago

i think hugginface is paid

miapolis commented 11 months ago

i think hugginface is paid

Right, which is why Quenti isn't all that useful in a local environment unless you're willing to pay all of the infra costs

janareddyc7 commented 11 months ago

thanks

janareddyc7 commented 11 months ago

what should the env values be for these SERVER_NAME USERS_BUCKET_NAME: USERS_BUCKET_URL: ASSETS_BUCKET_NAME: ASSETS_BUCKET_URL: ENABLE_EMAIL_WHITELIST:

janareddyc7 commented 11 months ago

GRAFANA_DASHBOARD_URL: STRIPE_ORG_MONTHLY_PRICE_ID: CLICKHOUSE_HOST: CLICKHOUSE_USER: CLICKHOUSE_PASSWORD

janareddyc7 commented 11 months ago

where do you get thesse values

miapolis commented 11 months ago

Currently undocumented, I'll address these briefly and close the issue since this is out of scope. You can create another issue if you'd like to request documentation, or open a discussion.

SERVER_NAME - used to distinguish between production and staging envs on vercel USERS_BUCKET_NAME - the name of the Cloudflare R2 bucket used for storing user assets (profile pictures, etc.) USERS_BUCKET_URL - url of the users bucket ASSETS_BUCKET_NAME - name of the r2 bucket for assets (org images, classes, term assets) ASSETS_BUCKET_URL - url of assets bucket ENABLE_EMAIL_WHITELIST - optionally enable an email whitelist to prevent external signups GRAFANA_DASHBOARD_URL - grafana dashboard url STRIPE_ORG_MONTHLY_PRICE_ID - stripe price id for a monthly subscription all of the clickhouse env vars should be self explanatory