Problem fetchmail and cron

Moderator: crythias

Locked
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Problem fetchmail and cron

Post by flaviof »

Last week I did the first installation of OTRS 4. After a upgrade for 5.
Following the wiki tutorial I finished the process but we had a problem with the fetching mail.
Reading on forum, I saw that I have to edit the line on crontab:

Code: Select all

 # fetch every 5 minutes emails via fetchmail
*/5 * * * * [ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null 
There is only this on my crontab

[~]# crontab -l -u otrsuser

Code: Select all

# Who gets the cron emails?
MAILTO="root@localhost"

# check OTRS daemon status
*/5 * * * *    $HOME/bin/otrs.Daemon.pl start >> /dev/null
And there is no /usr/bin/fetchmail


Other "problem", in folder /opt/otrs/var/cron/
there is only this files: aaa_base , otrs_daemon
I think would have exist many others;

So my problem is fetching the email to OTRS automatically for each 5 min.

Tks
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem fetchmail and cron

Post by jojo »

OTRS5 does not use cron any more. Mails can also be fetched without fetchmail

Daemon Tasks are configured via sysconfig, mailboxes can be configured within the OTRS admin interface to be fetched with POP3/S, IMAP/S
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

Oh :) Tks
I thought that I had installed in a wrong way

So, Where I can Adjust this time to fetch emails (I'm Using POP3)?
I activated here, but emails aren't came

Image
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem fetchmail and cron

Post by jojo »

You have to use Daemon::SchedulerCronTaskManager::Task###MailAccountFetch and not the fetchmail (which is an alternate *NIX software package to fetch mails and is not configured within OTRS Admin panel).

Please also check:
- if the daemon is running
- the log files
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

Tks for help Jojo,

This function is actived but didn't work yet.
Image

:?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Problem fetchmail and cron

Post by jojo »

have a look at the logfiles!
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

The Daemon is running.

The path's log changes or remains at: /opt/otrs/var/log/otrs.log ?
I cound'n find the file: otrs.log
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

Please,
I would still need solve this problem.
=/

Anyone ?
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Problem fetchmail and cron

Post by root »

What's the setting of LogModule?

P.S.: This forum organized by volunteers. They spend their free time on answering. You should consider professional support if it's essential to you.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

root wrote:What's the setting of LogModule?
P.S.: This forum organized by volunteers. They spend their free time on answering. You should consider professional support if it's essential to you.

This is my Core::Log
Image

Ok, I'll be more patient. Sorry
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Problem fetchmail and cron

Post by root »

It's set to syslog, so check out /var/log/messages, /var/log/syslog or wherever the user facility is logged.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

Part of file: /var/log/messages

Code: Select all

(...)

Nov 11 10:04:38 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-27[30908]: [Error][Kernel::System::Daemon::SchedulerDB::RecurrentTaskExecute][Line:2068]: Table 'otrs.scheduler_recurrent_task' doesn't exist, SQL: '
                SELECT id, last_execution_time
                FROM scheduler_recurrent_task
                WHERE task_type = ? AND name = ?'
Nov 11 10:04:38 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-27[30908]: [Error][Kernel::System::Daemon::SchedulerDB::RecurrentTaskExecute][Line:2051]: Table 'otrs.scheduler_recurrent_task' doesn't exist, SQL: '
                    INSERT INTO scheduler_recurrent_task
                        (name, task_type, last_execution_time, lock_key, create_time, change_time)
                    VALUES
                        (?, ?, ?, 0,
        '2015-11-11 10:04:38'
    ,
        '2015-11-11 10:04:38'
    )'
Nov 11 10:04:38 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-27[30908]: [Error][Kernel::System::Daemon::SchedulerDB::RecurrentTaskExecute][Line:2068]: Table 'otrs.scheduler_recurrent_task' doesn't exist, SQL: '
                SELECT id, last_execution_time
                FROM scheduler_recurrent_task
                WHERE task_type = ? AND name = ?'
Nov 11 10:04:38 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerCronTaskManager-27[30908]: [Error][Kernel::System::Daemon::SchedulerDB::RecurrentTaskExecute][Line:2051]: Table 'otrs.scheduler_recurrent_task' doesn't exist, SQL: '
                    INSERT INTO scheduler_recurrent_task
                        (name, task_type, last_execution_time, lock_key, create_time, change_time)
                    VALUES
                        (?, ?, ?, 0,
        '2015-11-11 10:04:38'
    ,
        '2015-11-11 10:04:38'
    )'
Nov 11 10:04:38 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:38 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:39 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:39 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:39 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerFutureTaskManager-27[31398]: [Error][Kernel::System::Daemon::SchedulerDB::FutureTaskToExecute][Line:1233]: Table 'otrs.scheduler_future_task' doesn't exist, SQL: '
            UPDATE scheduler_future_task
            SET lock_key = ?, lock_time =
        '2015-11-11 10:04:39'
   
            WHERE lock_key = 0 AND execution_time <= ?'
Nov 11 10:04:39 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:39 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:40 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:40 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:40 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-27[30911]: [Error][Kernel::System::Daemon::SchedulerDB::TaskListUnlocked][Line:418]: Table 'otrs.scheduler_task' doesn't exist, SQL: 'SELECT id FROM scheduler_task WHERE lock_key = 0 ORDER BY id ASC'
Nov 11 10:04:40 centos-otrs journal: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerFutureTaskManager-27[31401]: [Error][Kernel::System::Daemon::SchedulerDB::FutureTaskToExecute][Line:1233]: Table 'otrs.scheduler_future_task' doesn't exist, SQL: '
            UPDATE scheduler_future_task
            SET lock_key = ?, lock_time =
        '2015-11-11 10:04:40'
        
(...)
        
Image
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Problem fetchmail and cron

Post by crythias »

repeating obvious error ... did you look it up?
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
flaviof
Znuny newbie
Posts: 9
Joined: 27 Oct 2015, 19:35
Znuny Version: 5.0.1-03
Real Name: Flavio

Re: Problem fetchmail and cron

Post by flaviof »

crythias wrote:repeating obvious error ... did you look it up?
Yes I Looked some threads.

[root@centos-otrs otrs]# su - otrs

-bash-4.2$ cat scripts/DBUpdate-to-5.mysql.sql | mysql -p -f -u root otrs
Enter password:
ERROR 1061 (42000) at line 4: Duplicate key name 'link_relation_list_source'
ERROR 1061 (42000) at line 5: Duplicate key name 'link_relation_list_target'
ERROR 1050 (42S01) at line 9: Table 'scheduler_task' already exists
ERROR 1050 (42S01) at line 28: Table 'scheduler_future_task' already exists
ERROR 1050 (42S01) at line 47: Table 'scheduler_recurrent_task' already exists
ERROR 1091 (42000) at line 68: Can't DROP 'text2'; check that column/key exists
ERROR 1050 (42S01) at line 72: Table 'notification_event_message' already exists
ERROR 1050 (42S01) at line 87: Table 'cloud_service_config' already exists
ERROR 1005 (HY000) at line 101: Can't create table 'otrs.#sql-731_18bf1a' (errno: 121)
ERROR 1005 (HY000) at line 102: Can't create table 'otrs.#sql-731_18bf1a' (errno: 121)
ERROR 1005 (HY000) at line 103: Can't create table 'otrs.#sql-731_18bf1a' (errno: 121)
ERROR 1005 (HY000) at line 104: Can't create table 'otrs.#sql-731_18bf1a' (errno: 121)


-bash-4.2$ bin/otrs.Console.pl Maint::Database::Check
Trying to connect to database 'DBI:mysql:database=otrs;host=127.0.0.1' with user 'otrs'...
Connection successful.


I solved the fetch problem, adding the command line on crontab with 1 minute of interval:
# crontab -u otrs -e
*/1 * * * * $HOME/bin/otrs.Console.pl Maint::PostMaster::MailAccountFetch
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Problem fetchmail and cron

Post by root »

You did not solved the problem, you've create a workaround. I strongly suggest that you fix your system with a correct database schema.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Problem fetchmail and cron

Post by crythias »

flaviof wrote:table 'otrs.scheduler_recurrent_task' doesn't exist,
flaviof wrote:ERROR 1050 (42S01) at line 47: Table 'scheduler_recurrent_task' already exists
This can't be both true.

If Config.pm looks for a DB on a different server, updating locally won't fix the problem.
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
Locked