MySQL Cron Job Error

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • MySQL Cron Job Error

      I finally upgraded my server from OMV 3 to OMV 4, and although I had some issues along the way, everything is working. I did however get this e-mail some time in the middle of the night about a cron job error related to MySQL. Would anyone have any idea for how to fix this? My installation of MySQL on my server is managed through the openmediavault-mysql plugin.

      Source Code

      1. /etc/cron.daily/logrotate:
      2. mysqladmin: connect to server at 'localhost' failed
      3. error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
      4. error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
      5. run-parts: /etc/cron.daily/logrotate exited with return code 1
    • Delete the mysql scheduled job from the Scheduled Jobs tab. Then try to recreate it with the mysql plugin.
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • David B wrote:

      I don't have any entries in the Scheduled Jobs tab other than the one for renewing my Let's Encrypt certificate, and as far as I am aware, I did not have one before the upgrade either. Should I? If so, what do I have to do to create it?
      You should delete the letsencrypt scheduled job since the plugin creates a cron entry itself. And you should have one for mysql IF you clicked the scheduled backup button in the mysql plugin.
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      You should delete the letsencrypt scheduled job since the plugin creates a cron entry itself. And you should have one for mysql IF you clicked the scheduled backup button in the mysql plugin.
      The Lets Encrypt's schedule job was not created by me though. The plugin created it itself, and in the comment for it, it says, "Keeps certificate generate by Lets Encrypt plugin up to date. Do not delete here, disable from Lets Encrypt plugin." Concerning the backups, I never used that feature at all, so I am not sure why I am getting an error message related to it.
    • David B wrote:

      The Lets Encrypt's schedule job was not created by me though. The plugin created it itself, and in the comment for it, it says, "Keeps certificate generate by Lets Encrypt plugin up to date. Do not delete here, disable from Lets Encrypt plugin."
      The old version of the plugin created that. You can delete it.
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • David B wrote:

      but given that I did not have a cron job configured in the first place, I do not understand what he is suggesting I do.
      cron job for which plugin? The letsencrypt plugin creates a cron job that is not in the scheduled jobs tab. The mysql plugin will create a scheduled job that shows up in the scheduled jobs tab if you click scheduled backup in the mysql plugin.

      That said, looking at your error again, this is a logrotate issue because it is trying to access mysql info and can't. What is the output of the following:
      sudo my_print_defaults --mysqld
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      cron job for which plugin? The letsencrypt plugin creates a cron job that is not in the scheduled jobs tab. The mysql plugin will create a scheduled job that shows up in the scheduled jobs tab if you click scheduled backup in the mysql plugin.
      That said, looking at your error again, this is a logrotate issue because it is trying to access mysql info and can't. What is the output of the following:
      sudo my_print_defaults --mysqld
      I think I misunderstood you earlier about the cron jobs for the MySQL plugin. As for the letsencrypt one, it's working fine. I actually removed the entry on the page since it's apparently not handled that way. My apologies.

      Here is the result of the command you listed:

      Source Code

      1. --user=mysql
      2. --pid-file=/var/run/mysqld/mysqld.pid
      3. --socket=/var/run/mysqld/mysqld.sock
      4. --port=3306
      5. --basedir=/usr
      6. --datadir=/var/lib/mysql
      7. --tmpdir=/tmp
      8. --lc-messages-dir=/usr/share/mysql
      9. --skip-external-locking
      10. --bind-address=127.0.0.1
      11. --key_buffer_size=16M
      12. --max_allowed_packet=16M
      13. --thread_stack=192K
      14. --thread_cache_size=8
      15. --myisam_recover_options=BACKUP
      16. --query_cache_limit=1M
      17. --query_cache_size=16M
      18. --log_error=/var/log/mysql/error.log
      19. --expire_logs_days=10
      20. --max_binlog_size=100M
      21. --character-set-server=utf8mb4
      22. --collation-server=utf8mb4_general_ci
      23. --skip-networking
      24. --port=3306
      25. --bind-address=127.0.0.1
      Display All
    • David B wrote:

      Here is the result of the command you listed:
      Hmm.. that is working. What about: sudo logrotate -f /etc/logrotate.d/mysql-server
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      Hmm.. that is working. What about: sudo logrotate -f /etc/logrotate.d/mysql-server
      That gives me the same error as the e-mail:

      Source Code

      1. mysqladmin: connect to server at 'localhost' failed
      2. error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
      3. error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
    • David B wrote:

      That gives me the same error as the e-mail
      It must be the command below giving the error:
      mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log flush-engine-log flush-general-log flush-slow-log

      All I can think is your debian-sys-maint user had its password changed in mysql but the /etc/mysql/debian.cnf file was never updated.
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      It must be the command below giving the error:mysqladmin --defaults-file=/etc/mysql/debian.cnf --local flush-error-log flush-engine-log flush-general-log flush-slow-log

      All I can think is your debian-sys-maint user had its password changed in mysql but the /etc/mysql/debian.cnf file was never updated.
      Can it be changed on its own by an upgrade or something like that? I would expect not, but I didn't do it. That command does seem to be the problem. It gives me this error message:

      Source Code

      1. mysqladmin: connect to server at 'localhost' failed
      2. error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    • David B wrote:

      Can it be changed on its own by an upgrade or something like that?
      When upgrading from OMV 3.x to 4.x, the system changes from mysql to mariadb. While they are very close, some things are different. How root logs in is one of the things that changed. Does sudo mysql ask for a password?
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      When upgrading from OMV 3.x to 4.x, the system changes from mysql to mariadb. While they are very close, some things are different. How root logs in is one of the things that changed. Does sudo mysql ask for a password?
      I am not asked for a password. All I get is this:

      Source Code

      1. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
      When I am running these commands, I am logged in as root, so I drop the sudo. I assume your question about the password was not related to the sudo password prompt?
    • David B wrote:

      When I am running these commands, I am logged in as root, so I drop the sudo. I assume your question about the password was not related to the sudo password prompt?
      Correct, it was not about the sudo password prompt. With the recent versions of mariadb on Debian, you should go directly to the mysql prompt when doing this. Something is wrong with your install. I need to look for a fix.
      omv 4.1.11 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!