Subject: [Pkg-cacti-maint] Bug#667634: cacti uses wrong timezone and logs PHP warnings

From: "Christoph Kling" <[email-masked]>
Date: Thu, 5 Apr 2012 15:38:09 +0200

Package: cacti
Version: 0.8.7i-2
Severity: normal

Dear Maintainer,

cacti logs dozens of warnings in its /var/log/cacti/poller-error.log. 

The message is:

"PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/cacti/site/include/global_arrays.php on line 672"

The warning does matter because cacti logs the wrong times. Graphs are using UTC instead of the local server time.

The reason for this bug could be the upgrade to PHP 5.4.

Regards,
Christoph

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages cacti depends on:
ii  apache2                                  2.2.22-2
ii  apache2-mpm-worker [httpd]               2.2.22-2
ii  dbconfig-common                          1.8.47+nmu1
ii  debconf [debconf-2.0]                    1.5.42
ii  libphp-adodb                             5.15-1
ii  mysql-client-5.1 [virtual-mysql-client]  5.1.61-2
ii  php5                                     5.4.0-3
ii  php5-cli                                 5.4.0-3
ii  php5-mysql                               5.4.0-3
ii  php5-snmp                                5.4.0-3
ii  rrdtool                                  1.4.7-1
ii  snmp                                     5.4.3~dfsg-2.4
ii  ucf                                      3.0025+nmu2

Versions of packages cacti recommends:
ii  iputils-ping                     3:20101006-1+b1
ii  logrotate                        3.8.1-1
ii  mysql-server-5.1 [mysql-server]  5.1.61-2

Versions of packages cacti suggests:
pn  php5-ldap  <none>

-- Configuration Files:
/etc/cron.d/cacti changed [not included]

-- debconf information:
  cacti/mysql/admin-pass: (password omitted)
  cacti/password-confirm: (password omitted)
  cacti/app-password-confirm: (password omitted)
  cacti/mysql/app-pass: (password omitted)
  cacti/db/app-user: cacti
  cacti/mysql/admin-user: root
* cacti/webserver: Apache2
  cacti/mysql/method: unix socket
  cacti/remote/host:
  cacti/upgrade-error: abort
  cacti/dbconfig-upgrade: true
  cacti/internal/skip-preseed: false
  cacti/remote/newhost:
  cacti/purge: false
  cacti/missing-db-package-error: abort
  cacti/database-type: mysql
  cacti/remove-error: abort
  cacti/db/dbname: cacti
  cacti/upgrade-backup: true
  cacti/install-error: abort
  cacti/internal/reconfiguring: false
  cacti/passwords-do-not-match:
* cacti/dbconfig-remove:
* cacti/dbconfig-install: true
  cacti/remote/port:
  cacti/dbconfig-reinstall: false
_______________________________________________
sysadm mailing list
[email-masked]
http://lists.alphasky.net/listinfo/sysadm

---

From: Paul Gevers <[email-masked]>
Date: Fri, 06 Apr 2012 20:41:32 +0200

forwarded 667634 http://bugs.cacti.net/view.php?id=2202
tags 667634 wontfix
thanks

Upstream references to http://docs.cacti.net/faq#time_zone_warning where
it says:

[quote]
Time Zone Warning

Similar to the Deprecated Warning, you may see the following warning in
your logs

"""
PHP Warning:  strtotime(): It is not safe to rely on the system's
timezone settings. You are
*required* to use the date.timezone setting or the
date_default_timezone_set() function. In case
you used any of those methods and you are still getting this warning,
you most likely misspelled
the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no
DST' instead in
/usr/share/cacti/include/global_constants.php on line 156
"""

In this case, simply follow the directions. Set your timezone in
/etc/php.ini

"""
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone =America/Regina
"""

Of course, read
http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone ,
and find your correct timezone.

As always, restart apache after any change to /etc/php.ini
[/quote]

---

From: [email-masked] (Debian Bug Tracking System)
Date: Fri, 06 Apr 2012 18:45:12 +0000

> forwarded 667634 http://bugs.cacti.net/view.php?id=2202
Bug #667634 [cacti] cacti uses wrong timezone and logs PHP warnings
Set Bug forwarded-to-address to 'http://bugs.cacti.net/view.php?id=2202'.
> tags 667634 wontfix
Bug #667634 [cacti] cacti uses wrong timezone and logs PHP warnings
Added tag(s) wontfix.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
667634: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667634
Debian Bug Tracking System
Contact [email-masked] with problems

---

From: [email-masked] (Debian Bug Tracking System)
Date: Thu, 25 Oct 2012 17:45:09 +0000

Your message dated Thu, 25 Oct 2012 19:43:32 +0200
with message-id <[email-masked]>
and subject line bug was in php5 and closed now
has caused the Debian Bug report #667634,
regarding cacti uses wrong timezone and logs PHP warnings
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email-masked]
immediately.)

Subject: cacti uses wrong timezone and logs PHP warnings
From: "Christoph Kling" <[email-masked]>
To: <[email-masked]>
Date: Thu, 5 Apr 2012 15:38:09 +0200

Package: cacti
Version: 0.8.7i-2
Severity: normal

Dear Maintainer,

The message is:

Regards,
Christoph

-- System Information:

-- Configuration Files:

-- debconf information:

Subject: bug was in php5 and closed now
From: Paul Gevers <[email-masked]>
To: [email-masked]
Date: Thu, 25 Oct 2012 19:43:32 +0200

Actually, this bug was a duplicate of a bug in php5 source. It was fixed
in version 5.4.4-6.

   * Re-add logic to guess default timezone from system (Closes: #673763)

Marking the bug as close instead of going through the fuss of merging an
archived bug.

Paul