Trevor Furlong
385 views (last 30 days)

starting to get ERROR : blocked by CORS policy

Trevor Furlong on 14 Apr 2021
Latest activity Reply by Ramakrishna Narasimha Swamy on 14 May 2021 at 3:27

Hello

From earlier today a project i've been working on has stopped working. It was working for the last couple of weeks with no coding updates in the mean time.

The error i'm only now getting is

"from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

Im transferring four readings from thingspeak to a web page

the get command i'm using is. xhttp.open("GET", "https://api.thingspeak.com/channels/752230/feeds/last", false); xhttp.send();

Why would i only start receiving this error today. If more information is needed i will send it on.

any insights would be much appreciated.

Thanks

Trev

 
Ramakrishna Narasimha Swamy
Ramakrishna Narasimha Swamy on 11 May 2021 at 9:57

Will appreciate an early response....

Vinod
Vinod on 12 May 2021 at 15:01 (Edited on 12 May 2021 at 19:20)

I'm not able to reproduce the issue. As you can see below, many users have confirmed the issue has been resolved a while back.

Out of curiosity, I look at this file and see that your timeout is 10 seconds. With a free account, your channel can only be updated every 15 seconds. Can you help me understand why you need to poll ThingSpeak every 10 seconds?

 
1 Reply
Ramakrishna Narasimha Swamy
Ramakrishna Narasimha Swamy on 14 May 2021 at 3:27

Apart from frequent polling, there were couple of issues which have been sorted. Now, it is working fine! Thank you very much for your support!!

Bharadwaj N
Bharadwaj N on 9 May 2021 at 7:20

Is this issue really fixed?

I have this simple HTML app that makes a request to 'feeds.json': https://github.com/rnswamy1954/Hello-World/blob/master/index.html#L126

I can make the exact same request from CURL/POSTMAN/browser-url and I get the response properly.

But when am trying to load my HTML page, I get response with status = 0 and type = opaque

As you can see, my request is going to api.thingspeak And I do have 'no-cors' in my request header. Any help will be greatly appreaciated

 
1 Reply
Vinod
Vinod on 12 May 2021 at 15:02 (Edited on 12 May 2021 at 19:20)

Yes - the issue was resolved a while back. Many users have confirmed it on this thread. If you are still experiencing it, you may need to clear your browser cache and reload your page.

I look at this file and see that your timeout is 10 seconds. With a free account, your channel can only be updated every 15 seconds. Can you help me understand why you need to poll ThingSpeak every 10 seconds?

 
Thorsten Schwinn
Thorsten Schwinn on 16 Apr 2021

I'm still getting the "CORS Missing Allow Origin" error on the URL https://thingspeak.com/channels/[channelid]/feed.json

Vinod
Vinod on 16 Apr 2021

Change the url from https://ThingSpeak.com/... To https://api.thingspeak.com/...

 
1 Reply
Thorsten Schwinn
Thorsten Schwinn on 16 Apr 2021

Thanks! It's fine now.

 
Vinod
Vinod on 15 Apr 2021

This is resolved. If anyone is still seeing issues, please reply to this response.

 
1 Reply
Andrew sustainablesv
Andrew sustainablesv on 22 Apr 2021 at 15:56

Vinod, yes I am still being this same issue. API calls had been working for 6 months and suddenly I am receiving CORS errors. Here is what I am getting:

Please let me know when this will be fixed for my example. Thanks!

Christopher Stapels
Christopher Stapels on 26 Apr 2021 at 17:25

Do yo see this if you use a fresh browser and sign out and then back in? Make sure you close all other browsers signed in to MathWorks.

Andrew sustainablesv
Andrew sustainablesv on 27 Apr 2021 at 0:44

Hi yes, I always flush the cache and believe I have only one browser open at a time. I now am able to get the API to work if I use a getJSON call rather than fetch.

John Budden
John Budden on 15 Apr 2021

Thanks for the update.

 
John Budden
John Budden on 15 Apr 2021

Just letting you know our web Dashboard is down since this CORS issue came about.

 
1 Reply
Christopher Stapels
Christopher Stapels on 15 Apr 2021

I apologize for the disruption. The fix should be in place later today.

Christopher Stapels
Christopher Stapels on 14 Apr 2021

We are aware of this issue and are working on a fix. Thank you for letting us know.

Christopher Stapels
Christopher Stapels on 14 Apr 2021

A server-side configuration change has resulted in a XHR requests to ThingSpeak being blocked at the browser (i.e., ThingSpeak servers do not even see the request). You can confirm that the requests still work by making them from a different client - like cURL or POSTMAN.

A fix is being worked on and we anticipate it being released shortly.

Tony Zurolo
Tony Zurolo on 15 Apr 2021

Thanks Christopher - glad to hear a fix is in progress.

I'm seeing the same problem from my ThingSpeak plugin: Access to XMLHttpRequest at 'https://api.thingspeak.com/channels/8203/feeds.json?days=2' from origin 'https://thingspeak.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

best regards, Tony

 
Stoyan Boyadzhiev
Stoyan Boyadzhiev on 15 Apr 2021

Same problem. Using highstock chart from two days i receive error while trying getJSON request.

 
Ian Buxton
Ian Buxton on 15 Apr 2021

Thanks - I am also getting this problem which started yesterday as far as I can tell (using highstockchart to retrieve data, this was working 2 days ago)

 
Trevor Furlong
Trevor Furlong on 14 Apr 2021

thanks for the quick response

 

Related Content

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!