Router pages time outs issue

Hello WIX team!

In last week-two I’m facing critical issue with router pages.
All router pages get time outed very frequently (Time Out Wix page, error 500), which wasn’t happening before.

I tried to understand what may cause such an issue, so I created very simple router page to play with.
https://dmitrybi32.wixsite.com/issue-reproduce/router-issue/item6
Here router code logs to “router_test” collection current URL’s path[0] (item6 in this case) and current time.
At frontend side I fetch router’s reply with
routerData = wixWindow.getRouterData();

First I observed that router code may run several times.
In some cases it may run 4 times, while the records in database look like the following:

request.path[0] = wix-freemuim-css-entry.css.map Time : 22:4:7:493
request.path[0] = item6 Time : 22:4:7:277
request.path[0] = item6 Time : 22:4:7:277
request.path[0] = item6 Time : 22:4:5:963

All the above for the single page load, while the last stored record also captured wix-freemuim-css-entry.css.map instead of “item6”.

Is it expected behavior?

Worth noting, that I didn’t find real correlation between page getting time outed, and number of timer page’s router code had been running.
But probably you may see it from your side.

As for timeouts for the current sample page - it also very sporadic, but easily reproducible after several page loads.

Again, I started seeing the timeouts recently, but it makes the work with site impossible.
Please help with checking this issue from your side.

Thanks,
Dima

3 Likes

Dear WIX team,

I too am seeing this timeout error 500 message a lot for Dynamic pages and Router pages.
My temporary solution has been to set a timeout at onReady(…), which is clearly not satisfactory, as the length of the timeout periods are not consistent.

Please look into this as soon as possible.

Thanks,
Robert

Hi

We are looking into the issue. Thank you for pointing it out.

Best Regards,
Dmitry

Thanks Dmitry, We’re going through the same issue here on https://www.pinglinkscellular.com/Shop/Products

Same issue for me: http://www.jungleimmobiliare.com/Properties

Hi robert,

Do you mind sharing your temporary solution?
I tried added this inside my onReady() in the page:

setTimeout(15000); 

It doesn’t change anything.

Hi Dmitry,

Can you please provide estimated time for this bug fix?

Thanks,
Alexander

@michele-giannone Hi, I wrapped the rest of the code in onReady() in a function that is only called after a number of milliseconds:

if your onReady() code looks like this:

$w.onReady(function () {
// … code here
// …
};

I wrapped the code, with a delay (1 sec in this example)

$w.onReady(setTimeout( () => {
// … code here
// …
}, 10000));

Like I originally wrote before, it is a temporary solution that sometimes works, as the Wix timeout is not consistently the same, and having a longer delayed time is not a good user experience.

I hope Wix resolves this soon.

Robert

@robert65 Thank you Robert. I hope is solved soon by Wix as it is really annoying.

Hi Wix Team,

I’m also having timeout issues with my router pages.

It only seems to affect routers which don’t return immediately (within milliseconds), i.e. need to access an API via a fetch etc.

Interestingly if you access the route via a link on the Wix site everything works as expected. But as soon as you access the route directly you “immediately” get a 500 Timeout error.

It feels like Wix is setting some sort of timeout allowance when following a route from an internal link on a Wix page, but not applying that same timeout allowance when accessing the route directly.

The example below will produce the 500 timeout error intermittently probably due to the external API’s varying response times:

import {ok, notFound, WixRouterSitemapEntry} from “wix-router”;
import {fetch} from ‘wix-fetch’;

export function test_Router(request){
let options = {
method: ‘GET’,
headers:{
“Content-Type”: “application/json”,
“Accept”: “application/json”
}
};

//Mock API call 
return fetch( "https://httpbin.org/get", options) 
.then( (httpResponse) => { 
    return ok("test-page"); 
}).catch( (err) => { 
    return notFound(); 
}); 

}

Looking forward to your assistance.

Best regards

Brett

@alexander your site is functional again.

Thank you for your patience.

@giedrius-grazevicius I can also confirm that my website is working again. What had caused this?

@chris-derrell currently we have an issue with our site optimisation engine and wix app collection based dynamic pages.

I have excluded your site from optimisation until the issue is resolved. You may experience slightly slower site load times for the time being.

Hi WIX team.
I also still experiencing same issue.
On the first attempt to access the reproduce page provided in original post, I got 500 timeout, as it was previously.
Thanks,
Dima

Hi Wix Team,

Can you please reply to this problem because it is probably the biggest fundamental bug with Wix Code.

What is the point of a router page if you can’t get to it directly? See my post above for details on how to reproduce the bug.

You mentioned that you were aware that there were problems with your dynamic pages. Maybe that is related.

Looking forward to your help.

Brett

Hi, everyone,

currently we are having an issue with long running router page requests and our SSR engine (it makes the initial page load faster). We are working on resolving this as soon as possible.

If you are making external long running requests in router pages or use dynamic pages together with DB Drivers, you may be affected.

If you are experiencing an issue, please report the page and we will temporarily exclude you from our SSR engine. This may make your initial page load a little slower for the time being. We will re-enable it for you as soon as this is fixed.

We are sorry for any inconvenience this may be causing.

Hi all,

A fix was deployed that should prevent getting the 500 error message.
Please report if you’re still experiencing this.

Also, please note that when writing custom router code you should keep performance in mind.
You might experience degraded rendering times in case the router does not respond quickly (e.g. when it is doing a call to a slow third-party API)

You are a star! It’s working like a dream now.

Thank you so much.

Brett

Hey Ofer,

Our site is no longer having the router issue above, however it’s been having a terrible time navigating between pages. When we try, we’ve been greeted with a blank white screen sometimes.

Reproduce: Go to https://www.pinglinkscellular.com and try to navigate to any of the site navigation tabs.

Really looking for a solution to this. Thanks in advance.

Chris

@chris-derrell we are investigating the issue.

Thank you for your report.