• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Logrotate error: file size changed while zipping

Hi @learning_curve

First of all: thanks for your extensive reply :)

Secondly: I don't get everythign you are saying :( (not because you didn't explain it clearly, but because of me lacking knowledge)

Configuring this MariaDB/MySQL thing is all quite new to me, but I'm trying to understand. Please forgive me if I ask silly questions. I'm trying to learn.

  • “mysql” is now “mariadb”

What does that mean ... does it mean that everywhere it says "mysql" it is actually a reference to mariadb? So where I used to see mariadb before I now (should) see mysql? Or is it the exact opposite: where I first saw mysql I should now see mariadb?

I have the feeling I am missing some basic knowledge of what MariaDB logrotate is.

For example ... I have a Fail2Ban log ... it logs Fail2Ban activities and the log rotates after a while. I understand what is happening and why it is happening. Another log is the secure log which also rotates. It logs security related issues. I fully get it. Then we have the messages log and the mail log. I see what is logged here and I do understand why it is logged.

But now there is (or was) MariaDB. What kind of information is stored in the mariadb log? Why is there a log? What is it logging? It is just a database server I assume. Why should it log anything?

And then the other important question ... in my first install there was a directory 'mariadb' in /var/log. Now I installed a newer version of mariadb and all of a sudden there is no longer a 'mariadb' directory in /var/log, so there is no mariadb log either. Also there is no 'mysql' directory or mysql log.

I hope you can explain to me the purpose of the mariadb/mysql log (in a simple way as if you would explain it to a child ... English is not my native language) and secondly I hope you can tell me if I should enable logrotate again and what are the steps to do that.

I truly hope you can help me. This is the last 'big' thing and then my server is quite ready to go :) Thanks for your reply in advance!
 
Configuring this MariaDB/MySQL thing is all quite new to me, but I'm trying to understand.
Configuring MariaDB (to suit your own specific server needs and performance requirments etc) is a mammoth project, all on its own. There are quite a few specific forums, that specialise in exactly that, plus fixing bugs / errors / correcting setup configs etc Plus.... ALL of the very comprehensive MariaDB supplied data too. To be fair, you're not going to get all the answers you need, in this forum alone, as Plesk and MariaDB (aka MySQL :p ) are two separate products.
What does that mean ... does it mean that everywhere it says "mysql" it is actually a reference to mariadb? So where I used to see mariadb before I now (should) see mysql? Or is it the exact opposite: where I first saw mysql I should now see mariadb?
It's not quite that simple, but presumably, you're already well aware that MariaDB and MySQL are two separate databases (quick simple guide) So there's always going to be confusion (both intentional and unintentional) when it comes to naming / use of names / references / links etc between two competing products. Those changes mentioned before, are some examples of that, really. There are & always will be, loyal fans of one, but not the other, hence DB forum 'fights' etc
But now there is (or was) MariaDB. What kind of information is stored in the mariadb log? Why is there a log? What is it logging? It is just a database server I assume. Why should it log anything?
See above link for a short & simple MariaDB/MySQL databases guide, but there are millions of existing, online documents, that give lots more detail - of both.
If you think of MariaDB logrotation as a piece of string and then realise that you, yourself, can and shoud choose the length / quality / strength / all of the material components etc that makeup that piece of string... that's a simple enough analogy and that, is effectively, what you can and should do with MariaDB logging / logrotate. There's no shortcut to grasping all of the choices, you've just got to get stuck into reading, experimenting, testing etc, but always based on proven, reliable & verifiable existing data / inofrmation (of which there is lots...) Hence the 'starter' link on this very subject, that's already been posted earlier.
And then the other important question ... in my first install there was a directory 'mariadb' in /var/log. Now I installed a newer version of mariadb and all of a sudden there is no longer a 'mariadb' directory in /var/log, so there is no mariadb log either. Also there is no 'mysql' directory or mysql log.
Yep, see the last post, which gives extracted info and links to MariaDB / Percona which confirm this has happened, with some specific change examples
I hope you can explain to me the purpose of the mariadb/mysql log (in a simple way as if you would explain it to a child ... English is not my native language) and secondly I hope you can tell me if I should enable logrotate again and what are the steps to do that.
See above link for a short & simple MariaDB/MySQL databases guide. That shoud quickly answer your 1st question / provide a sufficient datum point for you.

Should you enable logrotate? Some MariaDB logrotation is normally enabled by default. If you go and re-check your server, you should be able to find the data confirming exactly that. As Server Admin, how you change the default MariaDB logrotation specification / add to it / remove it etc, That's all, entirely, your own personal & professional choice. If you've not yet, had a lot of previous exerience with MariaDB and/or using MariaDB within Plesk etc, then no pun intended ;) but there's a pretty sharp 'learning curve' ahead of you, because it's a very detailed and comprehensively featured database product. Using it within Plesk adds more layers to that. Configuirng MariaDB doesn't have nuclear fission levels of complexity, but prior information & detailed research before use is vital ;)
 
I reinstalled my server. This time AFTER installing the OS and BEFORE installing Plesk, I installed MariaDB version 10.5.

Where did you install 10.5 from?

The strange thing is ... after reinstalling (the way I described above) the directory /var/log/mariadb/ no longer exists.

That's because the log path is defined as mariadb's default of {datadir} (/var/lib/mysql):

Code:
# This logname can be set in /etc/my.cnf
# [mysqld]
# log-error=/var/lib/mysql/mysqld.log
/var/lib/mysql/mysqld.log {
}

considering log /var/lib/mysql/mysqld.log
log /var/lib/mysql/mysqld.log does not exist -- skipping[/CODE]

In the directory /var/log/ there are no log files for mysql or mariadb although the server has been running for a couple of days now.

Please check in the my.cnf/mariadb.cnf what log-error is set to, if at all, and whether it is the same as in the logrotate config.


Personally, I think it's a bad idea to log into /var/lib. I think you should change the logging location in both mariadb.cnf and the logrotate config to /var/log/, where it belongs. And maybe report this as bug to the package maintainer.
 
Where did you install 10.5 from?
Good question.
The only sensible way to do this, when using MariaDB (within Plesk) is via the link @Monty provided in post #11 in this thread (which we've done every time)
That's because the log path is defined as mariadb's default of {datadir} (/var/lib/mysql):
Correct. Although your item below that references /var/lib, is a very good reccomendation for change, we'd say.
Please check in the my.cnf/mariadb.cnf what log-error is set to, if at all, and whether it is the same as in the logrotate config.
This comes back to reading / fully understanding / testing / checking / re-testing etc after starting at the link, that's already been posted by @Monty & myself
Personally, I think it's a bad idea to log into /var/lib. I think you should change the logging location in both mariadb.cnf and the logrotate config to /var/log/, where it belongs.
Yes, fully agreed and that is exactly what we did, as you can see in post #20 in this thread. It belongs there as you've said and it makes far more logical sense.
And maybe report this as bug to the package maintainer.
We didn't, as we were quite happy to change the config ourselves (and test / re-test it etc) but each to their own.
 
Back
Top