CORS issues when connecting to Speckle

Originally sent in General discussion
mysterybear

Hey, is the speckle.xyz server playing up or undergoing some changes or something? Been getting a bit of this (seems to resolve but happened twice briefly in the last 10 min)

iainsproat

Hi @mysterybear - thanks for reporting this. To try and better debug this issue, may I ask what browser or application are you using when you experience this? Which page or pages (urls) on speckle.xyz are you visiting?

mysterybear

Hi @iainsproat sorry for late reply on this, we basically have an application that calls Speckle like so https://github.com/theopensystemslab/buildx-reloaded/blob/00758fd5231c03a6e03add4a05706c5fd749d9f9/server/data/speckleModel.ts#L41-L64

and yeah it seems that intermittently the speckle.xyz server moans about CORS stuff

the obvious solution would be for us to self-host our own instance but yeahhh lol

being able to just use speckle.xyz is awful convenient :smiley:

I’m wondering if it’s a spam control thing? I’m developing this application so I’m probably hitting speckle.xyz quite hard every time I clear our IndexedDB cache of models

Hi @mysterybear

If it was spam control, you should receive a response with a 429 HTTP status code from Speckle Server.

If you are able to inspect the headers of the response (in Google Chrome, this is found in the Network tab of the developer tools panel) you should see an access-control-allow-origin header with a value of *.

Iain

A post was split to a new topic: CORS issues from Retool

Hi @iainsproat

I am facing the CORS issue too while trying to load an object using the Speckle viewer API. This used to happen intermittently in the past couple of weeks, and used to resolve after a while. Now it just won’t load and keeps giving the CORS error.

Dev-tools > Network:
Request to “https://app.speckle.systems/objects/streamId/objectId/single” shows a “CORS error” for fetch and a “503 Service unavailable” for preflight type.
On checking the preflight entry, the response headers do show access-control-allow-origin: *
The Referrer Policy in the General group is however “strict-origin-when-cross-origin”.

Why has this been working at times and failing with the CORS error sometimes? (Now it doesn’t work, trying for about 4 hours…) Has the server configuration been changed?

Please help!

Thanks.

P.S. I did try with the speckle.xyz canonical URL and still got the same CORS error.

Hey @dushyant

Could you provide a reproduction of this on JSFiddle or an equivalent service?

Also please provide the following when the error happens:

  • The GMT+0 timestamp of when the error occurs
  • The URL you’re trying to request
  • (If possible) The response headers & body you see in the failing response in dev tools

@dushyant

Regards the actual underyling issue - It doesn’t seem to be a CORS issue, but our objects API failing w/ a 503 status code, which in turn fails the CORS preflight request.

We’re currently investigating the Objects API errors and looking into fixes.

Hi @fabians
Indeed it was a server issue, as the local app is now able to load Speckle streams in the viewer. Earlier I tried the URL using curl and got the same ‘503 - service unavailable’ error. Also the models (tried IFC) were not uploading to Speckle from the browser. Was there an issue with the server / maintenance going on recently?
Thanks for your responses!

Hey @dushyant

Yes, there was an issue on the server over his weekend where the objects API was partially unavailable - the issue has now been fixed, can you please try again?

Hey @teocomi
Yes, it’s working now :+1:
Maybe we create a page where some endpoints are called and it shows the status of the services :slight_smile:

Thank you!

1 Like

We actually already have: https://status.speckle.systems/

Definitely should make this more widely visible :wink:
Kudos to @iainsproat

1 Like

Oh, great! :+1: Yes, definitely it must be linked to from more places on Speckle.

2 Likes