SOLVED The system failed to lock the file

WorkinOnIt

Well-Known Member
Aug 3, 2016
227
30
78
UK
cPanel Access Level
Root Administrator
Hi

Can someone please assist with this issue?

I terminated an account that was no longer in use and received this error message in WHM:

API failure: The system failed to lock the file “/etc/mailips” because of an error: Permission denied

Logged in as root
CLOUDLINUX 6.8 x86_64 xenpv – ssd
WHM 60.0 (build 36)
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
Do you have this option set to on in WHM > Exim Configuration Manager

"Reference /etc/mailips for outgoing SMTP connections"

Also what is the output of:

Code:
# ls -l /etc/mailips
 

WorkinOnIt

Well-Known Member
Aug 3, 2016
227
30
78
UK
cPanel Access Level
Root Administrator
Hi thanks for your help;

"Reference /etc/mailips for outgoing SMTP connections": Off (default)


[email protected][~]# ls -l /etc/mailips
-rw-r----- 1 root mail 19 Nov 9 2015 /etc/mailips

The server is currently set to send mails from a specific IP address as we had spam issues with a previous IP.

Send mail from account’s dedicated IP address: off (default)
 
Last edited:

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
That's why, you have it chattr set to +i

If you run

Code:
# chattr -i /etc/mailips
this will fix it.

Someone would have purposely set it to +i though, this stops the file from being modified/deleted so you may want to check with whomever else has root access to your server to see why they set that but if you have

"Reference /etc/mailips for outgoing SMTP connections": Off (default)

then /etc/mailips is doing nothing for you other than causing that error to be thrown.
 
  • Like
Reactions: cPanelMichael

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
158
168
New Jersey
cPanel Access Level
DataCenter Provider
Perfect :)

Feel free to create and terminate an account to test, but all should be good now.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463

WorkinOnIt

Well-Known Member
Aug 3, 2016
227
30
78
UK
cPanel Access Level
Root Administrator
Well - it seems the issue has not gone away - I am now getting this message when I upgraded an account:


(XID 8rks47) The system failed to lock the file “/etc/mailips” because of an error: Operation not permitted at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 132.
Cpanel::Transaction::File::Base::new("Cpanel::Transaction::File::Raw", "path", "/etc/mailips", "permissions", 416, "ownership", ARRAY(0x5b8a318)) called at /usr/local/cpanel/Cpanel/Userdomains/CORE.pm line 429
Cpanel::Userdomains::CORE::_create_transaction(Cpanel::Userdomains::CORE=HASH(0x58436b0), HASH(0x58746e0)) called at /usr/local/cpanel/Cpanel/Userdomains/CORE.pm line 120
Cpanel::Userdomains::CORE::update(Cpanel::Userdomains::CORE=HASH(0x58436b0), "force", 0) called at /usr/local/cpanel/Cpanel/Userdomains.pm line 25
Cpanel::Userdomains::updateuserdomains() called at /usr/local/cpanel/Whostmgr/Accounts.pm line 610
Whostmgr::Accounts::_upacct("user", "clientabc", "pkg", "Standard") called at whostmgr/bin/whostmgr2.pl line 6430
main::upacct() called at whostmgr/bin/whostmgr2.pl line 1042
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

You may have a third-party plugin or script installed that's automatically changing the attributes on that file. Check to see if the immutable attribute was added back to that file:

Code:
stat /etc/mailips
lsattr /etc/mailips
Thank you.