I found that Tasks are added without valid data:
Start and End Date are set to: '0001-01-01 00:00:00.0000000' instead of actual time of execution
and "Data : is set to Null
Data is null because this is the reading task. Start and End times are null because that task is added to the database and the reader are not start to execute it yet. When the reader gets the task start time is set and when the reader ends the task end time is set.
Is it possible that your reader was reading something else from the meter at that time?
The reader is asking for new tasks when the previous task finishes.
After two weeks of correct operation, I had the same problem of "NULL" data again.
GxTask table contains all scheduled tasks but with null value for Start Time, End Time, and Data columns.
And again I solved by updating to latest version and restarting the software.
Data is NULL because this is a read operation. That is not the case here.
Have you restarted the AMI or database server at that time or are they up and running all the time?
If this happens again can you check what is the latest reader detection time from the DB? You will find this information from the ReaderInfo table.
The AMI and the Database are running all the time, the computer server sometimes is restarting due to power issues.
But the problem is not just for one time, it is persistent after first occurrence.
Every time the schedule starts, no reading is performed and no data values are stored.
Just having this message every time the scheduler runs:
warn: Gurux.DLMS.AMI.Scheduler.GXSchedulerService[0]
Timed Background Service is working.
But no reading is performed and no values are saved to DB. + the "Errors" table is not containing any error records.
From this information, it seems that the new task is added to the database, but the reader has not received it. Are you seeing "Failed to connect to the DB server." message in the output?
Are Start and End Time values NULL or are they '00010101 00:00:00'?
Are you running Gurux.DLMS.AMI in Windows or Linux? What is your OS version?
We'll create a new collector with your environment after you have sent this info.
Hi,
You can reproduce this issue, by killing the service before the task finishes execution.
When you start the service again, TaskController->GetNextTask finds tasks still in progress:
SELECT GXObject.DeviceId FROM GXTask INNER JOIN GXObject ON GXTask.Object=GXObject.Id WHERE GXObject.Removed = '0001-01-01 00:00:00' AND GXTask.Start <> '0001-01-01 00:00:00' AND GXTask.End = '0001-01-01 00:00:00'
Scheduler enqueues new tasks, but the reader service still waits for the execution of tasks already started by the previous instance of the service.
I think it is necessary to add an additional condition in the query, for example, Generation or Start timestamp greater than the timestamp memorized when the service is starting to avoid processing tasks of the previous instance. Another resolution would be, marking unfinished tasks at the start of the service as finished.
I found that Tasks are added
I found that Tasks are added without valid data:
Start and End Date are set to: '0001-01-01 00:00:00.0000000' instead of actual time of execution
and "Data : is set to Null
info: Gurux.DLMS.AMI.Startup[0]
GXSQL: INSERT INTO [GXTask] ([Object], [TaskType], [Generation], [Start], [End], [Result], [Index], [Data]) VALUES(339, 0, '20201216 20:31:00', '00010101 00:00:00', '00010101 00:00:00', NULL, 2, NULL)
Hi,
Hi,
We can't repeat this. What database you are using? What execution date-time you are using?
BR,
Mikko
I can't also repeat, I don't
I can't also repeat, I don't know what happened, but I have downloaded the latest version of Gurux.DLMS.AMI, it is now OK.
I am using Microsoft SQL Database Express.
Hi,
Hi,
I know the reason for this now.
Data is null because this is the reading task. Start and End times are null because that task is added to the database and the reader are not start to execute it yet. When the reader gets the task start time is set and when the reader ends the task end time is set.
BR,
Mikko
.
.
So, if the reader task is not executed (Need to know why ?), the task parameters will not be set and will be kept in DB with initial values.
The reader task should be executed with the scheduler, but in my case it didn't.
Hi,
Hi,
Is it possible that your reader was reading something else from the meter at that time?
The reader is asking for new tasks when the previous task finishes.
BR,
Mikko
After two weeks of correct
After two weeks of correct operation, I had the same problem of "NULL" data again.
GxTask table contains all scheduled tasks but with null value for Start Time, End Time, and Data columns.
And again I solved by updating to latest version and restarting the software.
Hi,
Hi,
Data is NULL because this is a read operation. That is not the case here.
Have you restarted the AMI or database server at that time or are they up and running all the time?
If this happens again can you check what is the latest reader detection time from the DB? You will find this information from the ReaderInfo table.
BR,
Mikko
The AMI and the Database are
The AMI and the Database are running all the time, the computer server sometimes is restarting due to power issues.
But the problem is not just for one time, it is persistent after first occurrence.
Every time the schedule starts, no reading is performed and no data values are stored.
Just having this message every time the scheduler runs:
warn: Gurux.DLMS.AMI.Scheduler.GXSchedulerService[0]
Timed Background Service is working.
But no reading is performed and no values are saved to DB. + the "Errors" table is not containing any error records.
Hi,
Hi,
From this information, it seems that the new task is added to the database, but the reader has not received it. Are you seeing "Failed to connect to the DB server." message in the output?
Are Start and End Time values NULL or are they '00010101 00:00:00'?
BR,
Mikko
No DB Connection Errors, I
No DB Connection Errors, I have the following log output:
GXSQL: INSERT INTO [GXTask] ([Object], [TaskType], [Generation], [Start], [End], [Result], [Index], [Data]) VALUES(339, 0, '20201216 20:31:00', '00010101 00:00:00', '00010101 00:00:00', NULL, 2, NULL)
And the values stored in the DB for Start/End Time are the same '00010101 00:00:00'
Hi,
Hi,
Are you running Gurux.DLMS.AMI in Windows or Linux? What is your OS version?
We'll create a new collector with your environment after you have sent this info.
BR,
Mikko
Hi,
Hi,
OS: Windows 10 Pro
SQL Server Express 2019 with Advanced Features
Hi,
Hi,
Any updates about this problem, I am still having it.
I have sent to your Email log file for the output of the Gurux.AMI software.
Regards
Hi,
Hi,
You can reproduce this issue, by killing the service before the task finishes execution.
When you start the service again, TaskController->GetNextTask finds tasks still in progress:
SELECT GXObject.DeviceId FROM GXTask INNER JOIN GXObject ON GXTask.Object=GXObject.Id WHERE GXObject.Removed = '0001-01-01 00:00:00' AND GXTask.Start <> '0001-01-01 00:00:00' AND GXTask.End = '0001-01-01 00:00:00'
Scheduler enqueues new tasks, but the reader service still waits for the execution of tasks already started by the previous instance of the service.
I think it is necessary to add an additional condition in the query, for example, Generation or Start timestamp greater than the timestamp memorized when the service is starting to avoid processing tasks of the previous instance. Another resolution would be, marking unfinished tasks at the start of the service as finished.
Hi Yaro,
Hi Yaro,
Thank you for this clear example. We'll try if we can repeat it like this.
BR,
Mikko