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.


    Code
    /etc/cron.daily/logrotate:
     mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    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 '
    run-parts: /etc/cron.daily/logrotate exited with return code 1
    • Offizieller Beitrag

    Delete the mysql scheduled job from the Scheduled Jobs tab. Then try to recreate it with the mysql plugin.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Delete the mysql scheduled job from the Scheduled Jobs tab. Then try to recreate it with the mysql plugin.

    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?

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • 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.

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • So I finally tried @Stramm 's suggestion yesterday, but this morning, I woke up to this e-mail yet again. I would try @ryecoaaron 's suggestion, 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.

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • 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:

    • Offizieller Beitrag

    Here is the result of the command you listed:

    Hmm.. that is working. What about: sudo logrotate -f /etc/logrotate.d/mysql-server

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hmm.. that is working. What about: sudo logrotate -f /etc/logrotate.d/mysql-server

    That gives me the same error as the e-mail:

    Code
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    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 '
    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • 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:

    Code
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • 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:

    Code
    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?

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!