• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Migration Issue | errors in crontab file, can't install. | "-":1: bad hour | Fix

InsertCoin

Basic Pleskian
Migration from Plesk 10.4 to 11.5 failing:

Issue

Within Plesk 10.4 server the user has no existing scheduled jobs (Cronjobs)

When migrating a domain to 11.5 the following error is generated:

Internal server error: /usr/bin/crontab execution failed:
"-":1: bad hour
errors in crontab file, can't install.
System error: crontab execution error

Checking the old server:

#cat /var/spool/cron/crontabs/username

Code:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (crontabMzaOJb installed on Tue Dec  3 09:59:20 2013)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
[email protected]
and

#crontab -e -u username


This looks fine

Technical Stuff

Some of the log entries:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<execution-result-mixed status="warnings" log-location="">
    <backup status="success" log-location="/var/cache/20131204143728928/migration.result">
    </backup>
    <transfer status="success">
    </transfer>
    <restore status="warnings">
        <conflict-resolve status="success" log-location="">
        </conflict-resolve>
        <deploy status="warnings" log-location="">
            <object type="domain" name="example.com">
                <message code="ExecCliGate::InternalServerError" severity="warning" id="cdf616a6-74d2-401b-80c9-fd1fb4743fea">
                    <description>Internal server error: &lt;cli&gt;&lt;failure&gt;/usr/bin/crontab execution failed:
&amp;quot;-&amp;quot;:1: bad hour
errors in crontab file, can't install.
System error: crontab execution error
&lt;/failure&gt;&lt;/cli&gt;</description>
                </message>
            </object>
        </deploy>
    </restore>
</execution-result-mixed>

And the dump_object1.xml file shows:

Code:
<cid-rsync unpacksize="4616548" path="/var/www/vhosts/example.com/statistics/ftpstat/" type="ftp_stat"/><cid-rsync unpacksize="681566" path="/var/www/vhosts/example.com/statistics/anon_ftpstat/" type="anon_ftpstat"/><cid-rsync unpacksize="4096" path="/var/www/vhosts/example.com/pd/" type="pd"/><cid-rsync unpacksize="173306461" path="/var/www/vhosts/example.com/statistics/logs/" type="logs"/></content><preferences><sysuser name="username"><password type="sym">$AES-128-CBC$3ks+yvMtFusCasc424gfwrg24gh3rgv==kn24p8kPFoQ==</password><cron>[email protected]

</cron></sysuser><logrotation compress="true" max-number-of-logfiles="10" enabled="true"><logrotation-maxsize>204800000</logrotation-maxsize></logrotation><webalizer/><perfomance><max-connections>-1</max-connections><traffic-bandwidth>

This clearly shows a newline after the email address and is probably the cause of the issue.

Solution

Empty the crontab file for the user, this can be done via a text editor via SSH:

#crontab -e -u username

Run the migration again and it should now work fine.
 
Had the same issue on a different server, this time migrating from Plesk 9.5 to 11.5

logs/migration-2013-12-05-08-12-38-668/deployer.log:<subscription-info><sysuser name="username"><cron>[email protected]
logs/migration-2013-12-05-08-12-38-668/deployer.log:*/5 * * * * php -q /var/www/vhosts/example.co.uk/httpdocs/cron.php &gt;/dev/null 2&gt;&amp;1
logs/migration-2013-12-05-08-12-38-668/deployer.log:</cron></sysuser></subscription-info>
logs/migration-2013-12-05-08-12-38-668/deployer.log:[2013-12-05 08:33:28.734| 5671] INFO: HTTP response: <cli><failure>/usr/bin/crontab execution failed:
logs/migration-2013-12-05-08-12-38-668/deployer.log:errors in crontab file, can't install.
logs/migration-2013-12-05-08-12-38-668/deployer.log:System error: crontab execution error
logs/migration-2013-12-05-08-12-38-668/deployer.log:[2013-12-05 08:33:28.734| 5671] INFO: ExecCliGate::InternalServerError[decb252b-032f-40b6-8ecb-286c0b646dcd]: Internal server error: <cli><failure>/usr/bin/crontab execution failed:
logs/migration-2013-12-05-08-12-38-668/deployer.log:errors in crontab file, can't install.
logs/migration-2013-12-05-08-12-38-668/deployer.log:System error: crontab execution error

The above was a grep for "cron" on the log files, so may be missing some information.

The crontab for this user contained:

Code:
[email protected]
PATH=$PATH:/usr/bin:/usr/local/bin
*/5 * * * * php -q /var/www/vhosts/example.co.uk/httpdocs/cron.php >/dev/null 2>&1

I systematically deleted each line from the top and tried the migration, but it failed every time. Once the cronjob was removed completely the migration completed successfully.
 
Back
Top