usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.49k stars 582 forks source link

[BUG] Domain cronjobs not updating after save from CP GUI #1086

Closed geimsdin closed 1 year ago

geimsdin commented 1 year ago

Describe the bug on Ubuntu (different versions tested: 18.04 - 20.04 and 22.04) and latest Cyberpanel (the bug is present at least since beginning of 2022 versions. After creating a new domain and setting the cronjobs first time they seem to be executed correctly, if later the cronjobs are modified or new are added the modifications are ignored until a cron service restart is performed on the server.

To Reproduce What steps did you take when the issue occurred? Access the Cron management inside any website and apply a modification or create a new cronjob, save and you will see that the cronjob executed is the previous domain crontab and not the newly saved one.

Expected behavior Cronjobs modifications should be applied as saved from CP GUI

Operating system: Ubuntu 18.04, 20.04 and 22.04

CyberPanel version: Latest in the last 2 years, the bug is there since long. At the moment I'm using the latest released

Additional context To apply the cronjob modifications I have to manually restart the cron service, sometimes even this doesn't work.

usmannasir commented 1 year ago

I've tested on almalinux, could not reproduce, let me try on Ubuntu

usmannasir commented 1 year ago

Unfortunately can't reproduce, worked on both AlmaLinux and Ubuntu 22.

geimsdin commented 1 year ago

@usmannasir I'm not making it up, it doesn't work and you can see that I am not the only one experiencing this problem, check this link: https://community.cyberpanel.net/t/cyberpanel-cron-jobs-not-working/42824/3

I don't know which test you did perform but you can save and modify the domain crontab without any problem, it is correctly saved but the modifications are not executed. I run 6 servers with Litespeed Enterprise and Cyberpanel and all of them have that issue. On a fresh install seems to work but as times goes by this bug starts giving the mentioned problems.

DevINDL commented 1 year ago

I'm Use AlmaLinux 8 the cronjob not working to before is working but I can't remember from when it didn't work, i already try upgrade cyberpanel, restart crontab still not working

usmannasir commented 1 year ago

Please contact our support so we can try to reproduce on your servers.

dowoh077 commented 11 months ago

Hey there, cyberpanel! So, I set up a cronjob through the cyberpanel admin page, you know? It's this line: `/usr/bin/curl "https://app.domain.com/API/cronjob?id=3&test=2333" > /dev/null`. But, for some reason, it ain't runnin' at all on my own server! Now, here's the kicker – when I run it manually from SSH, it works like a charm. Ain't that somethin'? Anyway, I could use some help crackin' this code. How can we fix this hiccup and get my cronjob runnin' smooth as silk on the server? Let me know, partner!

Minute | Hour | Day of Month | Month | Day of Week | Command | Action -- | -- | -- | -- | -- | -- | -- # | DO | NOT | EDIT | THIS | FILE - edit the master and reinstall. |   # | (- | installed | on | Sat | Aug 5 13:31:56 2023) |   # | (Cron | version | -- | $Id: | crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) |   0 | */2 | * | * | * | /usr/bin/curl "https://app.domain.com/API/cronjob?id=3&test=2333" > /dev/null
rhbkweb commented 11 months ago

Hi,

I also confirm this cron job bug on a new/clean installation made today.

After change/edit a cronjob, it does not work. Only works after run on SSH "service cron restart".

Environment: KVM VPS Ubuntu 22.04.3 LTS [5.15.0-78-generic] Cyberpanel: v2.3.4 (Commit: 92c7e88a17581c73da30abb7cb715805b8032ca9)

kbourro commented 9 months ago

Same issue here with ubuntu

geimsdin commented 8 months ago

just updated to last cyberpanel release and this issue is still there. The uncertainty of a cron job being executed or not is quite frustrating when you have services that relies on it.