Warning message : ..scheduled job is not run with the same user account as the webserver

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
simonyeh
Posts: 9
Joined: Feb 05, 2018 2:08 am

Warning message : ..scheduled job is not run with the same user account as the webserver

Post by simonyeh » Mar 19, 2019 3:07 am

Hi, There

What is the root cause to the following message which is shown on my "Manage Configuration Options"?
Now I change my crontab user of EmailReporting from "root" to "apache" , but the message is the same .
-------------------------------------------------------------------------------------------------
Warning: It seems that the scheduled job is not run with the same user account as the webserver / PHP process. This could cause problems with attachments.
The SAPI for the scheduled job is most likely "cli".
The webserver runs under the following user account: apache
-------------------------------------------------------------------------------------------------
Any idea ?
thanks

SL-Gundam
Posts: 573
Joined: Jul 06, 2011 9:17 am

Re: Warning message : ..scheduled job is not run with the same user account as the webserver

Post by SL-Gundam » Mar 19, 2019 12:37 pm

you are running bug_report_mail.php (EmailReporting command line job) under a different user account then the webserver.

This can be problematic under linux, Windows often has less issues with this.
Linux for example will apply permissions under the user that created the file.
Meaning that EmailReporting will add attachments that you cannot delete properly in MantisBT since MantisBT has no permissions to delete the files

This is not always an issue but could be

simonyeh
Posts: 9
Joined: Feb 05, 2018 2:08 am

Re: Warning message : ..scheduled job is not run with the same user account as the webserver

Post by simonyeh » Mar 19, 2019 10:08 pm

Hi Sir

Base upon your advise , Is it no way to resolve it ? or how to resolve it so that the error message will disappear?
I found that my Mantis can delete the attachment normally so far.

Appreciate if any further advise.

here is my crontab setting
------------------------------------------------------------------------------------------------------------------
*/5 * * * * apache php /var/www/html/mantis/plugins/EmailReporting/scripts/bug_report_mail.php > /tmp/mantis_EmailReporting_bug_report_mail.log
-------------------------------------------------------------------------------------------------------------------

The error message is :
----------------------------------------------------------------------------------------------------------------------
Warning: It seems that the scheduled job is not run with the same user account as the webserver / PHP process. This could cause problems with attachments.
The SAPI for the scheduled job is most likely "cli".
The webserver runs under the following user account: apache
-----------------------------------------------------------------------------------------------------------------------

SL-Gundam
Posts: 573
Joined: Jul 06, 2011 9:17 am

Re: Warning message : ..scheduled job is not run with the same user account as the webserver

Post by SL-Gundam » Mar 20, 2019 8:59 am

In your cronjob you can specify the user account under which it must be run. I believe you've done it. The next time the job is run EmailReporting should update the records accordingly

There should actually be some more lines below your copy/paste which specify the current user accounts under which the SAPI modules are running

Ones EmailReporting detects (assuming it detects correctly) that both SAPI modules are running under the same account, the message will disappear

Post Reply