Invalid date, no info

Hi,

Everytime I reload a page, I get this error below, without any indication of which of all tables contains this error.

How could I find out where this error is coming from (where that date was allowed to be entered)?

Which doctype and which version?

Also check the date format is proper or not.

Thirtieth of february???

but which doctype and which version do you use?

Actually, every time I reload any page, any doctype list, even homepage.

This is v15.11.0.

Hi @gtapias ,

I am also using erpnext v15.11.0 but I am not getting any error.

I think it will come from your custom code may be.

Oh, I don’t mean to imply that it is a problem with erpnext v15.11 proper.

I think the system allowed (did not sanitize/validate) entering that incorrect date, and now shows the error.

I’m trying to find out where I can go look for some kind of error logs that could show more information as to where the wrong date is entered, to correct it.

Browser’s console log and system’s Error Log don’t show anything about this.

I’ve downloaded templates, with all info, of the most used doctypes, searched for that date in the Excel template, but no luck. After thousands of records searched this way, I still have not been able to find where it is recorded.

1 Like

If nothing else helps and you know or are ready to learn how to script database queries, you could try the brute force approach:

You could open a mariadb console with bench and then list all the DocFields of type Date/Datetime like this:

bench --site <yoursitename> mariadb

MariaDB [<autofilled DBname>]> SELECT fieldtype, label, fieldname FROM tabDocField WHERE fieldtype LIKE "Date%";

There are many such fields, so scripting is probably necessary (unless the list inspires you some idea to shorten the search, you never know, and with a bit of luck maybe).

With scripting you will probably be able to locate the culprit, by iterating over all these date / datetime fields and SELECTing the bad date in the corresponding tables. If it’s not there, you can still try fields of type Data.

An alternative to this somewhat convoluted approach could be this:
Create an export of the complete MariaDB database and simply search for the culprit in the produced .sql export. That could be quick (unless the export length is unmanagably big maybe).
Simply grep the bad date, and then adjust -B and -A options until you have the context you need.

Thank you very much!

These were the ideas I was looking for!

I’ll give them a try!

I was able to do the sql dump, not sure how relatively big 350 MB is, but Sublime Text was able to open and search the file.

Not found :sob:

Any other ideas?

Another way is you could try clients like HeidiSQL.

Connect to your database using HeidiSQL and use the “Find Text on Server” option

then add “2024-02-30” to the text field and search

This should bring up all the tables that has the value

I mean, Sublime was able to search and find the most peculiar text I could think about that I knew was in the system.

It searches and finds just fine. But the error shown is the one not found.

I’ll try with HeidiSQL now. Thank you very much.

One month later, I updated the system (bench update) and the notice simply disappeared.

:man_shrugging: