[ZBX-10619] Zoom scroll start time problem with End of month Created: 2016 Apr 05  Updated: 2017 May 30  Resolved: 2016 Jun 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.11, 3.0.1
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Kim Jongkwon Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: frontend, zoom
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Google Chrome 49.0.2623.110 (64-bit)


Attachments: PNG File 2016-03-30 11.00.45.png     PNG File ZBX-10619.png     PNG File ZBX-10619_3rows.png    
Issue Links:
Duplicate
duplicates ZBX-10866 Incorrect timeline period Closed

 Description   

“February 29”, also known as “leap day” or leap year day.
If monitoring start from leap day (Feb.29), User can’t checking past data on end of March (Mar.30, 31)

Step to Reproduce:
1. Create Item and contain history from Feb.29, 2016
2. Set the clock - Mar.30 or Mar.31 (Client)
3. Monitoring -> Latest data -> History or Graph - open Item details page (history.php)
(Reproduce must be used with item ‘history’. If you set item type use ‘Numeric’, You need to set change to ’Trend storage period’ - 0.)

In this case, I confirmed Zoom module’s starttime was “Mar.29”. and April 1 is fine.
This problem is affected by client side’s clock. so this is frontend problem and can be considered a cause javascript.

Please check the attached file.
(Left : 3/31, Right : 4/1. and SQL Results)

+ Additional information
I checked and confirmed that there are more problems with some other days.
and this issue’s continue to occur for a long time after March.
So, I decided to change priority with this issue.

Please see the comments below :



 Comments   
Comment by Oleksii Zagorskyi [ 2016 Apr 05 ]

I'm not sure, but I have a feeling that it could be related to ZBX-10060

Kim, is this reproducible only if you play with the Leap day ?

vitalijs.cemeris Seems that this issue is not related.

Comment by Kim Jongkwon [ 2016 Apr 05 ]

Oleksiy, Oh, Thanks. I didn't know that issue. So I checked play with more rows. I added more screenshot now.

then now... I think 2 issue was different.
This case, not only 'Very first records' - this happened 'All or part of datas stored before in a database.'
UI says Item start from '3/29' was completely different and this problem is user can't change history stored date from UI.

Comment by Oleksii Zagorskyi [ 2016 Apr 05 ]

Kim, thanks !
No problems, it happens sometime that some issue reports, which are not related at first glance, actually caused by the same reason.
So it worth sometime to mention them and discuss to make sure they are different

Comment by Kim Jongkwon [ 2016 Apr 06 ]

Oleksiy, Thanks!
Yes. I agree with you. Of course, It may be also a cause same reason. I don't know much about javascript and I have not seen source, but this case I suspect common problems for getMonth values. (0~11) or.. end of month?
and I need a little more time to this comments system.

Comment by Kim Jongkwon [ 2016 Apr 07 ]

I play with more this problem, and I confirmed that there are more problems with some other days.

If your data from 2/29, set the clock change…

・Data started “2/29” - Set the clock “3/29” = OK
・Data started “2/29” - Set the clock “3/30” = WRONG (UI says, from 3/29)
・Data started “2/29” - Set the clock “3/31” = WRONG (UI says, from 3/29)

・Data started “2/29” - Set the clock “4/29” = OK
・Data started “2/29” - Set the clock “4/30” = WRONG (UI says, from 3/29)

・Data started “2/29” - Set the clock “5/29” = OK
・Data started “2/29” - Set the clock “5/30” = WRONG (UI says, from 3/29)
・Data started “2/29” - Set the clock “5/31” = WRONG (UI says, from 3/29)

In these cases, There's a possibility of this trouble may come “EVERY end of Month” (Actually, over 30~)

And more, Data started time change…

Jan
・Data started “1/29” - Set the clock “3/30” = OK 

Feb (Leap year)
・Data started  “2/1” - Set the clock “3/30” = WRONG (UI says, from 3/1)
・Data started  “2/2” - Set the clock “3/30” = WRONG (UI says, from 3/2)
・Data started  “2/11” - Set the clock “3/30” = WRONG (UI says, from 3/11)
・Data started  “2/22” - Set the clock “3/30” = WRONG (UI says, from 3/22)
・Data started  “2/28” - Set the clock “3/30” = WRONG (UI says, from 3/28)
・Data started  “2/29” - Set the clock “3/30” = WRONG (UI says, from 3/29)

Mar
・Data started  “3/29” - Set the clock “3/30” = OK
・Data started  “3/29” - Set the clock “4/30” = OK

Feb (2015)
・Data started  “2/28” - Set the clock “3/31” = WRONG (UI says, from 3/28)

So, I think there is a strong possibility that from All day of the February.
(2016/4/8 Issue title changed. 'Leap day' -> 'February')

Comment by Kim Jongkwon [ 2016 Apr 12 ]

Added : This 'Feb' start time changed to 'Mar' problem is possible to reproducible on Zabbix 3.0.1.
Strangely when I clicked the 'All' button, oldest 1 records disappeared occurs at correct time period in 3.0.1. I think that could be related to ZBX-10060. (2.2.11 wasn't disappeared & This is not only 'Feb')

Comment by Kim Jongkwon [ 2016 Apr 15 ]

(2016/4/15 Issue title changed. ‘February’ -> ‘End of month')

Sorry I'm a stranger here. I checked source and finally I feel like understand that.

When the day value is greater than the maximum number of days in the month passed to setMonth() in setZBXDate.
in this case, in setZBXDate will set the wrong value. start time ‘2016-02-29’ was changed to ’2016-03-29’
when you open the history page at the end of the month (3/30~31, 4/30, 5/30~31…)

I added javascript debug screenshot & explain comments below :

source : frontends/php/js/class.cdate.js - 147~149 lines (Zabbix 2.2.11)

 this.serverDate.setFullYear(theDate.Y);	 //this.serverDate already have ‘2016-03-30’
 this.serverDate.setMonth(theDate.m - 1);  //set Month. this.serverDate is now ‘2016-02-30’. but ’02/30’ does not exist. so changed to ’2016-03-01’
 this.serverDate.setDate(theDate.d); // set Day. this.serverDate is now ’2016-03-29’	
…

This is not limited to 'Feb’ start problem too. Actually, limited to “All day of the end of month”
For example, I confirmed start time ’2016-04-30’ was changed to ‘2016-05-30’. (on 5/31, 7/31, 8/31…)

Comment by Kim Jongkwon [ 2016 Apr 20 ]

Before to do set date in setZBXDate. It is necessary to check the day of month.

I was just thinking to resolve the invert the position of setMonth() & setDate() at first view, but this solution has another problem with some other days.
Because both functions can occur when the recalculated set greater than the maximum number of days.

FYI : If you use 3.0, can be possible to reproduce ‘very first record time datas’ disappeared. This issue can't fix this problem. It could be related to ZBX-10060.

Comment by Kazuo Ito [ 2016 May 13 ]

In the case of Mar 31, it is set for 31 days in Feb.

	setZBXDate: function(strdate) {
		this.server = 1;

		var theDate = {
			Y: strdate.toString().substr(0, 4),
			m: strdate.toString().substr(4, 2),
			d: strdate.toString().substr(6, 2),
			H: strdate.toString().substr(8, 2),
			i: strdate.toString().substr(10, 2),
			s: strdate.toString().substr(12, 2)
		};

		this.serverDate.setFullYear(theDate.Y);
		this.serverDate.setMonth(theDate.m - 1); <-- Feb.
		this.serverDate.setDate(theDate.d);      <-- 31  
		this.serverDate.setHours(theDate.H);
		this.serverDate.setMinutes(theDate.i);
		this.serverDate.setSeconds(theDate.s);
		this.serverDate.setMilliseconds(0);
		this.calcTZdiff();

		return this.getTime();
	},


This problem is solved by setting the month to the last.

	setZBXDate: function(strdate) {
		this.server = 1;

		var theDate = {
			Y: strdate.toString().substr(0, 4),
			m: strdate.toString().substr(4, 2),
			d: strdate.toString().substr(6, 2),
			H: strdate.toString().substr(8, 2),
			i: strdate.toString().substr(10, 2),
			s: strdate.toString().substr(12, 2)
		};

		this.serverDate.setFullYear(theDate.Y);
		this.serverDate.setDate(theDate.d);
		this.serverDate.setHours(theDate.H);       
		this.serverDate.setMinutes(theDate.i);
		this.serverDate.setSeconds(theDate.s);
		this.serverDate.setMonth(theDate.m - 1);   <-- here!
		this.serverDate.setMilliseconds(0);
		this.calcTZdiff();

		return this.getTime();
	},
Comment by Kim Jongkwon [ 2016 May 13 ]

Thanks to fix code. I said this before,

I was just thinking to resolve the invert the position of setMonth() & setDate() at first view, but this solution has another problem with some other days.

Sorry for the lack of explanation. I was confirmed "~ ENDTIME(now!)" was changed to 'before’ on end of month.
So I tried to reproduce this. but... I don't know why, I can't reproduce this time.
When there is no problem in the recheck this, it is all right.

Comment by vitalijs.cemeris (Inactive) [ 2016 Jun 16 ]

Closed as duplicated by ZBX-10866.

Generated at Wed May 08 06:03:30 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.