Error while upgrading MariaDB

RealMafia

Registered
Jan 6, 2019
4
1
3
Lebanon
cPanel Access Level
Website Owner
(XID pg2qxw) The system failed to lock (LOCK_EX, LOCK_NB) the file “/var/cpanel/cpanel.config” because of an error: Cannot allocate memory
Obtained version information from system.

I was upgrading MariaDB and I got this critical error and now everything stopped working.

Any thoughts? Thank you
 

El Directo

Member
Jan 4, 2019
5
1
1
San Antonio
cPanel Access Level
DataCenter Provider
I would expect that by now you have probably tried restarting the system by now, however if the MariaDB service is not loading your sites are probably stil failing to load. Let's focus on the immediate issue of getting your sites back up first and then look towards finding out what happened to prevent the failed upgrade next time.

That said, can you try the following command:

Code:
service mysql restart
If that continues to fail, here's how we can try and see what is preventing it from starting most immediately. Run this command:

Code:
ls -alh /var/lib/mysql | grep 'err'
Once that finishes you should see the name of the mysql error log file. Take that file name and use it with the path /var/lib/mysql in the next command. Try this to see what the errors have been (last ones are most recent).

Code:
grep -i 'error' /var/lib/mysql/replace.with.your.file.err
Here you are looking for the error with "Aborting" in the lines following close by. Please post the output of that last command.
 
  • Like
Reactions: cPanelMichael

hicom

Well-Known Member
May 23, 2003
291
4
168
If still not working, try to check mysql from scripts:

/scripts/check_mysql
 

RealMafia

Registered
Jan 6, 2019
4
1
3
Lebanon
cPanel Access Level
Website Owner
I would expect that by now you have probably tried restarting the system by now, however if the MariaDB service is not loading your sites are probably stil failing to load. Let's focus on the immediate issue of getting your sites back up first and then look towards finding out what happened to prevent the failed upgrade next time.

That said, can you try the following command:

Code:
service mysql restart
If that continues to fail, here's how we can try and see what is preventing it from starting most immediately. Run this command:

Code:
ls -alh /var/lib/mysql | grep 'err'
Once that finishes you should see the name of the mysql error log file. Take that file name and use it with the path /var/lib/mysql in the next command. Try this to see what the errors have been (last ones are most recent).

Code:
grep -i 'error' /var/lib/mysql/replace.with.your.file.err
Here you are looking for the error with "Aborting" in the lines following close by. Please post the output of that last command.
Thank you for your reply.
Yes I tried to restart system. I had someone to try some commands and he actually fixed half of it. But there’s a problem that’s still going, the same first problem but all websites are working.

Im getting error:
API failure: (XID e4wsg6) The system failed to lock (LOCK_EX, LOCK_NB) the file “/var/cpanel/cpanel.config” because of an error: Cannot allocate memory

On whmcs also.
 

hicom

Well-Known Member
May 23, 2003
291
4
168
Check /etc/my.cnf and set it back to default, also look into upgrading your machine memory.

You can see available ram typing: free -m
 

RealMafia

Registered
Jan 6, 2019
4
1
3
Lebanon
cPanel Access Level
Website Owner
Check /etc/my.cnf and set it back to default, also look into upgrading your machine memory.

You can see available ram typing: free -m
How do I set my.cnf back to default?
I tried to read file:
Code:
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

[mysqld]
max_allowed_packet=268435456
~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       "/etc/my.cnf" 13L, 240C
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

[mysqld]
max_allowed_packet=268435456
~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~                                                       ~
And got this.

Also,
For ram:
free -m
total used free shared buff/cache available
Mem: 4096 451 2031 1 1612 3521
Swap: 4096 1 4094
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello @RealMafia,

I see that support ticket number 11137321 is opened to investigate this issue. Here's the most recent response from one of our Technical Analysts:

I am still showing that your server is unable to lock any files as it reports ENOMEM when attempting to lock a file:

=====
# flock -s /tmp/-c ls
flock: /tmp/-c: Cannot allocate memory
=====

It is possible that the parent server that your virtuozzo instance is having resource issues that are not reflected within your instance. At this time, I recommend reaching out to your hosting provider (or whoever maintains the parent server that your instance is hosted on) in order to have them investigate this issue further on the parent server.
Please feel free to respond to the support ticket with any additional questions. I'll monitor the ticket and update this thread with the final outcome once it's closed.

Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello,

I'm glad to see the issue was solved. Thanks for sharing the outcome.