Error in Preventive Maintenance - OpenMaint

Dear All,

When creating from preventive maint planner, First opening date and First expected exec. start date are captured automatically and it is a old date ( year 1969 /1970) So I am unable to create it. I have tried many times by removing all software and reinstalling them.

image

Hello!

I had the same problem yesterday after the computer crashed.
After thar I cannot save changes in any preventive plan card.

Still working around how to solve it.

image

I have the same issue after a computer crash. has any of you been able to repair this issue.

Hello!
Last year it happened after a computer crash and I resintaled all.
Unluckly it happened again, even without an event. Preventive planner stopped working and we detected that the date and the “first opening date” changed to year 1969.

I really would like some help…

Thanks in advance.

Same issue after clean install and intial testing. I spun up the Demo database and it doesn’t have this issue, so something in the database or the demo database install makes it not happen, but a clean empty install is causing it.

I checked the logs on this error and it is complaining the the first openning date and first expected execution start date have a not null constraint that isn’t allowing the row to be added.

I reviewed the opening Date Auto fill javascript (Admin module->classes->Preventative Plan->Attibutes->FirstOpeningDate->Auto Value) and tested putting current date in on fields not completed yet and the current date shows up, so the auto fill function works but the function: utils_prevmaintconfig_info_from_data_get is returning 1969 or null and not allowing the row to be added. I’m going to play with writing my own function to calc the date and putting it in there to resolve the issue… more to come.

So this is weird, I made the First Opening Dat and First expected execution start date edittable, put real relatively close and accurate dates in the fields and cmdbuild.log still gives the error:
StatementCallback; ERROR: null value in column “FirstExpExecDate” of relation “PrevMaintConfig” violates not-null constraint
this issue is really confusing.

So after spending all day debugging, I solved this issue, it turns out that the calcuation for the dates uses the above function to call another function: utils_cal_service_bound_get and that function checks the service status of the building for the site. We are setting up prevenative maintenance on a building that isn’t operative yet so it was not set to Operative and it caused this bug.

Hello! I really appreciate your feedback. It´s a very weird issue indead.
Unfortunatelly all buildings in my system are “operative” in service status. Still working around…

So here are some tips. When the error occurs I found the actual sql command INSERT that failed. I then ran the query on the database and it errored. I then chased the issue into the utils_cal_service_bound_get function and copied it’s code into a stand alone query with the values that cased the error. Turns out there’s debug in that function that told me why it failed. You can either run the query and watch debug printouts or actually create your own query that has the code from the function in it to see what the debug is saying. I must say, the function is a giant for loop which is kind of a no no in sql so I’m not surprised it gives people issues.

I had the same problem this week. The program was working last week and creating the scheduled maintenance entries, but this week it wasn’t. After a lot of trial and error, I managed to fix it by creating new calendar entries with a more recent date—from just a few days ago. I’m not entirely sure if that’s the right way to do it, but it works now.

It’s been exactly 300 weeks since the date of the calendar entries included in the app’s default settings (February 2921). These are recursive entries that repeat every week.

Is it possible that a limit on the number of times the calendar entries repeat has “slipped into” the code?

This issue should be resolved by updating the date range in the CalendarConfig-StoredRange card of the Parameter class.

It should be sufficient to change the years of the lower and upper bounds so that the required period is covered.

For example, you can change:

["2019-07-26 18:00:00+02","2026-11-01 14:00:00+02")

to:

["2025-07-26 18:00:00+02","2027-11-01 14:00:00+02")

Please try this change and let us know if the issue persists.

The first test we ran was to update the values of the weekly “calendars” (Calendar events) to a more recent date, but it always indicated that there was a conflict with another entry, without specifying which one.

Yesterday we created new weekly calendar entries for Monday through Friday with dates from this week. After that, everything started working again.

I don’t know what the value of CalendarConfig-StoredRange was before. Currently, it is “2025-06-28 00:00:00+02,” “2029-11-04 10:00:00+01.”

Is there anywhere I can look up the functions of the Calendar Configuration items: calendar mapping and calendar change?

Indeed! I changed from 2021-0-27 to 2024 and the weird date 1969 jumped to 2025.

However, the preventive instances are still freezed in July.

I can modify one by one and the instance update from now on, with a lack between July and November. How can I update the workflow for all maintenances? Even than one by one, but re-enable then all.