Can't create PID PostMasterMailbox

Moderator: crythias

Locked
sonnybelvedere
Znuny newbie
Posts: 5
Joined: 18 Sep 2012, 23:49
Znuny Version: 3.1.10
Real Name: Sonny

Can't create PID PostMasterMailbox

Post by sonnybelvedere »

I been working on this issue for almost 2 days now and still can't find a resolution. What I did notice was this started happening when exchange server went down and after restarting it, OTRS fetch mail never worked again.

This is the error I am seeing in both the log in OTRS and CentOS

Can't create PID PostMasterMailbox, because it's already running (otrs.domain.com/7616)!

I have tried every single solution I can find on the net and nothing is working. From deleting the PID from the DB, to killing the processes, to restarting the process, upgrading to newest OTRS version, to rebooting. What can cause something like this to all of a sudden stop working? Can't get rid of this error message and can't fetch new mails.

I installed this on CentOS. Help please.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Can't create PID PostMasterMailbox

Post by crythias »

how often are you checking mail? Set it to a bigger number or stop cron (just for now)

There is probably another reason things aren't working (System Log?)
But right *now* just stop or comment the postmastermailbox cron and restart cron.
There is a possibility, though, that you are running the cron job under two users.

Do a manual fetch from the gui and see what happens.

also check if it's being called even if you stopped the cron.

Then check if the cron's command line would work manually.

Then uncomment and restart cron.
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
sonnybelvedere
Znuny newbie
Posts: 5
Joined: 18 Sep 2012, 23:49
Znuny Version: 3.1.10
Real Name: Sonny

Re: Can't create PID PostMasterMailbox

Post by sonnybelvedere »

crythias wrote:how often are you checking mail? Set it to a bigger number or stop cron (just for now)

There is probably another reason things aren't working (System Log?)
But right *now* just stop or comment the postmastermailbox cron and restart cron.
There is a possibility, though, that you are running the cron job under two users.

Do a manual fetch from the gui and see what happens.

also check if it's being called even if you stopped the cron.

Then check if the cron's command line would work manually.

Then uncomment and restart cron.
I set it to fetch mail every 1 minute.

-I also did manual fetch and the page just hangs, saying waiting for OTRS at the bottom right, nothing happens.
-I also just shut Cron.sh off, I don't think you can start Cron.sh in multiple users, mine warns me and says you must start it as OTRS user.

I did notice this morning after leaving this on, multiple processes of the postmastermailbox started:

otrs 12488 12487 0 03:43 ? 00:00:00 /bin/sh -c $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
otrs 12489 12488 0 03:43 ? 00:00:00 /usr/bin/perl -w /opt/otrs/bin/otrs.PostMasterMailbox.pl
otrs 12935 12934 0 04:43 ? 00:00:00 /bin/sh -c $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
otrs 12936 12935 0 04:43 ? 00:00:00 /usr/bin/perl -w /opt/otrs/bin/otrs.PostMasterMailbox.pl
otrs 13401 13400 0 05:44 ? 00:00:00 /bin/sh -c $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
otrs 13402 13401 0 05:44 ? 00:00:00 /usr/bin/perl -w /opt/otrs/bin/otrs.PostMasterMailbox.pl
otrs 13847 13846 0 06:44 ? 00:00:00 /bin/sh -c $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
otrs 13848 13847 0 06:44 ? 00:00:00 /usr/bin/perl -w /opt/otrs/bin/otrs.PostMasterMailbox.pl
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Can't create PID PostMasterMailbox

Post by crythias »

stop the cron.
try what the cron is doing from a command line.
This means explicitly:
cd /opt/otrs
bin/Cron.sh stop otrs
bin/otrs.PostMasterMailbox.pl
see what transpires.

I get it that you're trying every minute. IMO that's too frequent as if it takes > 60 seconds to process a batch of emails, you'll encounter pid errors.

Once you can verify that otrs.PostMasterMailbox.pl works, restart cron.
If it doesn't work, check your syslog for more info.
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
sonnybelvedere
Znuny newbie
Posts: 5
Joined: 18 Sep 2012, 23:49
Znuny Version: 3.1.10
Real Name: Sonny

Re: Can't create PID PostMasterMailbox

Post by sonnybelvedere »

Might be something wrong with my PostMasterMailbox.pl script. I tried to run manually run the cron job for the script and it hangs. Hm...I wonder what would cause it to hang. interesting.
sonnybelvedere
Znuny newbie
Posts: 5
Joined: 18 Sep 2012, 23:49
Znuny Version: 3.1.10
Real Name: Sonny

Re: Can't create PID PostMasterMailbox

Post by sonnybelvedere »

This definitely has something to do with the connection with exchange. It makes sense now why it stop working the minute exchange server restarted. If I delete all my mail accounts I need to fetch from in OTRS the cron works. But when I add an account to it that's when it hangs. Maybe there is something in exchange I need to change, but wondering what that could be.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Can't create PID PostMasterMailbox

Post by crythias »

troubleshoot via telnet. or
Make sure pop3 is enabled on your exchange server for your account
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
sonnybelvedere
Znuny newbie
Posts: 5
Joined: 18 Sep 2012, 23:49
Znuny Version: 3.1.10
Real Name: Sonny

Re: Can't create PID PostMasterMailbox

Post by sonnybelvedere »

Thank you for all your help Crythias.

This issue have been resolved after hours of fixing this.

Guys, if you're having a similar issue, you get the "Can't create PID PostMasterMailbox" Because Postmastermailbox job hangs. OTRS attemps to run this job again while unsuccessfully killing the other session prior to it which explains why you may get the already running error message.

After days of research, it usually pinpoints to the actual mailserver mail is being fetched from. Either mailserver has issues, or the mail is corrupted that is trying to fetch or something not authenticating correctly.

Mine was Exchange went down and POP3 service on the exchange server never restarted. After starting the services, mail flowed through like a charm and fetching worked again. Error messages went away as well because the job no longer crashes.
cordeos
Znuny newbie
Posts: 9
Joined: 20 Sep 2012, 16:08
Znuny Version: 6.0.28
Real Name: JR
Company: Cordeos Corp.

Re: Can't create PID PostMasterMailbox

Post by cordeos »

We have found the most common reason we get this error in OTRS setups is that multiple CRONTAB jobs are created.
Assuming you are using LINUX, first run the shell command:
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

This will show you if there are multiple users with OTRS related cron jobs. If only one user has OTRS CRONTAB jobs, then:
crontab -e -u otrs

This will open the otrs user CRONTAB for edit. Go through the lines and check if you have duplicate cron jobs or statements. If you have multiple postmaster cron jobs listed, here is how to fix them:

1) delete the entire contents of the otrs user crontab (it will be recreated by the OTRS scheduler)
2) restart crond and otrs service - then check if the otrs user crontab has been created with the duplicate job entries
3) again delete the entire contents of the otrs user crontab
4) delete any tmp files in /opt/otrs/var/cron (these usually end in "~" character, such as "")
5) check your actual setup files in /opt/otrs/var/cron dont have any accidental duplicates
6) restart crond and otrs service
7) confirm you have no more duplicate crontab job entries
OTRS 6.0.28 with FAQ and ITSM
On LINUX CENTOS 7.4 and (VMWare Virtual Servers - ESXi 6.7)
https://www.cordeos.com
Locked