Skip to main content
Solved

400 and CORS Errors on a Experiment Route

  • September 15, 2022
  • 1 reply
  • 964 views

Hey !

Since 1 or 2 weeks I start to have a CORS / 400 Error on a specific route which is:

https://api.lab.amplitude.com/sdk/vardata

It happens only in dev / staging env (both same API KEYS) where it doesn’t happen in my production env.

I tried a lot of stuff: generating new API KEYS, removing all staging experiments, updating SDK versions, changing pc, network but nothing seems to change that, it seems to be related to the staging project/deployment on Amplitude Experiment.

It’s really annoying for my devs and me as it’s spamming constantly the console and as a dev, having errors in the console is just frustrating.

If you have any clue on that subject, please help me, thanks! :)

Best answer by Yuanyuan Zhang

Update from @Liroo:

Cause: On our staging / dev env we have a User property that is oversized. What I mean is that you seem to generate the `x-amp-exp-user` header based on User property we set in Amplitude Analytics and sending it to every experiment http request.

Without warning or error on your side you generate a large x-amp-exp-user header that you can't handle on your server as you answer a CORS Error where it's only a HTTP Header too large.

Workaround: reduce our user property 

 

Update from Amplitude: 

We will work on displaying a more clear warning or error.

 

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

1 reply

Yuanyuan Zhang
Team Member
Forum|alt.badge.img+5
  • Team Member
  • 181 replies
  • Answer
  • September 22, 2022

Update from @Liroo:

Cause: On our staging / dev env we have a User property that is oversized. What I mean is that you seem to generate the `x-amp-exp-user` header based on User property we set in Amplitude Analytics and sending it to every experiment http request.

Without warning or error on your side you generate a large x-amp-exp-user header that you can't handle on your server as you answer a CORS Error where it's only a HTTP Header too large.

Workaround: reduce our user property 

 

Update from Amplitude: 

We will work on displaying a more clear warning or error.

 


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