Quartz.net cron trigger fires only once - error-handling

Started using Quartz.net in my project. But got stuck.
Using cron trigger fires only once, and stops. What may cause this problem?
Here are masks for cron trigger:
0 0/7 * * * ?
0 0/10 * * * ?
And they look good for me, also no exception raised in log. Do I have explicitly set some option to make cron trigger fire repeatedly?

For anyone who may got the same behaviour. Pay attention to you Job, try to manually run it few times, to check whether the next run won't cause exception.
For me next run caused some windsor exception, and this exception didn't raised to second chance exception. I've founded it accidentally in debug window as first chance exception and later it was somehow handled by Quartz.dll.
Pay attention to debug window in VS =] Sometimes it can make your day.

Related

Error disabling scheduled query: Error updating disabled property. Please try again later

When I try to disable a scheduled query in BigQuery web interface, I get this error:
Error updating disabled property. Please try again later.
I think that previously I made this kind of updates without problems... The "solution" I found is to remove the scheduled query, but in fact, I don't want to lose the query. Is this a new bug of this functionality or am I missing something?

Error message ContextSwitchDeadlock when processing large data [duplicate]

I am running a C# application, and during run-time I get the following error:
The CLR has been unable to transition from COM context 0x20e480 to COM context 0x20e5f0 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
Can anyone please help me out with the problem here?
Thanks a lot.
The main thread of your program has been busy executing code for a minute. It is not taking care of its normal duties, pumping the message loop. That's illegal when you use COM servers in a worker thread: calls to their methods cannot be dispatched until your main thread goes idle again.
It should be readily visible, your UI should be dead as a door nail. Windows should have replaced your main window with a ghost that displays "Not Responding". Closing the window won't work, no click events have any effect.
Whatever your main thread is doing should be done by a worker thread instead. The BackgroundWorker class is good for that, you'll find many usage help in the MSDN Library article for it. Use Debug + Break All, Debug + Windows + Threads if you have no idea what the main thread is doing.
One more possible cause: be sure to install service pack 1 if you are using the RTM version of VS2005.
To find which operation is blocking the context switch and causing the contextSwitchDeadlock MDA to be displayed, you can use the following steps. Note that I will be referring to Visual Studio 2012.
Reproduce the error. This could involve some trial and error.
Click 'OK' rather than 'Continue' in the Managed Debugging assistant which is displayed.
Ensure that the Debug Location toolbar is active by right clicking on the toolbar docking region and selecting 'Debug Location'. You should see a drop down list labelled 'Thread' in the toolbar if it is active.
The selected item in the Thread drop down list should be a thread other than the main thread as it will be a background thread that is complaining that the main thread is hogging all of the attention. Select the main thread in the drop down list.
You should now see the code that is blocking the context switch in the code editor.
Assuming that you decide against moving the resource intensive operation off your main thread - take a look at some of the other answers and comments here before you do - you have the following options to disable the Managed Debugging Assistants.
Within the Visual Studio Debugger
You can disable an MDA directly in the MDA dialog that is
displayed when the error occurs by unchecking 'Break when this
exception type is thrown'.
With Exception Settings dialog using the instructions below from MSDN.
...on the Debug menu, click Exceptions. (If the Debug menu does not contain an Exceptions command, click Customize on the Tools menu to add it.) In the Exceptions dialog box, expand the Managed Debugging Assistants list, and then clear the Thrown check box for the individual MDA.
Outside the Visual Studio Debugger
Registry Key (Machine Wide, All MDAs affected)
Environment Variable (Machine Wide, MDAs can be specified)
Application Configuration Settings (Application scope, MDAs can be specified)
Note: One of the first two options must be set to 1 for the third to have any effect.
In my case, the problem was a call to ObjectContext.SaveChanges() in the Entity Framework within a console application. With the MTAThreadAttribute applied to the Main() method the ContextSwitchDeadlock exception was no longer raised. I am unfortunately unsure of the full affects of this change.
This message indicates that some code of yours is trying to switch threads, and the target thread is busy. For example, a background thread trying to dispatch a call to the UI thread to update the UI, while the UI is running a tight loop for a while.
To actually figure out what's going on you need to break into the debugger and look at all the threads and what they are doing.
In some cases :
Debug -> Exceptions -> Managed Debug Assistants
and unchecking the ContextSwitchDeadlock item.
Simply select Exceptions from the Debug menu in the visual studio 2005 window , the Edxception Dialog box wil popup , select the Managed Debugging Assistants Exception Node , then select ContextSwitchDeadlock and remove the select from Thrown column . this will stop the vs from throwing the ContextSwitchDeadlock exception.
Hope this helps..
I ran into this issue when I was trying to figure out why my OracleDataReader was throwing an exception. I thought it was because it was getting assigned null because the exception was related to a parameter that was `null. So I did:
while (dr.Read())
{
while (dr != null) // <-- added this line
{
...
Turned out the dr was NEVER null and so the loop just went on and on until this message arrived, and on and on some more because you can click "Continue" to keep it going until you run out of memory (don't do this - click "OK" instead). So moral of the story, look for memory leaks that are streaming data from the database into memory in loops to infinity. The error is actually trying to warn you of a bad scenario. Best to heed it.
This error came up for me numerous times, and I traced it down to an iteration in DataGridViewRow, in which I set the checkbox value to true. Since I was running in debug mode, I had the option to continue, so I was able to do just this.
I hope this helps someone.
Finally, I found a working solution for my vb.net Windows Application Form
Application.DoEvents()
Statement somewhere within the loop.
Reference: https://earlybites.wordpress.com/2012/04/10/resolution-context-switch-deadlock-was-detected/
Assuming you are using Visual Studio, you can click Ctrl+Alt+E in the current project and exceptions window will display with select
Managed Debugging Assistants you should uncheck the "ContextSwitchDeadlock" option. then build a current project.

ResourceNotFoundException with full deploy to prod

I have a fully developed set of functions which work fine in the "dev" stage and it's now time for me deploy to production. Unfortunately every time I try to deploy it goes for a long time but after printing "Checking Stack update progress" it fails with a 404 error:
An error occurred: SentinelLambdaFunction - Function not found: arn:aws:lambda:us-east-1:837955377040:function:xyz-services-prod-sentinel (Service: AWSLambda; Status Code: 404; Error Code: ResourceNotFoundException; Request ID: 38f86b7a-99cd-11e8-af06-fffd92e40dc5).
This error is non-sensical to me as this function does exist and executing precisely the same full deployment to "dev" results in no error. Note that in both environment/stage, we are deploying 10 functions with a fully deployment.
I tried removing the function which was being complained about first, with the hope that I could re-include it on a second deployment but then it simply complained about a different function not existing.
I also thought maybe the "--force" parameter might push this deployment into place but it has had no impact on the error I get.
The cycle time for each attempt is very long so I'd be very grateful if anyone could help to point me in the right direction on this.
Below is a screenshot of the output when run in "verbose" mode:
In attempt to get around the error I thought maybe I'd have a better chance if I went into CloudFormation and explicitly deleted the template for prod. I attempted to do this from the GUI and got the following:
This actually has further convinced me that this removal is important but I'm not sure what to do next.
For me, the solution was:
serverless remove
and then try deploying again.
So the solution to this problem was to ensure that all previous traces of the CloudFront stack was removed. In my case I had manually taken out a few functions from Lambda and the 401 errors I was getting were likely occuring in the removal attempts rather than my assumption that it was related to adding these functions.
Bear in mind you may find yourself -- like I did -- where the first attempt to delete fails. In this case try again and make sure to check off any checkboxes exposed by UI that indicate what had caused the issues the prior attempt.
Once I'd done that I was able to deploy as per normal from the serverless framework.

rufus scheduler exception

This is driving me a bit nuts, I have rufus doing some scheduling to call a rules engine (ruleby). So most work I have running is inside the running engine and then inside the scheduler. As a result when I have a error the information is a bit limited.
Fast forward, Im still working on my code but now I have this exception error:
'undefined method `+' for nil:NilClass'
It wasnt happening before, Im not sure exactly when it started and if it was what I was doing with the code or some events that came in that come in via http push. I comment out the code I think is causing it, stops happening, I put the code back in, still not happening, I leave it for a while, starts happening again. I try and run the engine manually outside the scheduler (so just once instead of every x many minutes), doesnt happen.
Put it back on the scheduler to run a few times, starts happening again. I would google the above error but google doesnt love the + in the search. Anyone have any ideas where to direct me to for this? Its clearly something happening when the rules engine is running but it was more than happily running for weeks before i got back to trying to finish it off. Best thought is that its during the rules engine running it passes events into it one at a time and something is missing that wasnt before.
Really want to know what the + method it refers to is/could be/suppose to be.

Delayed job not executed despite disappearing from delayed_jobs table immediately

I implemented a delayed job in my Rails application, following the instructions.
I start the Rails app
I click on a link that launches the delayed job
The job is visible in the database's delayed_jobs table
I run rake jobs:work
The job disappears from the table, so I guess the job has been performed
BUT PROBLEM: /tmp/job.log has not been written (what the job should have done)
The job:
class CsvImportJob
def perform
File.open('/tmp/job.log', 'w') {|f| f.write("Hello") }
end
end
The call:
job = CsvImportJob.new
job.delay.perform
Nothing in the logs.
The rake jobs:work terminal says nothing after its start message:
[Worker(host:nico pid:25453)] Starting job worker
Nothing happen either when I launch the job while rake jobs:work is running.
In contrast, when the line "hello".delay.length is executed, delayed_jobs processes it and a message String#length completed after 0.0556 - 1 jobs processed at 3.6912 j/s, 0 failed does appear.
See https://github.com/collectiveidea/delayed_job/wiki/Common-problems#wiki-undefined_method_xxx_for_class in documentation.
Even delayed_job author don't know the reason. It somehow depends on the webserver you run in on. Try the wiki's recommendation.
See also delayed_job: NoMethodError
I'm a little late to the party, but also look at:
https://github.com/collectiveidea/delayed_job/wiki/Common-problems#wiki-jobs_are_silently_removed_from_the_database
Your case doesn't sound like a YAML deserialization error, but (as the WIKI suggests), you might set Delayed::Worker.destroy_failed_jobs = false so the failed job stays in the table and you can examine the cause of the error.
update
As I think about it: are you sure that the CsvImportJob class is known to the worker task? That is, is csv_import_job.rb defined in one of the "well known" directories for a Rails class? If not, then the worker task won't be able to de-serialize it, which will lead to exactly the behavior that you're seeing.
If for some reason, cav_import_job.rb is not in a well known directory, you can always require it from an initialization file -- that should fix the problem.