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

User data collection is not creating in mongodb #12

Open
adarshchhetri9 opened this issue Mar 3, 2024 · 11 comments
Open

User data collection is not creating in mongodb #12

adarshchhetri9 opened this issue Mar 3, 2024 · 11 comments

Comments

@adarshchhetri9
Copy link

Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

@MusaMasroor
Copy link

could you provide more context about the problem you're facing.

@Satora1
Copy link

Satora1 commented Mar 9, 2024

By checking the Vercel logs, I managed to locate the issue. It turned out that I didn't pass the WEBHOOK_SECRET variable in Vercel, and I also failed to update the webhook URL after restarting the server in Vercel. I fixed these errors, and now everything is working correctly.

@lounes213
Copy link

lounes213 commented Mar 16, 2024

i have problem with Sync Clerk data my webhooks show failed requests but on my cluster db the User Db is created with out data sync. thank you !

@alphaabhi
Copy link

I am unable to see the user data for the users I am logging within my mongoDb database. I have deployed everything correctly, even rechecked everything from MongoDb Url to webhook URL in my versel but I cannot just seem to figure out why can't I see the data of users logged in through userCreation in my MongoDb database.
If anybody could help out please , I don't want to get stuck after almost halfway through :(

@Manubenakal
Copy link

if the user is not being created inside the database, then you need to check whether you're running your app on local host or Vercel. The webhook secret key (Clerk) works when you host your app on Vercel. Go to clerk dashboard -> web hooks -> end points -> https://my-app.vercel.app/api/webhooks/clerk. make sure to host your app on vercel before creating this endpoint. after that try creating an account on imaginfy hosted at https://my-app.vercel.app/ .if you try to create an account on imaganify while running it on local host, the web hook won't work and the user created on clerk dashboard will not be stored inside mongo Db. hence causing the user not found error.

@abidhumza
Copy link

[GET] [middleware: "middleware"] / status=307
When running on production env, getting this error. Also getting this error log. I followed the same as shown in the video, tried all the options still dont understand what i am missing.

INFO: Clerk: The request to / is being redirected because there is no signed-in user, and the path is not included in ignoredRoutes or publicRoutes. To prevent this behavior, choose one of:

  1. To make the route accessible to both signed in and signed out users, add "/" to the publicRoutes array passed to authMiddleware
  2. To prevent Clerk authentication from running at all, pass ignoredRoutes: ["/((?!api|trpc))(_next.*|.+\.[\w]+$)", "/"] to authMiddleware
  3. Pass a custom afterAuth to authMiddleware, and replace Clerk's default behavior of redirecting unless a route is included in publicRoutes

For additional information about middleware, please visit https://clerk.com/docs/nextjs/middleware
(This log only appears in development mode, or if debug: true is passed to authMiddleware)
INFO: Clerk: The request to / is being redirected because there is no signed-in user, and the path is not included in ignoredRoutes or publicRoutes. To prevent this behavior, choose one of:

  1. To make the route accessible to both signed in and signed out users, add "/" to the publicRoutes array passed to authMiddleware
  2. To prevent Clerk authentication from running at all, pass ignoredRoutes: ["/((?!api|trpc))(_next.*|.+\.[\w]+$)", "/"] to authMiddleware
  3. Pass a custom afterAuth to authMiddleware, and replace Clerk's default behavior of redirecting unless a route is included in publicRoutes

@lounes213
Copy link

thank you ! it work only on hosted app not on localhost

@saadazghour
Copy link

Same things it's work only on hosted app @lounes213

@Teegreat
Copy link

The issue is coming from MongoDB as the application cannot access the database based on the IP address captured during the setup process of your DB. To fix this issue;

  1. Login to MongoDB
  2. Navigate to the Network Access Tab
  3. Delete all IP addresses listed
  4. Click on Add IP Addresses >> Add your current IP address
  5. Again, click on Add IP Addresses, this time you are to allow access from anywhere by simply typing this: 0.0.0.0/0

@AnshAtreja
Copy link

thank you ! it work only on hosted app not on localhost

@lounes213 in the video at 1:38:00, in localhost I could not see any user database being added, does it only show on the deployed version?

@yashchavda0
Copy link

if the user is not being created inside the database, then you need to check whether you're running your app on local host or Vercel. The webhook secret key (Clerk) works when you host your app on Vercel. Go to clerk dashboard -> web hooks -> end points -> https://my-app.vercel.app/api/webhooks/clerk. make sure to host your app on vercel before creating this endpoint. after that try creating an account on imaginfy hosted at https://my-app.vercel.app/ .if you try to create an account on imaganify while running it on local host, the web hook won't work and the user created on clerk dashboard will not be stored inside mongo Db. hence causing the user not found error.

it isn`t working for me.
Do you have any other way to solve the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests