OTRS 6.0.8 - Error creating DateTime object.

Moderator: crythias

Post Reply
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

OTRS 6.0.8 - Error creating DateTime object.

Post by jff »

Hello,

I've been running OTRS 6.0.8 for some time now and for no apparent reason since October 21st I started receiving a log line every seconds stating:

Code: Select all

Mon Oct 22 12:58:47 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:45 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:44 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:43 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:41 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:40 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:38 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:37 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
Mon Oct 22 12:58:36 2018 	error 	OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-42 	Error creating DateTime object.
I did a debug on the TaskManager Daemon and the traceback is:

Code: Select all

 Message: Error creating DateTime object.

 Traceback (30205):
   Module: Kernel::System::DateTime::new Line: 154
   Module: Kernel::System::ObjectManager::_ObjectBuild Line: 306
   Module: Kernel::System::ObjectManager::Create Line: 241
   Module: Kernel::System::CronEvent::PreviousEventGet Line: 226
   Module: Kernel::System::Daemon::SchedulerDB::CronTaskToExecute Line: 1435
   Module: Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager::Run Line: 100
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs/bin/otrs.Daemon.pl Line: 137
I've stopped Cron and Daemon, tried to run the Daemon first, then Cron and vice versa, no packages are missing, no changes to the server nor the application.

How can I further trace this issue and fix it?
Thank you.
fcasal
Znuny wizard
Posts: 336
Joined: 21 Apr 2014, 16:14
Znuny Version: 6.0.18

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by fcasal »

Hello, perhaps is the error that was solved with the patch level 11

https://community.otrs.com/release-note ... -level-11/

The error is:

Bug 14045 - Error creating DateTime object for pending time in Process ticket >> https://bugs.otrs.org/show_bug.cgi?id=14045

Have you created any process on OTRS?

Greetings
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by jff »

Hi,

I have not created any Process, this is related to a timezone issue that happened in Brazil because of DST being delayed.
OTRS assumed the timezone America/Sao_Paulo entered DST but in fact this timezone will start DST on November 4th.

The issue here is that my server (OTRS server) has all DateTime packages updated and the data and time of the server is correct so with that in mind I don't know where OTRS gets the timezone information from.
Rebooting the server does absolutely nothing.

Right now, I can use OTRS but every new article is saved with a 1 hour ahead.

This bug is reported in:
https://bugs.otrs.org/show_bug.cgi?id=13924#c0
ors
Znuny newbie
Posts: 4
Joined: 22 Oct 2018, 19:25
Znuny Version: 6.0.12
Real Name: orx
Company: Lyra

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by ors »

I got this error in version "otrs-6.0.12-01.noarch".
The problem was the delay on daylight saving here in Brazil.
The OTRS has its own Timezone, and the hour has changed in the OTRS but not in the OS.

I have followed this guide https://otrsbrasil.com/2018/10/22/probl ... on-otrs-6/.

Code: Select all

Move the localtime to root,
mv /etc/localtime /root/

Change the localtime to +2 (daylight saving)
ln -sf /usr/share/zoneinfo/Etc/GMT+2 /etc/localtime

and change the hour to the correct:
date -s 15:58
I need to change the TimeZone in the OTRS and Deploy.

The error has gone away, and OTRS start to send email again.

Code: Select all


ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-56 Perl: 5.16.3 OS: linux Time: Mon Oct 22 14:21:31 2018

 Message: Error creating DateTime object.

 Traceback (25812): 
   Module: Kernel::System::DateTime::new Line: 154
   Module: Kernel::System::ObjectManager::_ObjectBuild Line: 306
   Module: Kernel::System::ObjectManager::Create Line: 241
   Module: Kernel::System::CronEvent::PreviousEventGet Line: 226
   Module: Kernel::System::Daemon::SchedulerDB::CronTaskToExecute Line: 1435
   Module: Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager::Run Line: 100
   Module: (eval) Line: 314
   Module: main::Start Line: 314
   Module: /opt/otrs/bin/otrs.Daemon.pl Line: 135

To check the mail Queue I used this command:

Code: Select all

watch -n 10 "bin/otrs.Console.pl Maint::Email::MailQueue --list | tail"
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by jff »

Hello ORS,

Thanks for your reply,
Sadly this did not work for me.

Code: Select all

[root@OTRSSRVTest01 etc]# ls -la localtime
lrwxrwxrwx 1 root root 35 Oct 23 10:48 localtime -> /usr/share/zoneinfo/posix/Etc/GMT+3
[root@OTRSSRVTest01 etc]#

Code: Select all

[root@OTRSSRVTest01 etc]# date
Tue Oct 23 11:00:59 -03 2018
[root@OTRSSRVTest01 etc]#
Restarted HTTPD, daemon and Cron but OTRS still floods me with the errors about DateTime object.

Have you put your server to GMT +2?
ors
Znuny newbie
Posts: 4
Joined: 22 Oct 2018, 19:25
Znuny Version: 6.0.12
Real Name: orx
Company: Lyra

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by ors »

Hi Jeff,

have you change the timezone in the OTRS too? You must put UTC in the web, and after change you must deploy this configuration.
After change the timezone to +2, you must adjust the hour manualy with the command 'date -s' with the correct hour.
Yes, I'm current using this configuration in the production enviroment.

In your post you are still using the +3, this is the time without the Daylight saving, and for some unknow reason, OTRS is using the daylight saving.

Code: Select all


[root@otrs6 ~]# date
Tue Oct 23 11:15:36 -02 2018

ors
Znuny newbie
Posts: 4
Joined: 22 Oct 2018, 19:25
Znuny Version: 6.0.12
Real Name: orx
Company: Lyra

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by ors »

My OTRS Timezone:

Image
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by jff »

Hi ors,

I got it working, thank you very much for sharing all the steps.
I was quite reluctant and changing the system timezone to UTC because I had it to America/Sao_Paulo.

Have you encountered any issue with tickets before and after this change?

Again, thank you very much for the support.
ors
Znuny newbie
Posts: 4
Joined: 22 Oct 2018, 19:25
Znuny Version: 6.0.12
Real Name: orx
Company: Lyra

Re: OTRS 6.0.8 - Error creating DateTime object.

Post by ors »

jff wrote: 23 Oct 2018, 16:33 Hi ors,

I got it working, thank you very much for sharing all the steps.
I was quite reluctant and changing the system timezone to UTC because I had it to America/Sao_Paulo.

Have you encountered any issue with tickets before and after this change?

Again, thank you very much for the support.
You Welcome.

Me too, but changing to utc works, I dont know why.

Until now, I dont have any issues.

But, when the Daylight saving ends, you must change to America/Sao_Paulo both in OTRS and in localtime (here could be +3)
Post Reply