You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been using the crontab recipe in our config for some time now, and I welcome the rewrite with sections, as it prevents duplicate entries when the crontab config is changed and resynced.
Without initially knowing about the change, it broke some of our applications and no crontab was running for some time. Only the terminal output messages, pointed me towards the new behaviour. I get, that this is only a change in a smaller recipe, but it seems to be a breaking change.
If there is a migration in place, it shouldn't be an issue. However, I noted some issues while using it and migrating existing applications to it.
Running the crontab:sync task showed it recognized a previous job in the crontab config on the server, said it would move it to the section, said it couldn't find the section, and said it would create the section.
The section was created, and the previous job was removed. However, the pre-existing job was not created anew in the new section. It seems like it cannot perform the migration and creation of a new section at the same time, breaking existing configurations.
The fix is to run the crontab:sync task again, which fixes the problem.
➜ dep crontab:sync
task crontab:sync
[***redacted***] Crontab: Found existing job in crontab, moving it to the section
[***redacted***] Crontab: Found no section, created the section with configured jobs
➜ dep ssh
➜ crontab -l
* * * * * cd ~/application1/current && /usr/bin/php8.1 artisan schedule:run >> /dev/null 2>&1
* * * * * cd ~/application2/current && /usr/bin/php8.1 artisan schedule:run >> /dev/null 2>&1
* * * * * cd ~/application3/current && /usr/bin/php8.1 artisan schedule:run >> /dev/null 2>&1
###< application4
###> application4
Hello @SimJoSt I'm sorry to hear your experience, I of course agree 100% that it should not be a breaking change in a not-major release.
I'm would love to fix this issue but looking at my code I don't understand how it does not include the migrated cronjob when first creating the section, I remember testing it as well but will try to recreate the issue myself later.
In the meantime you can perhaps look at the code responsible for the migration: https://github.com/deployphp/deployer/blob/master/contrib/crontab.php#L62-L74 I probably stared at it too much to see what could be wrong ;)
@SimJoSt I noticed your other issue (#3769) as well, I have the feeling there is something strange going on with the yaml config translation, I must admit that I have not used or seen that style of configuration before. Especially since you mention the default setting for the identifier. There is a default value set as can be seen here: https://github.com/deployphp/deployer/blob/master/contrib/crontab.php#L33-L35.
We've been using the
crontab
recipe in our config for some time now, and I welcome the rewrite with sections, as it prevents duplicate entries when the crontab config is changed and resynced.Without initially knowing about the change, it broke some of our applications and no crontab was running for some time. Only the terminal output messages, pointed me towards the new behaviour. I get, that this is only a change in a smaller recipe, but it seems to be a breaking change.
If there is a migration in place, it shouldn't be an issue. However, I noted some issues while using it and migrating existing applications to it.
Running the
crontab:sync
task showed it recognized a previous job in the crontab config on the server, said it would move it to the section, said it couldn't find the section, and said it would create the section.The section was created, and the previous job was removed. However, the pre-existing job was not created anew in the new section. It seems like it cannot perform the migration and creation of a new section at the same time, breaking existing configurations.
The fix is to run the
crontab:sync
task again, which fixes the problem.Before:
Migration:
Re-run:
The text was updated successfully, but these errors were encountered: