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

MongoDB and clerk web hook error #15

Open
jerrymjw opened this issue Mar 30, 2024 · 24 comments
Open

MongoDB and clerk web hook error #15

jerrymjw opened this issue Mar 30, 2024 · 24 comments

Comments

@jerrymjw
Copy link

I found when I connect to webhook, clerk shows some error and mongoDB shows the data not come frome my data model. I don't know where it comes from.
mongoDB data error
model

clerk error

I'd appreciated if you can give me some feedback.

@Manubenakal
Copy link

Could you provide some more context and those are sample data in mongoDB.

@jezbravo
Copy link

jezbravo commented Apr 4, 2024

Hello, try this:
Go to your project in Vercel > Settings > Deployment Protection and set Vercel Authentication: Disabled.

@iyashjayesh
Copy link

Hello, try this: Go to your project in Vercel > Settings > Deployment Protection and set Vercel Authentication: Disabled.

This worked for me, thanks!

@hflournoy
Copy link

@iyashjayesh this didn't work for me, did you do anything else to resolve this?

@Teegreat
Copy link

Teegreat commented Apr 28, 2024

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

@yashchavda0
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

It won`t work. As there is no Problem with the connection to mongoDB

@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

It won`t work. As there is no Problem with the connection to mongoDB

Have you tried it or you're just saying?

I'm telling you what worked for me.

@jezbravo
Copy link

@iyashjayesh this didn't work for me, did you do anything else to resolve this?

Hello. If the problem is not with the connection to the database, you can try to delete the entire collection from the Mongo DB page and create it again from the code execution.

@yashchavda0
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

It won`t work. As there is no Problem with the connection to mongoDB

Have you tried it or you're just saying?

I'm telling you what worked for me.

I tried.
even I made the whole Database once again still same problem occured.

@mmnsrti
Copy link

mmnsrti commented May 13, 2024

its also gives me the same error in clerk dashboad and ive tried the mongodb access all ip method and the vercel method to Deployment Protection and set Vercel Authentication: Disabled. . what should i do to fix this error ?

@mmnsrti
Copy link

mmnsrti commented May 13, 2024

i found the solution
in the change the usename to userName declare type CreateUserParams = { clerkId: string; email: string; userName: string; firstName: string; lastName: string; photo: string; };
and also in clerk route.ts change the usename to userName const user = { clerkId: id, email: email_addresses[0].email_address, userName: username!, firstName: first_name, lastName: last_name, photo: image_url, }; do this and it will work as intended

@NoelLincoln
Copy link

i found the solution in the change the usename to userName declare type CreateUserParams = { clerkId: string; email: string; userName: string; firstName: string; lastName: string; photo: string; }; and also in clerk route.ts change the usename to userName const user = { clerkId: id, email: email_addresses[0].email_address, userName: username!, firstName: first_name, lastName: last_name, photo: image_url, }; do this and it will work as intended

Hi @mmnsrti , I need your help please. I am stuck on this issue. I have tried everything. Thank you in advance

@yashchavda0
Copy link

i found the solution in the change the usename to userName declare type CreateUserParams = { clerkId: string; email: string; userName: string; firstName: string; lastName: string; photo: string; }; and also in clerk route.ts change the usename to userName const user = { clerkId: id, email: email_addresses[0].email_address, userName: username!, firstName: first_name, lastName: last_name, photo: image_url, }; do this and it will work as intended

Tried, but not working!!

@saketsanadhya
Copy link

i am getting user not found

@umarfarzan
Copy link

i have the same issue someone assist, shows failed

@mmnsrti
Copy link

mmnsrti commented Jun 8, 2024

i found the solution in the change the usename to userName declare type CreateUserParams = { clerkId: string; email: string; userName: string; firstName: string; lastName: string; photo: string; }; and also in clerk route.ts change the usename to userName const user = { clerkId: id, email: email_addresses[0].email_address, userName: username!, firstName: first_name, lastName: last_name, photo: image_url, }; do this and it will work as intended

u can clone my repo and compare youor code to mine . if you couldnt make it right email me

@mmnsrti
Copy link

mmnsrti commented Jun 8, 2024

i am getting user not found

give more information

@lightcompass
Copy link

Hi, I encountered the same, but after debugging, I found the response from the clerk over Google Oauth is changed, there is no "username" and "photo" attribute.

at the codebase please look at the user model, it requires these 2 attributes to create a user.

my hotfix is to remove the "require" attribute, so my user.model.ts look like below

userName: {
    type: String,
  },
  photo: {
    type: String,
  },

@baradev
Copy link

baradev commented Jun 26, 2024

Hi everyone, I spent a lot of time on the project, but everything works well now! Feel free to check my repo or reach out to me for help. :)

@rossman22590
Copy link

getting user not found

@rossman22590
Copy link

Hi everyone, I spent a lot of time on the project, but everything works well now! Feel free to check my repo or reach out to me for help. :)

can you help?

@Sageikot001
Copy link

i found the solution in the change the usename to userName declare type CreateUserParams = { clerkId: string; email: string; userName: string; firstName: string; lastName: string; photo: string; }; and also in clerk route.ts change the usename to userName const user = { clerkId: id, email: email_addresses[0].email_address, userName: username!, firstName: first_name, lastName: last_name, photo: image_url, }; do this and it will work as intended

This didn't work and honestly it didn't make sense that it would, just had to try and it didn't.

@ShadowAdi
Copy link

I Tried Everything but still i got the same problem. I Changed my ip address and set Vercel Authentication: Disabled. Change the userId Thing but still not working. Does someone has any other solution

@Legit-Sam
Copy link

I found when I connect to webhook, clerk shows some error and mongoDB shows the data not come frome my data model. I don't know where it comes from. mongoDB data error model

clerk error

I'd appreciated if you can give me some feedback.

Pleasae can you share me your user.actions.ts file codes and also mongoose.ts codes please

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