Getting 500 error on dynamic pages

Hello, need some help here!

My website was running fine for months, but all the sudden receiving 500 error on the dynamic pages. I tried to create a new collection and new dynamic page without any custom code, able to preview the page, but hitting 500 error when published.

Any idea? Thanks in advance!

Jerry

Hi Jerry,
Can you please send us the site URL and the name of the page you were referring?

Thanks,
Tal.

Hi Tal, thanks for reaching out. All dynamic pages are not working, but here’re some example

I also testing with a new collection and a default dynamic page generated automated.
Database collection name “test-data” and dynamic page “Test-data”, oakary.com/test-data/jerry@oakary.com

Here’re things I have tried.

Roll back and restoration from the backups does not work
I discovered the error 500 issue on 11/27/18, but the pages have been running fine for the past few months. So I tried to roll back to the backup all the way to 11/26… 11/14, but still getting the error.
I also duplicated the site and publish a test website, and that also does not work.

Getting odd dataset error
I experienced the error, "DatasetError: Operation (onReady) not allowed on an unconfigured dataset” after the page went down for the 500 error. All the default auto-generated dataset no longer work and not working in preview neither, so I have to replace them manual with new dataset, which it works fine afterward the replacement. see page oakary.com/candidate/{email}. The page is loading the data and UI correctly in Preview, but still having 500 error when published.

New collection without custom code also not working
A brand new data collection and created a new dynamic page with dynamic dataset linked to that new collection, it still shows the following error with the auto generated and default dataset. "DatasetError: Operation (onReady) not allowed on an unconfigured dataset”
So I tried to add a dataset manually, then the error went away, but the page still having 500 error.
This is done without any custom coding.
You can check the new collection “test-data” and new page “Test-data (Email)” ( https://oakary.com/test-data/jerry@oakary.com in live site).

Existing ones only work in Preview
I examined the code and there’s no error and it’s able to run in Preview, only problem is the it hit error 500 when view as a live site. and the code is not new, it has been working fine for months, only few days ago (11/27) it went down by itself without any code modification. And not just this page, pages that tied to database (any database, there’re few) all have the same error. No code was modified and the same situation, pages have been running for months fine then went down all the sudden.
Please see screenshots attached (page oakary.com/candidate/jerry@oakary.c om)

1 Like

Hi Jerry,
I recommend trying to change the field to ID instead of an email. In order to use the dynamic page feature correctly, the field should be unique otherwise it won’t work properly. The ID field is unique, therefore I think that it should help.

Let me know if it resolved the issue :slight_smile:

Best,
Tal.

Hi Tal,

The field email actually works fine, since I have been using it to get the profile page in the past few months until 11/27. I used email to retrieve the page, because ID is random I won’t able to know the ID for particular candidate. Plus, I think Wix handles the none-unique field by requesting the most recent data, so no trouble there.

I think the main issue is that even new collection and dynamic page without custom code also doesn’t work. Rolling back also doesn’t help. So I’m suspecting it’s the backend logic of handling dataset somehow corrupted for this particular case. Restore doesn’t restore the database, as a result, restoring won’t fix the 500 error, which also means that the code itself is not the issue, since I already rolled it all the way back to the data that was working fine, like 11/14 before 11/27, when it first broke.

You can see the test-data collection and dynamic page also have trouble working on live site (but works fine in Preview).
Please let me know what you think if you have a chance to test out the test-data collection, because that one is a simple version of the example of the issue.

Thanks.

Jerry

Hi Tal,

here’s another thing I tried today. You can find a new website “basecamp”, I copy the same database to that project to test things out and works fine. So seems like it’s really the oakary website has backend server issue. Perhaps database get corrupted, so it’s able to write, but have trouble reading it.

Could you investigate for as a database bug for me? thanks!

Hi Jerry,

It looks like an issue with the code in the routers.js backend file.
If you comment out the code in this file, I believe that you will be able to use dynamic pages in published sites.
Try to start solve it from this file.

Ah, it works now!! Thank you so much for spotting that! So I guess wix-router thing is updated so no longer works?

import {forbidden, next} from 'wix-router';

the issue was with these imports:

import wixLocation from ‘wix-location’;
import wixUsers from ‘wix-users’;

You can see in the documentation that those APIs can only be used in front-end

I see. Thank you for the help again.

I have the same issue. The site worked fine for months. Now throwing up error 500, especially if swtiching rapidly through dynamic pages. Only front end code is running. What can I try?

I am also getting the same error.
I updated the imports from

import wixLocation from ‘wix-location’;
import { currentMember } from ‘wix-members’;

to

import wixLocation from ‘wix-location-frontend’;
import { currentMember } from ‘wix-members-frontend’;

but still no luck.

Did you ever solve this? Also, where are you doing those imports? In your backend or frontend?

1 Like