Schedule continues to run after deletion

Wappler Version : 6.7.2
Operating System : Mac OS
Server Model: Nodejs
Database Type: mysql
Hosting Type: OrangeHost

Expected behavior

What do you think should happen?

Deleted Schedule server actions should not continue to run.

Actual behavior

What actually happens?

Scheduled server actions continues to run after deletion.

How to reproduce

I had set up three schedule actions in my project and published them. One of them was not working as intended so I deleted it locally and republished the site. The schedule was not deleted on the remote site, so I deleted it through CPanel. I took the extra step of emptying the CPanel trash.

Despite this, the deleted schedule action continues to run every day and send out emails to myself and users.

I am at a loss as to how else to remove to remove the scheduled action or where to look for it to remove it. I have done a search in the CPanel files section and cannot find it by file name.

Don't know if its needed, but don't you need to restart your nodejs server?

2 Likes

The underlying problem

Franse's solution will work, but bug report should stay open

Sorry if I'm asking something obvious, but why?
It's not an expected behavior?

When I create/delete something on the vps, it doesn't seem to take action unless restart index.js

If you delete a Server Action (or Scheduled Action, what he did) from local environment, I'm expecting to delete on remote environment. This is not happening! It's not about lack of restart, Wappler creates a restart.txt file to trigger a restart

And then he manually deleted it, but didn't restart the NodeJS server!

1 Like

True, two different things, sorry, realized by re-reading the description after saying that.

So @scott practically also says this doesn't work:

1 Like

Did you use FTP for publishing the site? With FTP synchronization we do not delete remote files that are not on the local machine, because you might have user uploads that you don’t want to loose…

So that is why remote files have to be deleted manually. You can do that easily by using the remote target on the ftp manager in Wappler.

I'm kind of confused now...

The option "Delete Remote files not existing loyally" is for that reason, right?

I never used it but... I suppose it does what is says...

yes that is it exactly for. But you do have to enable it on publish :slight_smile:

1 Like

Ok, I'll try logging into OrangeHost and doing a nodejs restart that way. I had not considered that.

I have FTP set in the project settings and I use a combination of the push button when it is just files and the Publish button when there is a database change. I thought with the restart.txt that the server was being restarted and maybe it is, just not fully or something. I know it is not available for a few seconds after I either push or Publish the site.

Either way, I'll give it a try and see what happens, I will not know if it worked until tomorrow when it "runs" again. :slight_smile:

Restarting the Nodejs sever on the host itself did not resolve the issue.
The Schedule that had been deleted ran today. :frowning:

This is not a solution but more of a work-around until you have a solution. Edit the offending scheduled Action and empty all the steps and just have a comment. That way the file will be replaced essentially with a redundant Action that won't do a lot...

1 Like

Good idea, doing it now. I had to go through the local GIT to find the name of the file again, LOL.

1 Like

Please note that as long as the schedule file exist on your remote server, it will be auto loaded and scheduled for execution on each server restart.

So deleting the file locally won’t help and you have to delete it remotely as well.

Or just use the Publish functionality with the option "Delete Remote files not existing loyally" checked as stated above.

As stated above, the file does not exist on the remote server or the local server. :slight_smile: That is the issue. The schedule file is running when it should not because it has been deleted.

Well if the file was not there and the NodeJS server was restarted, there is no way it could pick up the old schedule… so there must be something else..

Are you sure it is this file that is running?

Yes, originally, I had three Schedule actions that sent emails each with a different email subject.

1.) For City actions that ran at 1400 UTC
2.) For State actions that ran at 1500 UTC
3.) For National actions that ran at 1600 UTC

The City action was not retrieving data correctly from the data base query so people who should not be getting emails were getting emails. Unable to resolve the issue, the Schedule action was deleted locally and remotely. The Schedule action continues at 1400 UTC every day (roughly 90 minutes ago). I am included on the email list, so I receive the emails along with the other people, which is how I know it is running.

I have implemented Cheese's solution of creating a Schedule action with the same name and only a comment with a timer of every 15 minutes to see if that resolves the issue.

You need to enable debug mode and check the NodeJS log (console log) and see if the schedule is being loaded

The Schedule action in question just ran at 1400 UTC again.

To summarize, the schedule action had been deleted from the local and remote sever. The Nodejs server has been restarted via Wappler and the host CPanel.

A "dummy" schedule action has been recreated with only a comment in an attempt to override the deleted schedule action.

Still at a loss as to how this is happening. @Hyperbytes, could this be something with OrangeHost itself and not Wappler?

Sounds like you need to enable debug mode and see the NodeJS server logs to see if the scheduled action is being miraculously loaded