OTRS 3.0.9 not auto fetching tickets

Moderator: crythias

Post Reply
thunter0028
Znuny newbie
Posts: 16
Joined: 14 Jul 2011, 18:35
Znuny Version: 3.0.9

OTRS 3.0.9 not auto fetching tickets

Post by thunter0028 »

I am having an issue with my recently upgraded version of 3.0.9. It will not automatically fetch the support emails. When I do the fetch now job it works, but the email sit in the inbox until this is performed manually. My previous version was 3.0.7 and it ran fine. Can anyone point me in the right direction to fix this problem?
nathankc
Znuny newbie
Posts: 14
Joined: 15 Jun 2010, 18:56
Znuny Version: 3.0.9

Re: OTRS 3.0.9 not auto fetching tickets

Post by nathankc »

Not sure of your build - I run OTRS in a Windoze / SQL / IIS environment so my answer will obviously be geared towards that side of things, but it sounds like CRON isn't running / working since you are able to manually fetch emails just fine.

If it were on Windows, I'd check to make sure that the CRON service is installed properly post install and running, and that the cron config files are ok and in place.

good luck,
OTRS 3.0.9
Windows 2008
MSSQL 2008
IIS 7
waikiki83
Znuny newbie
Posts: 28
Joined: 25 Jul 2011, 09:15
Znuny Version: 3.0.9

Re: OTRS 3.0.9 not auto fetching tickets

Post by waikiki83 »

i have the same issues, also upgraded from 3.0.7 to 3.0.9.
if anyone has solved the issue please let us know.
OTRS 3.3.1 Windows Server 2008, Apache, MS SQL Server 2008
renee
Znuny expert
Posts: 241
Joined: 06 Feb 2009, 11:15
Znuny Version: 3.0.x
Company: Perl-Services.de
Contact:

Re: OTRS 3.0.9 not auto fetching tickets

Post by renee »

@waikiki83: Have you checked if cron is still working? Any error messages in your logfile? Without more details about your installation it is very hard to guess what's going wrong.
Need a Perl/OTRS developer? You can contact me at info@perl-services.de
nathankc
Znuny newbie
Posts: 14
Joined: 15 Jun 2010, 18:56
Znuny Version: 3.0.9

Re: OTRS 3.0.9 not auto fetching tickets

Post by nathankc »

You all have probably resolved your troubles by now bu I just upgraded my Windows installation from 3.0.7 and 3.0.9 and found the same problem. Seems like the the crontab file in the CRONw folder does not have any preset configuration. So, while your CRON service may be running, there is no schedule to execute. If you make a backup of your previous OTRS files, you can just copy the contrab file over to the new folder. If not, the new file include some commented lines that you can copy and modify to create a new schedule.
OTRS 3.0.9
Windows 2008
MSSQL 2008
IIS 7
Bucko77
Znuny newbie
Posts: 31
Joined: 29 Jun 2011, 16:02
Znuny Version: 3.0.8
Real Name: Stephen Buckton
Company: Kite Packaging

Re: OTRS 3.0.9 not auto fetching tickets

Post by Bucko77 »

Hi guys, I upgraded to 3.0.9 this morning and have the same problem but it's still an issue for me as per this forum post http://forums.otrs.org/viewtopic.php?f=61&t=10720

I've made some progress and no longer get an error on the CronW service restart and have the following in my crontab.txt file but it still won't auto sync? Any help is appreciated.

MAILTO="root@localhost"
20 0 * * 0 c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.DeleteCache.pl --expired
30 0 * * 0 c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.LoaderCache.pl -o delete
20 0 * * 0 c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.DeleteCache.pl --expired
30 0 * * 0 c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.LoaderCache.pl -o delete
*/10 * * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.GenericAgent.pl -c db
*/20 * * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.GenericAgent.pl
45 */2 * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.PendingJobs.pl
*/1 * * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.PostMasterMailbox.pl
01 01 * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.RebuildTicketIndex.pl
55 */2 * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.DeleteSessionIDs.pl --expired
35 * * * * c:/Program Files (x86)/OTRS/StrawberryPerl/perl/bin/perl.exe c:/Program Files (x86)/OTRS/bin/otrs.UnlockTickets.pl --timeout
OTRS 3.0.9 & ITSM 3.0.4 running on Windows Server 2008 R2 with MySQL database, iPhonehandle 1.0.3, Active Directory LDAP integration.
Bucko77
Znuny newbie
Posts: 31
Joined: 29 Jun 2011, 16:02
Znuny Version: 3.0.8
Real Name: Stephen Buckton
Company: Kite Packaging

Re: OTRS 3.0.9 not auto fetching tickets

Post by Bucko77 »

Apologies guys, I've just managed to resolve this. This very helpful post http://forums.otrs.org/viewtopic.php?f=64&t=10080 pointed me in the right direction, I had some typos in the path locations in my otrs.Cron4win32.pl file.

Stephen.
OTRS 3.0.9 & ITSM 3.0.4 running on Windows Server 2008 R2 with MySQL database, iPhonehandle 1.0.3, Active Directory LDAP integration.
waikiki83
Znuny newbie
Posts: 28
Joined: 25 Jul 2011, 09:15
Znuny Version: 3.0.9

Re: OTRS 3.0.9 not auto fetching tickets

Post by waikiki83 »

@renee... here is the error message i got from Cronw\log folder

[2011/07/26 04:13:00] failed to start 'C:\Windows\system32\cmd.exe': The directory name is invalid.
OTRS 3.3.1 Windows Server 2008, Apache, MS SQL Server 2008
klimeb
Znuny newbie
Posts: 3
Joined: 26 Jul 2011, 10:28
Znuny Version: 3.0.8
Real Name: Klime B
Company: Seavus

Re: OTRS 3.0.9 not auto fetching tickets

Post by klimeb »

Hi,

I also have the same issue on my 3.0.8

So far, I have replaced the "otrs.Cron4win32.pl" from 3.0.7 version, and the "crontab.txt" become properly populated. I have set the auto fetching emails in there to be done on every 2 minutes.

In the "cronw.log" I see that there are entries on every 2 minutes, but same content: "[2011/07/26 13:40:00] failed to start 'C:\Windows\system32\cmd.exe': The directory name is invalid."

Also, I noticed that when restarting the services, I got the following error: "Can't open directory 'crontab.txt: No such file or directory". This message comes from the "otrs.Cron4win32.pl".

I have checked all paths and the file, and all looks properly, but the errors are there and the fetching is not happening. If I do it manually, it works.

Does someone have any idea where the problem might be?

Thanks in advance.
waikiki83
Znuny newbie
Posts: 28
Joined: 25 Jul 2011, 09:15
Znuny Version: 3.0.9

Re: OTRS 3.0.9 not auto fetching tickets

Post by waikiki83 »

just an update i already got mine solved.
my problem was that i got wrong path on my crontab.txt file
the path on this file comes from otrs.Cron4win32.pl
so I corrected also the paths inside otrs.Cron4win32.pl and got it working.
OTRS 3.3.1 Windows Server 2008, Apache, MS SQL Server 2008
klimeb
Znuny newbie
Posts: 3
Joined: 26 Jul 2011, 10:28
Znuny Version: 3.0.8
Real Name: Klime B
Company: Seavus

Re: OTRS 3.0.9 not auto fetching tickets

Post by klimeb »

Thanks.

I also updated mine paths and I fixed the restarting error "Can't open directory 'crontab.txt: No such file or directory". I have Win2k8 64 bit, so I changed the "Program Files (x86)" part.

However, the errors in the "cronw.log" regarding the "failed to start 'C:\Windows\system32\cmd.exe': The directory name is invalid." have remained.

Can you please specify which paths exactly have you changed?

Thanks in advance waikiki83

Regards
waikiki83
Znuny newbie
Posts: 28
Joined: 25 Jul 2011, 09:15
Znuny Version: 3.0.9

Re: OTRS 3.0.9 not auto fetching tickets

Post by waikiki83 »

i changed this part in otrs.Cron4Win32.pl


my $PerlExe = "c:/OTRS/StrawberryPerl/perl/bin/perl.exe";
my $Directory = "c:/OTRS/OTRS/var/cron";
my $CronTabFile = "c:/OTRS/CRONw/crontab.txt";
my $OTRSHome = "c:/OTRS/OTRS/";

Hope this helps!
OTRS 3.3.1 Windows Server 2008, Apache, MS SQL Server 2008
MichaelR
Znuny expert
Posts: 250
Joined: 12 Oct 2010, 01:35
Znuny Version: 3.0.9
Company: LRS Health

Re: OTRS 3.0.9 not auto fetching tickets

Post by MichaelR »

Yeah someone screwed up and left all weird directories in the otrs.Cron4Win32.pl file.

Don't edit the crontab.txt, edit OTRS/var/cron/postmaster.dist :)
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks :)
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
klimeb
Znuny newbie
Posts: 3
Joined: 26 Jul 2011, 10:28
Znuny Version: 3.0.8
Real Name: Klime B
Company: Seavus

Re: OTRS 3.0.9 not auto fetching tickets

Post by klimeb »

I finally got it right :)

First, I tried editing the wrong locations in the otrs.Cron4Win32.pl that came with 3.0.9 as waikiki83 did.

That removed the errors, but the autofetch was still not working.

At the end, I copied the otrs.Cron4Win32.pl from 3.0.7 and now all works fine.

Thank you all for the help.
MichaelR
Znuny expert
Posts: 250
Joined: 12 Oct 2010, 01:35
Znuny Version: 3.0.9
Company: LRS Health

Re: OTRS 3.0.9 not auto fetching tickets

Post by MichaelR »

You should compare the new and old ones to see what changed ;)

Pretty sure you should just keep 3.0.9's version

This is my *working* version of otrs.Cron4Win32.pl

Code: Select all

#!/usr/bin/perl -w
# --
# bin/otrs.Cron4Win32.pl - a script to generate a full crontab file for OTRS
# Copyright (C) 2001-2011 xxx, http://otrs.org/
# --
# $Id: otrs.Cron4Win32.pl,v 1.3.2.3 2011/06/11 19:02:21 mb Exp $
# --
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU AFFERO General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# or see http://www.gnu.org/licenses/agpl.txt.
# --

use strict;
use warnings;

# use ../ as lib location
use File::Basename;
use FindBin qw($RealBin);
use lib dirname($RealBin);

use vars qw($VERSION);
$VERSION = qw($Revision: 1.3.2.3 $) [1];

my $PerlExe   = "C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe";
my $Directory = "C:/PROGRA~2/OTRS/OTRS/var/cron/";
my $CronTabFile   = "C:/PROGRA~2/OTRS/CRONw/crontab.txt";
my $OTRSHome  = "C:/PROGRA~2/OTRS/OTRS";

opendir( my $DirHandle, $Directory ) or die "ERROR: Can't open $Directory: $!";

my @Entries = readdir($DirHandle);
closedir($DirHandle);
open my $CronTab, '>', $CronTabFile
    or die "ERROR: Can't write to file $CronTabFile: $!";
CRONFILE:
for my $CronData (@Entries) {
    next CRONFILE if ( !-f "$Directory/$CronData" );
    next CRONFILE if ( $CronData eq 'postmaster.dist' );
    open( my $Data, '<', "$Directory/$CronData" )
        or die "ERROR: Can't open file $Directory/$CronData: $!";
    LINE:
    while ( my $Line = <$Data> ) {
        next LINE if ( $Line =~ m{ \A \# }xms );
        next LINE if ( $Line eq "\n" );

        # replace $HOME with path to Perl plus path to script
        $Line =~ s{\$HOME}{$PerlExe $OTRSHome}xms;

        # there's no /dev/null on Win32, remove it:
        $Line =~ s{>>\s*/dev/null}{}xms;
        print $CronTab "$Line";
    }
    close($Data);
}
close($CronTab);

1;
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks :)
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
bjanakos
Znuny newbie
Posts: 3
Joined: 03 Aug 2011, 04:15
Znuny Version: 3.0.9
Real Name: Bill

Re: OTRS 3.0.9 not auto fetching tickets

Post by bjanakos »

I have a new installation of 3.0.9 on Centos 6 and I am having the same problem. I am also having a problem where the Generic Agent is not running at the specified times, but works manually. Is there a fix for the Linux guys?
renee
Znuny expert
Posts: 241
Joined: 06 Feb 2009, 11:15
Znuny Version: 3.0.x
Company: Perl-Services.de
Contact:

Re: OTRS 3.0.9 not auto fetching tickets

Post by renee »

Have you created a cronjob for that? See http://doc.otrs.org/3.0/en/html/manual- ... l#cronjobs

If you have done this, are there any entries in the log?
Need a Perl/OTRS developer? You can contact me at info@perl-services.de
figginsj
Znuny newbie
Posts: 1
Joined: 03 Aug 2011, 10:37
Znuny Version: 3.0.9
Real Name: James Figgins

Re: OTRS 3.0.9 not auto fetching tickets

Post by figginsj »

Hi All,

I am new to OTRS and had the same issue with CRON jobs not running. I used a number of posts in this and other threads and managed to get it working. So I thought it may be useful to share my steps and findings.

I am running OTRS 3.0.9 (fresh install) on a Windows 2008 x64 server setup as a virtual machine using VMWare.
I first noticed the issue when the fetching of support mails which would only work if run manually via the OTRS Admin.
Because the manual fetch ran OK, I put the issue down to CRON.
First I checked the CRON service which was running and set to Automatic.

A previous post made me check the crobtab file and as expected the various jobs were not setup in here.
The post then led me to check the otrs.Cron4Win32.pl file and the paths were not set correctly in here, hence the jobs not being setup in crontab (Cron4Win32.pl creates the jobs in crontab).
I amended the paths in Cron4Win32.pl to the correct paths on my server NOTE: I made two mistakes here, please be aware of the following:
1) All paths must use the forward slash / not backslash \ which appears to be an escape char. e.g c:/otrs/otrs NOT c:\orts\otrs
2) All paths must be in short notation, long path and file names are not supported by CRON even though NO error was recorded in the CRON logs. e.g c:\PROGRA~2\otrs\ NOT c:\program files (x86)\otrs.
So I ended up with the following paths in my Cron4Win32.pl file

Code: Select all

my $PerlExe     = "C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe";
my $Directory   = "C:/PROGRA~2/OTRS/OTRS/var/cron";
my $CronTabFile = "C:/PROGRA~2/OTRS/CRONw/crontab.txt";
my $OTRSHome    = "C:/PROGRA~2/OTRS/OTRS";
After this I opened up a command prompt and ran:
"C:\Program Files (x86)\OTRS\StrawberryPerl\perl\bin\perl.exe" "C:\Program Files (x86)\OTRS\OTRS\bin\otrs.Cron4Win32.pl"
This executes the Cron3Win32.pl script which should then set the CRON jobs in crontab. I opened crontab to check these looked correct. Here is my new crontab file:

Code: Select all

MAILTO="root@localhost"
20 0 * * 0  C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.DeleteCache.pl --expired 
30 0 * * 0  C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.LoaderCache.pl -o delete 
*/10 * * * *    C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.GenericAgent.pl -c db 
*/20 * * * *    C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.GenericAgent.pl 
45 */2 * * *    C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.PendingJobs.pl 
*/2 * * * *    C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.PostMasterMailbox.pl 
01 01 * * * C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.RebuildTicketIndex.pl 
55 */2 * * *    C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.DeleteSessionIDs.pl --expired 
35 * * * *  C:/PROGRA~2/OTRS/StrawberryPerl/perl/bin/perl.exe C:/PROGRA~2/OTRS/OTRS/bin/otrs.UnlockTickets.pl --timeout 
Note: I changed the check interval on the PostMasterMailbox from */10 (10 mins) to */2 (2 mins) as 10 mins is too long for my requirements.

I then rebooted the server to ensure the new jobs were read by the CRON service. I guess that just restarting the CRON service would have worked just as well but wanted to make sure.

My issue was resolved :)

Many thanks to everyone who has contributed to this thread and helped me to identify and correct the problem. I hope that my additional findings are of use to someone.

James
bjanakos
Znuny newbie
Posts: 3
Joined: 03 Aug 2011, 04:15
Znuny Version: 3.0.9
Real Name: Bill

Re: OTRS 3.0.9 not auto fetching tickets

Post by bjanakos »

renee wrote:Have you created a cronjob for that? See http://doc.otrs.org/3.0/en/html/manual- ... l#cronjobs

If you have done this, are there any entries in the log?
I have not... I used the RPM install. I guess I have more work to do.
gogo_sven
Znuny newbie
Posts: 2
Joined: 04 Feb 2008, 14:01

Re: OTRS 3.0.9 not auto fetching tickets

Post by gogo_sven »

Thank you :)

Fixed the same issue on my system...
Kitty
Znuny newbie
Posts: 23
Joined: 18 Aug 2011, 10:10
Znuny Version: 3.0.10

Re: OTRS 3.0.9 not auto fetching tickets

Post by Kitty »

Can someone post the files from the stable version? So i just need to check what changed.

I don't know what I do wrong, but I don't even get an error message in my system log.
OTRS Version 3.0.10 on
OpenSUSE
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: OTRS 3.0.9 not auto fetching tickets

Post by jojo »

cvs.otrs.org
"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
Kitty
Znuny newbie
Posts: 23
Joined: 18 Aug 2011, 10:10
Znuny Version: 3.0.10

Re: OTRS 3.0.9 not auto fetching tickets

Post by Kitty »

Okay, I have different paths in my otrs.Cron4Win32.pl.

I edited them, but I cant find crontab.txt nor the directory CRONw.

What should I as CronTab?
OTRS Version 3.0.10 on
OpenSUSE
Kitty
Znuny newbie
Posts: 23
Joined: 18 Aug 2011, 10:10
Znuny Version: 3.0.10

Re: OTRS 3.0.9 not auto fetching tickets

Post by Kitty »

Nevermind, I use a daffy workaround now.
OTRS Version 3.0.10 on
OpenSUSE
Post Reply