Scheduled tasks not executing programmatically - task not found

#1

I have several scheduled tasks set up like this:

I want to refire the task from within the task if there is more data to be processed. The following code returns the error that the task name (in this case aggregate20) cannot be found. Why is this?

<cfquery name="afterParty" datasource="#ds_log#">
SELECT TOP 1 AggregateID 
FROM aggregates 
WHERE dStart IS NULL AND sampleRate = #url.sampleRate# 
ORDER BY day, sampleRate, node
</cfquery>

<cfif afterParty.recordCount>
	<cfschedule action="run" task="aggregate#url.sampleRate#"/>
</cfif>
#2

What does cfschedule action=list show?

#3

It doesn’t return anything.

#4

I see that the scheduler.xml file is stored under the tomcat tree. I’m assuming the reason the task isn’t returning a list is that the scheduler.xml file lives on a different “site” than the one from which the scheduled task is being run. All of my sites are on IIS. How do I even get to the web admin for one of my iis sites so I can move the scheduled tasks there? Would they even run on a different site? I looked under web-inf/lucee for an admin folder but it doesn’t exist. The developer guide is not helpful either. I’m trying to use the documentation, but so much of it is incomplete I am not getting very far.

#5

Could you please verify your values with the url scope & the record count returned from the query.

If you running on any host, please check WEB-INF\lucee\scheduler\scheduler.xml folder also available in that location.

#6

I don’t know what you mean by url scope and query record count. The task runs, though I had to create hosts entries. I don’t know why it wouldn’t just use DNS like every other network connected device, but at least the task runs.

The populated scheduler.xml file lives under the tomcat folder where NONE of my sites are. All of my websites are on IIS and I don’t know how to get to web admin on those so I can’t set up or manage tasks on them.

#7

I understand very much what your not understanding. i"ve gone through the very same thing when using lucee for the first time. The problem is you are cross referencing webcontextes. I’ll try to do my best to explain it:

Every Domain you use in Lucee runs in different context. As I can see you are running the webadmin in:

http://127.0.0.1 (webroot would by something like lucee/webapps/root)

and in the scheduled task you are requesting a URL of a page outside (in another context):

http://l.tchguard.com (webroot can be elsewhere, e.g. inetpub/wwwroot/)

The schedulers will be listed:
for 127.0.0.1 in lucee\webapps\ROOT\WEB-INF\lucee\scheduler\scheduler.xml

but you are running urls in l.tchguard.com, that would be inetpub/wwwroot/WEB-INF\lucee\scheduler\scheduler.xml

In other words: Becaue schedules are bound to the context you won’t be able to change the scheduler of 127.0.0.1 running a page and using cfschedule in a scrip within l.tchguard.com.

You are trying to interact by cfschedule from one context to the other. That means that any cfschedule command you run inside l.tchguard.com, will not be able to add/change/delete any other schedule of 127.0.0.1. It will add/update/delete only schedules inside l.tchguard.com. You will have to stick inside the same context when trying to change schedules with cfschedule

Hope that helps a little bit.

#8

Yes, I understand. How do I get to the admin page of the web context running at l.thcguard.com so I can move the tasks there?

#9

I figured out how to access the web context for l.thcguard.com at port 8888. I tried moving the scheduler.xml file from the root tomcat scheduler folder to the web-inf scheduler folder under the l.thcguard tree and restarted tomcat, but none of my tasks are showing up in the scheduled task list. How do I move the tasks from one context to another so I can access them programmatically?

#10

They showed up after rebooting the server. However, running the task manually with the following code still returns no results. The task list is showing up in admin: https://www.screencast.com/t/58etVTUUbu

<cfschedule action="list">
#11

Did you check the logfiles inside of the context you are running the schedules? Are they running in the very same context you are running the page? The logs should be inside of webroot\WEB-INF\lucee\logs\scheduler.logs