Error Mail Cron and MySQL

Moderator: crythias

Locked
RobinS
Znuny newbie
Posts: 10
Joined: 15 Jan 2016, 04:43
Znuny Version: 5.0.5

Error Mail Cron and MySQL

Post by RobinS »

Hello all,

I used your forum for a lot issues, it's great. But now there is a problem I can't find here.

When there is a new ticket created, I get an error mail.

Everything seems to work fine, I mean tickets get created and notifications are sent, but I learned a thing: never ignore warnings.

I think the main points in there are: "Message: Column 'owner_id' cannot be null," and " Message: No such TicketID".

If any body has an idea, I would be so happy,

Thanks

Update: there was a bug two years ago. And I used a generic agent to remove some testing tickets. Still no solution.
Edit: Only new tickets trigger this error.

https://dev.ib.pl/ib/otrs/commit/45e528 ... 8fbd935394

Code: Select all

OTRS Scheduler Daemon Cron: MailAccountFetch

ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-73 Perl: 5.20.2 OS: linux Time: Fri Jan 15 13:40:09 2016

 Message: No such TicketID (102)!

 Traceback (16146):
   Module: Kernel::System::Ticket::TicketGet Line: 1152
   Module: Kernel::System::Ticket::HistoryAdd Line: 5550
   Module: Kernel::System::Ticket::TicketCreate Line: 474
   Module: Kernel::System::PostMaster::NewTicket::Run Line: 229
   Module: Kernel::System::PostMaster::Run Line: 372
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 222
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 86
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 440
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 94
   Module: (eval) Line: 436
   Module: Kernel::System::Console::BaseCommand::Execute Line: 430
   Module: (eval) Line: 147
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs//bin/otrs.Daemon.pl Line: 138

ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-73 Perl: 5.20.2 OS: linux Time: Fri Jan 15 13:40:09 2016

 Message: No such TicketID (102)!

 Traceback (16146):
   Module: Kernel::System::Ticket::TicketGet Line: 1152
   Module: Kernel::System::Ticket::HistoryAdd Line: 5559
   Module: Kernel::System::Ticket::TicketCreate Line: 474
   Module: Kernel::System::PostMaster::NewTicket::Run Line: 229
   Module: Kernel::System::PostMaster::Run Line: 372
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 222
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 86
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 440
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 94
   Module: (eval) Line: 436
   Module: Kernel::System::Console::BaseCommand::Execute Line: 430
   Module: (eval) Line: 147
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs//bin/otrs.Daemon.pl Line: 138

ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-73 Perl: 5.20.2 OS: linux Time: Fri Jan 15 13:40:09 2016

 Message: No such TicketID (102)!

 Traceback (16146):
   Module: Kernel::System::Ticket::TicketGet Line: 1152
   Module: Kernel::System::Ticket::HistoryAdd Line: 5568
   Module: Kernel::System::Ticket::TicketCreate Line: 474
   Module: Kernel::System::PostMaster::NewTicket::Run Line: 229
   Module: Kernel::System::PostMaster::Run Line: 372
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 222
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 86
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 440
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 94
   Module: (eval) Line: 436
   Module: Kernel::System::Console::BaseCommand::Execute Line: 430
   Module: (eval) Line: 147
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs//bin/otrs.Daemon.pl Line: 138

ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-73 Perl: 5.20.2 OS: linux Time: Fri Jan 15 13:40:09 2016

 Message: No such TicketID (102)!

 Traceback (16146):
   Module: Kernel::System::Ticket::TicketGet Line: 1152
   Module: Kernel::System::Ticket::HistoryAdd Line: 5577
   Module: Kernel::System::Ticket::TicketCreate Line: 474
   Module: Kernel::System::PostMaster::NewTicket::Run Line: 229
   Module: Kernel::System::PostMaster::Run Line: 372
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 222
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 86
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 440
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 94
   Module: (eval) Line: 436
   Module: Kernel::System::Console::BaseCommand::Execute Line: 430
   Module: (eval) Line: 147
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs//bin/otrs.Daemon.pl Line: 138

[Fri Jan 15 13:40:09 2016] otrs.Daemon.pl: DBD::mysql::db do failed: Column 'owner_id' cannot be null at /opt/otrs/Kernel/System/DB.pm line 449.
ERROR: OTRS-otrs.Console.pl-Maint::PostMaster::MailAccountFetch-73 Perl: 5.20.2 OS: linux Time: Fri Jan 15 13:40:09 2016

 Message: Column 'owner_id' cannot be null, SQL: 'INSERT INTO ticket_history  (name, history_type_id, ticket_id, article_id, queue_id, owner_id,  priority_id, state_id, type_id,  create_time, create_by, change_time, change_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,
        '2016-01-15 13:40:09'
    , ?,
        '2016-01-15 13:40:09'
    , ?)'

 Traceback (16146):
   Module: Kernel::System::Ticket::HistoryAdd Line: 5595
   Module: Kernel::System::Ticket::TicketCreate Line: 474
   Module: Kernel::System::PostMaster::NewTicket::Run Line: 229
   Module: Kernel::System::PostMaster::Run Line: 372
   Module: Kernel::System::MailAccount::IMAP::_Fetch Line: 222
   Module: Kernel::System::MailAccount::IMAP::Fetch Line: 86
   Module: Kernel::System::MailAccount::MailAccountFetch Line: 440
   Module: Kernel::System::Console::Command::Maint::PostMaster::MailAccountFetch::Run Line: 94
   Module: (eval) Line: 436
   Module: Kernel::System::Console::BaseCommand::Execute Line: 430
   Module: (eval) Line: 147
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 131
   Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 259
   Module: (eval) Line: 316
   Module: main::Start Line: 316
   Module: /opt/otrs//bin/otrs.Daemon.pl Line: 138
OTRS version 5.0.6 , Operating System: Debian GNU/Linux 8 (jessie), database type: MySQL.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Error Mail Cron and MySQL

Post by crythias »

owner_id cannot be null = you have a sysconfig entry for postmaster indicating default owner that does not exist/is invalid/renamed.

no ticketid 102 means what it says. Something (I don't know what) is attempting to reference a ticket.id that doesn't exist.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
RobinS
Znuny newbie
Posts: 10
Joined: 15 Jan 2016, 04:43
Znuny Version: 5.0.5

Re: Error Mail Cron and MySQL

Post by RobinS »

Hello crythias,

thanks for your help.

I checked the PostmasterUserID in sysconfig it's "1". I also checked the database and my OTRS Admin has the userID 1.

The new created ticket, when a new email gets in, seems to get the TicketID "no such Ticket" - which makes no sense... And then the ticket is created. So we have an error, but the ticket gets created anyway.

Any chance to delete all users and tickets from the database? So I can start from scratch?
Thanks
OTRS version 5.0.6 , Operating System: Debian GNU/Linux 8 (jessie), database type: MySQL.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Error Mail Cron and MySQL

Post by crythias »

RobinS wrote:I checked the PostmasterUserID in sysconfig it's "1". I also checked the database and my OTRS Admin has the userID 1.
userid = 1 means login for the user is literally 1. It doesn't mean user.id=1

no ticket id = 102 means no ticket.id=102 (Yes, I understand there is a semantic difference. just trust me on this.)
RobinS wrote:Any chance to delete all users and tickets from the database? So I can start from scratch?
well, yes. If you so desire, you may consider dropping this database or creating a new one with a new name, and run the installer again.
http://otrs.github.io/doc/manual/admin/ ... aller.html
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
RobinS
Znuny newbie
Posts: 10
Joined: 15 Jan 2016, 04:43
Znuny Version: 5.0.5

Re: Error Mail Cron and MySQL

Post by RobinS »

Well, after dropping my database and rerunning the installer, everything works fine again. There was an issue in the database, I guess. I tried a lot I have to say, maybe it's better to clear this testing database and start a new one for production.
Thanks crytias
OTRS version 5.0.6 , Operating System: Debian GNU/Linux 8 (jessie), database type: MySQL.
Locked