Mantis taking too long to submit a new case

Get help from other users here.

Moderators: Developer, Contributor

admin@mantis
Posts: 5
Joined: 16 Aug 2012, 22:38

Mantis taking too long to submit a new case

Post by admin@mantis »

Hello everyone, I don't normally post on forums or newsgroups and i believe this is my first time posting here. I've been having this problem with Mantis for more than 3 months now and I can't figure out how to solve it, I've researched the web hundreds of times, read Mantis documentation, forums, articles but still no luck.

The problem I'm having is that whenever a user submits a new case, it takes approximately a minute and a half for the page to refresh and display succesfull submission of the case. The other users receive emails notification almost instantly, so it's not a problem with sending email notification but with the time it takes to submit the new case. This is definitely an issue with my email settings because if I turn off Email notifications cases are submitted instantly (the page refreshes within a second).

This also occurs when a user make changes or edit cases that require Mantis to send email notifications, it also takes 1-2 minutes for the page to refresh. I've check my php settings and everything looks fine, I also increased some PHP values, but no luck. I also checked if Sendmail was working properly, sent a couple emails from command line (using Sendmail) and they go through instantly everytime. Also worth mentioning that if users perform actions that do not require Mantis to send email notifications the page refreshes instantly.

I was wondering if there is some value that I have to increase within my Sendmail/server settings, or something that can point me to the right direction! Thanks for your time in advance.

I'm running Mantis on CentOS 5.8
Mantis Version 1.2.10
PHP 5.3.15
Sendmail 8.13.8
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis taking too long to submit a new case

Post by atrol »

Check database table mantis_email_table.
Is it empty or does it contain entries?
Please use Search before posting and read the Manual
admin@mantis
Posts: 5
Joined: 16 Aug 2012, 22:38

Re: Mantis taking too long to submit a new case

Post by admin@mantis »

Hi atrol,

I checked database table "mantis_email_table" and it's empty. Result of MySQl was "MySQL returned an empty result set (i.e. zero rows). (Query took 0.0001 sec)"
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis taking too long to submit a new case

Post by atrol »

As a workaround you can send asynchronous by setting

Code: Select all

$g_email_send_using_cronjob = ON;
http://www.mantisbt.org/wiki/doku.php/m ... il_queuing
Please use Search before posting and read the Manual
admin@mantis
Posts: 5
Joined: 16 Aug 2012, 22:38

Re: Mantis taking too long to submit a new case

Post by admin@mantis »

I changed that value to $g_email_send_using_cronjob = ON; Now, I'd like to set the cronjob to every five minutes, but what file is to be executed with the cronjob? I looked for /mantis/core/send_emails.php but that file doesn't exist. I only see "/core/email_api.php" and "/core/email_queue_api.php". I'm assuming it's email_queue_api.php but I just want to make sure. Thanks
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis taking too long to submit a new case

Post by atrol »

Read the doc how to setup the job (chapter "Sending the Emails")
http://www.mantisbt.org/wiki/doku.php/m ... the_emails
The script is in directory scripts.
Please use Search before posting and read the Manual
admin@mantis
Posts: 5
Joined: 16 Aug 2012, 22:38

Re: Mantis taking too long to submit a new case

Post by admin@mantis »

Thanks for the info, I followed all the steps and now the page refreshes instantly when submitting a new case, but now users do not get email notifications. I setup an email alert for that cronjob and it says:

PHP Warning: Module 'imap' already loaded in Unknown on line 0
Sending emails...
Done.
admin@mantis
Posts: 5
Joined: 16 Aug 2012, 22:38

Re: Mantis taking too long to submit a new case

Post by admin@mantis »

Never mind! Emails are being sent normally and the page refreshes almost instantly! I submitted an issue and was waiting for email notification but my configuration doesn't send emails to users that submit the issue so I was waiting for an email that was never supposed to get to me in the first place, what an idiot :lol: I checked with other users and everyone is receiving emails!

Thank you so much for your help atrol, I really appreciate your time and your patience!
haseebraza
Posts: 26
Joined: 07 Mar 2019, 22:02

Re: Mantis taking too long to submit a new case

Post by haseebraza »

Hi,
I got same. i have changed value of $g_email_send_using_cronjob = ON; but did not understand how to execute this command
php /path/to/mantis/scripts/send_emails.php and where to write this thing
Minute = *, Hour = *, Day = *, Month = *, Weekday = * ???
Can you please help me ?

i am using Cnetos 7
Mantis 2.20
Mariadb 10.0
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis taking too long to submit a new case

Post by atrol »

haseebraza wrote: 20 May 2019, 19:47 I got same.
Did you check the same?
atrol wrote: 17 Aug 2012, 06:55 Check database table mantis_email_table.
Is it empty or does it contain entries?
Please use Search before posting and read the Manual
haseebraza
Posts: 26
Joined: 07 Mar 2019, 22:02

Re: Mantis taking too long to submit a new case

Post by haseebraza »

it is empty when i set cronjob to OFF;
but when i set cronjob to ON table contains to many emails for sending,
remember that i have not configured following things yet.

1::::::::::php /path/to/mantis/scripts/send_emails.php
2::::::::::Minute = *, Hour = *, Day = *, Month = *, Weekday = *
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis taking too long to submit a new case

Post by atrol »

@haseebraza I am not sure if I understand what you are asking for.
Might help some way http://lmgtfy.com/?q=cron+centos
Please use Search before posting and read the Manual
haseebraza
Posts: 26
Joined: 07 Mar 2019, 22:02

Re: Mantis taking too long to submit a new case

Post by haseebraza »

Dear Atrol,
I followed these instruction but emails are not sending by cronjob.
http://www.mantisbt.org/wiki/doku.php/m ... il_queuing

I did following steps :
1: email_send_using_cronjob= ON;
2: * * * * * php /var/www/html/mantis/core/email_queue_api.php
3: restarted httpd

cronjob is working after every minute but emails are stucked in the mantis_email_table;
can you please help?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantis taking too long to submit a new case

Post by atrol »

haseebraza wrote: 21 May 2019, 18:59 it is empty when i set cronjob to OFF;
Does it mean that email was working with this setting?

Independant from that, check your PHP logs for errors and warnings.
Please use Search before posting and read the Manual
haseebraza
Posts: 26
Joined: 07 Mar 2019, 22:02

Re: Mantis taking too long to submit a new case

Post by haseebraza »

Yes emails were working when cronjob was off but when i set to use cronjob emails are not moving they are stacked in the database table.
Post Reply