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

Evently events platform. Can't get mongoDB and Clerk connection working #103

Open
alexeerma opened this issue Dec 27, 2023 · 25 comments
Open

Comments

@alexeerma
Copy link

Hello!

I have a problem, getting the MongoDB and Clerk connection working. As I create my user after deploying it on Vercel then in Clerk I can see the User under Users tab, but it does not show in the MongoDB collections. Also all the webhook message/event types show failed. I went over the secrets and everything multiple times, but still can't figure out the problem. When creating the new endpoint on Clerk I get the WEBHOOK_SECRET but after adding the new environment variable on Vercel I have to redeploy the app, but then the endpoint for the webhook changes..Might that be the problem? Any ideas?

@athishsn
Copy link

athishsn commented Jan 6, 2024

even i got stuck in the same situation, did you solve this? if yes, please share me how

@kotysky
Copy link

kotysky commented Jan 7, 2024

Same here!

@kotysky
Copy link

kotysky commented Jan 7, 2024

please ,check if the middleware.ts is the same in this link.

could be a problem with the public routes.

https://clerk.com/docs/users/sync-data

@kotysky
Copy link

kotysky commented Jan 9, 2024

this works for me!

@Ziad-Al
hace 2 semanas
​ @Jediknightcode I solved it by going to clerk dashboard, user&authentication, email,phone, username then I clicked on the setting icon beside Username and allowed the username required, then I did the same for the Personal information I allowed the first name and last name to be required, I guess by doing this the setting in clerk dashboard is aligned with the user model we created where these info are required for the user object to be created inside the database collection

@mustafakba
Copy link

Sorry but this is not working for me.
Has anyone solved the problem?

@kotysky
Copy link

kotysky commented Jan 10, 2024

Man,I solved the problem, please go to the video comments , and down there, look for the comment and You can see what I am telling to you, what I did different is in Vercel I disabled all the security requirements in security menu, I hope this can help to you.

@alexeerma
Copy link
Author

Still is not working for me, found the same answer, but after doing that and redoing all the steps, still can not get this to work..

@athishsn
Copy link

athishsn commented Jan 10, 2024 via email

@alexeerma
Copy link
Author

Hey! I still haven't I tried all of the above. Replaced files from the course repository, but that didn't work.

@Sethuramalingam-art
Copy link

Please help me also I can't able to fix. I tired more!

@sachinmaurya1
Copy link

hey guys same problem , my user is visible on clerk after sign up but unable to get in mongodb can anyone please guide ?

@hadcod3
Copy link

hadcod3 commented Mar 1, 2024

#103 (comment)

Hey guys, i have same problem and i have solved it, i just add ip address (0.0.0.0/0) as universal ip or make sure use current your ip address

@AlbinSony
Copy link

Man,I solved the problem, please go to the video comments , and down there, look for the comment and You can see what I am telling to you, what I did different is in Vercel I disabled all the security requirements in security menu, I hope this can help to you.

Is there any way I can contact you brother directly

@Flasky06
Copy link

Flasky06 commented Apr 5, 2024

Hello am experiencing

Man,I solved the problem, please go to the video comments , and down there, look for the comment and You can see what I am telling to you, what I did different is in Vercel I disabled all the security requirements in security menu, I hope this can help to you.

Is there any way I can contact you brother directly

@Flasky06
Copy link

Flasky06 commented Apr 5, 2024

Hello did you solve the problem

@gokusabu
Copy link

gokusabu commented Apr 5, 2024

Hello did you solve the problem

go to network access in the mongodb database settings and try editing the ip address to 0.0.0.0/0

@HosniHazem
Copy link

Guys i fixed by simply removing "/api/webhook/clerk" from ignoredRoutes in middleware.ts.

@Aung-IO
Copy link

Aung-IO commented Apr 16, 2024

I manually create a user for only testing purpose because I stuck the whole day.
_id
clerkId : " " (you can get all from clerk - user -view profile)
email
username
firstName
lastName
photo

by doing this, u can move to next steps. If I find another way I will comment later.. thanks

@Pratik-003
Copy link

Guys i fixed by simply removing "/api/webhook/clerk" from ignoredRoutes in middleware.ts.

bro can u help me i am not able to connect with my database can u help me please

@Pratik-003
Copy link

I manually create a user for only testing purpose because I stuck the whole day. _id clerkId : " " (you can get all from clerk - user -view profile) email username firstName lastName photo

by doing this, u can move to next steps. If I find another way I will comment later.. thanks

bro can u help me how to do this

@DanyGlez94
Copy link

I was able to create users and sync them to Mongo when login with github or google, but I had a problem when trying to register with an email. I founded out the solution, you need to go to your clerk dashboard, then to User & Authentication and make sure username is set to be required, the same with email and password, then, under personal information is little tricky, you need to toggle Name switch to the right and then click on the config icon on the right, it will open a modal where you need to specify name to be required, this is in order to be aligned to the schema model. This will fix it.

@NoelLincoln
Copy link

I was facing the same problem but eventually I solved it. Make sure the main branch has the working code. In my case, I had three branches; i.e Main, dev and add-events. Main and dev had linter errors and could not be deployed. Fortunately I had 'add-events' branch which was working properly. I had to delete main and dev then create them again this time merging with 'add-events'. You can check here.
Vercel will automatically update the changes if you deployed the app properly. Then finally double check if the environment variables are correct in the .env.local.

@mohammedyunus2002
Copy link

You can try removing the autentication in the vercel app settings -> under deployment protection turn of vercel authentication. i was getting 401 and webhooks were not working this change everything. and now is working as expected. This worked for me

@Vaibhav4228
Copy link

I am stuck here i Can't solve this issue I failed message in webhook how to fix I tried everything here is my discord if you have any solution pls let me know -
Annotation 2024-07-09 223440

@hunaidkhan
Copy link

The error happens when you use the same email id with which you have already signed in clerk. Try using a different one and it works perfectly.
The issue is because the oauth doesn't return an access token on the second login, only on the first. I am still trying to figure out a workaround.
Screenshot 2024-08-14 at 1 19 14 PM

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