Records in database but not showing in ERPNext List View

Hey ERPnext community,

I’m seeing something strange in my database today. It has to do with some records apparently not referencing correctly.

The situation looks like this;

  • I should have 313 records in the Quality Inspection table on my prod server, (SVR-A) however when I looked this morning, there were only 23!
  • investigating the database through Phpmyadmin, revealed that there were only 23 records in the table.
  • Fortunately, I have a test server (SVR-B) that had recently been mirrored (about 1 week ago) and had all the 313 records still.

So I dumped the table from SVR-B with Phpmyadmin and, after backing up the problem server SVR-A, I dropped the table with only 23 records and imported the good table with the 313 records.

The results so far.

  • Even though all 313 records are in the table on SVR-A now, I can still only view 23 of the records in the QI module. Yes! That’s correct, the same 23 records that were there before the import are the only records that show up in the application. BTW - All filters are cleared and the List view has been reset to defaults so there are no unknown customizations:

  • I have been able to successfully go the URL of the missing QI’s directly from the browser. This is interesting and shows that the information is there but some ERPNext has somehow not indexed it?

    The links in the reference documents are still there too. Meaning that I can go from one record to a QI record directly. ex: from a stock entry that has an item that had a quality inspection attached.

    So far I have run, Bench update, build, and migrate, restarted the services and the server.

I’m stumped but have the feeling that one of you Database experts will tell me the simple answer that’s right under my nose. At least, I hope so. :wink:

Thanks in advance

first, check via bench console

frappe.set_user(“your website user name”)
len(frappe.get_all(“Quality Inspection”))

check to see the total records, it is 23 or 313?

if it 313, then further check the web browser console, to the network tab, check the response content.

if it is 23, then frappe.get_all(“Quality Inspection”, debug=1)
copy the SQL statement,

exit()

bench mariadb

paste the SQL, press enter.

1 Like

Great thx for your suggestion.

I was able to get the console to show results and they are 313.
I’m not sure what you mean with this statement though

“if it 313, then further check the web browser console, to the network tab, check the response content.”

If you could explain it would be great

OK I figured out what you were suggesting. I’ve opened the browser console > Network tab and reloaded the page to see what could be seen.

Nothin out of line appears in either report view or list view, there is an error that comes when I try the summary

Of course, this is only the tool/method to analyze the problem, how to pin point the root cause and fix it is another story. hope you can fix this soon.

thanks for your help! I’ll see what I can find with it.

if per browser console system/the backend returned 23 records, please try

bench clear-cache
refresh browser

Any findings ? issue solved?

Hey There,

Yes, I was able to resolve it yesterday evening. I had to reset the permissions on the doctype. Your ideas were useful for me because I learned some new tools for diagnosis and it eventually pointed me to another area because I couldn’t;t see any differences between the “good” or “bad” server. I appreciate your quick willingness to help.
Cheers!