Network error when calling Xano API

Hi,

not sure if it is a bug or configuration issue on my side: When fetching a collection from Xano API in 3 of 10 cases WeWeb throws a Network error.

How can I fix this?

Here is an extract of the Error in WeWeb:
stack: “Error: Network Error at e.exports (https://editor-cdn.weweb.io/public/js/chunk-vendors.f83c0b3b.js:64:1241) at g.onerror (https://editor-cdn.weweb.io/public/js/chunk-vendors.f83c0b3b.js:257:2567) at XMLHttpRequest.sentryWrapped (https://browser.sentry-cdn.com/5.12.1/bundle.min.js:2:44863)”

message: “Network Error”

response: undefined

isAxiosError: true

toJSON: function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}

@Soenke can you provide some more information on how the error is being produced? What’s the code/action/setup of your Xano request. That error is not very helpful to diagnose where the issue is. Screenshots are very helpful also.

@kevinwasie I attach some scrrenshots of the workflow which is leading into the fetch error (also attached).

Nothing special in there, just fetching the collection and then updating the selectedItem variable.

The error occurs from time to time with no reason, also when I am testing the workflow in the editor, and run the workflow via “Test workflow” 10 times, the error occurs sometimes, but sometimes not.

  1. Action: Fetching the error

  1. Action: Updating variable

  1. Error in Collection occurs sometimes

Are you on the free plan for Xano?

Xano will throw a 429 error if you hit your rate limit, but that could be a culprit here.

Hey, I am using a paid plan in Xano.

In the logs I can also see that the response is transmitted as it should be. The error seems to occur on WeWeb side.

What is the response on Xano side?

In Xano’s logs the response is an array of objects as intended.

Something like this:

Hi @Soenke,

Can you tell us what is the Xano response in WeWeb?

i.e. inside the error > request > data > message as shown in some of these examples:

HI @Soenke,
we take a look at your project, and apparently you had a infinite loop of redirection to the login page. So you overflood Xano with requests, which was causing the issue.
We fixed your checkUser workflow with a filter, so that you do not loop on the login page.
We take note on this problem (you are not the only one) and we will probably add a security so this can’t happen.

Hope it help,

Regarding the periodic 502 error I discovered that some of the Xano API calls response headers do not comply with CORS. In detail the “Access-Control-Allow-Origin: *” parameter is missing in the response header. Strange thing is that the response is sometimes CORS compliant and sometimes not :thinking:

Found this interesting article about CORS, but the proposed fixes do not look sustainable to me:

Thats indeed strange. Can you check on Xano side why this behavior is happening? You will probably not being able to fix it by yourself as it is on Xano/server hands.
If you manage to find why can you get back to us :slight_smile: ? If there is something on our side, i will be happy to help, but here it seems to be a server issue.

Hi @aurelie , I forwarded the screenshots to Xano’s support, let’s see if they solve it (Crossing fingers).

I will definitely let you know…

@Michael_Xano

What was the latest update in this regard? I am having same error.

Hi @codage to be honest I cannot really tell you how the issue was solved in my case. I exchanged a couple of emails with the Xano team and Michael and his team investigated. Was tricky. Then suddenly the error did no longer appear :man_shrugging: A bit strange but until now everything runs smoothly :crossed_fingers:

I suggest that you contact the Xano support. They were really supportive. I recorded a loom video showing the error which helped them to understand the problem.