Skip to main content
Answered

Getting "User Not Found" error when creating a contact


  • New Participant
  • 2 replies

Hi,

Recently I have been noticing that we have been receiving an error_code of “not_found” when making a POST request to the /contacts endpoint (creating a contact).

This is surprising as I am not sure how this is possible when creating a contact (as opposed to updating one).

If it helps, an example request id for this 000bkte0pcsrns5hpus0, hopefully I am not just off-base but I was looking to understand how this might happen? I am not sure what this error code could mean when trying to create a contact.

Best answer by Jacob Cox

Hi @Smock !

That is a curious one. I looked through our logs around that request ID and can’t nail down why a 404 would be thrown. I did notice that the User was actually created at the same time that the call occurred. This makes me wonder, were you making 2 identical calls at the same time? Not sure why that would result in a 404 vs a 409 error, but I am seeing a few mentions of ‘duplicates’ in the logs.

View original
Did this topic help you find an answer to your question?

4 replies

Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • Answer
  • November 12, 2023

Hi @Smock !

That is a curious one. I looked through our logs around that request ID and can’t nail down why a 404 would be thrown. I did notice that the User was actually created at the same time that the call occurred. This makes me wonder, were you making 2 identical calls at the same time? Not sure why that would result in a 404 vs a 409 error, but I am seeing a few mentions of ‘duplicates’ in the logs.


  • Author
  • New Participant
  • 2 replies
  • November 13, 2023

Hi Jacob,

Thanks very much for getting back to me.

I was just looking into this - I found some old code of ours that was processing the same event at the same time and so looks to have been causing a race condition that tried to create the contact (which specifically was intended for the kind of user in our system that all the not_found errors seem to be happening for), and was wondering whether the not_found could actually have meant to have been a conflict.

I am in the process of tidying this up so will let you know how I get on with the results.


  • Author
  • New Participant
  • 2 replies
  • November 15, 2023

Hi again @Jacob Cox ,

Took a couple of days to get enough data but that does seem to have resolved the issue.

Would it be possible to have this erroneous error code looked at however? - I would like to update our code to better handle conflicts in general, but this is a bit more awkward when “not found” could also mean conflict in some scenarios.


Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • November 18, 2023

Hi @Smock !

Thanks for looking into that! I’m going to open an issue up with our team about this to make sure we are throwing the right error in these scenarios! Thanks for bringing that to our attention!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings