Abort Meteor startup immediately - meteor

Is it possible to abort Meteor startup in precisely the manner Meteor aborts startup when there's a JavaScript syntax error? I'm just concerned with development mode at the moment.
I can throw a new Meteor.Error from a startup block, but the app crashes several times before giving up and waiting for a file change.
When there's a JavaScript compile error, Meteor stops trying immediately, with a message similar to this:
=> Errors prevented startup:
While building the application:
client/home/home.js:17:3: Unexpected string
=> Your application has errors. Waiting for file change.
I'd like to cause that kind of error.

Related

Firebase: Function Triggers: A function used to work, now fails with "CANCELLED: The operation was cancelled."

I built this function months ago and has been working fine until two days ago, after updating Flutter (unrelated I presume). The function essentially reviews a users upload photo for inappropriate content before moving the documents for the public to see.
I can see the images and documents uploading correctly from app to Firestore. This then triggers the function which uses vision.ImageAnnotatorClient() to label the images ('#google-cloud/vision'). Almost immediately the function console throws this error:
onCreatePost:
Error: 1 CANCELLED: The operation was cancelled.
at Object.callErrorFromStatus (/srv/node_modules/#grpc/grpc-js/build/src/call.js:30:26)
at Http2CallStream.call.on (/srv/node_modules/#grpc/grpc-js/build/src/client.js:96:33)
at emitOne (events.js:121:20)
at Http2CallStream.emit (events.js:211:7)
at process.nextTick (/srv/node_modules/#grpc/grpc-js/build/src/call-stream.js:97:22)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
At what level is this cancellation occuring? I don't even know where to narrow down my search to.
How did this happen? Can I expect random functions to fail in the future?
Am I taking crazy pills? Feels like i'm going crazy looking for material on this.
Edit:
I have narrowed the error down to this line in my function:
var [dataTest] = await visionClient.annotateImage(request)
visionClient being an instance of vision.ImageAnnotatorClient();
vision coming from '#google-cloud/vision'
I also noticed that these errors started appearing after an unusual unique error:
onCreatePost
Error: function crashed out of request scope Function invocation was interrupted.
Solved the issue:
I had to go into my Flutter apps functions folder, where I hold my firebase cloud functions. I then had to update 'google-cloud/vision' using the following command:
npm install --save #google-cloud/vision
I deployed the new update to firebase and everything started working again... How am I supposed to catch updates on packages like this changing and breaking my code?

Asp.net unhandled exception in timer callback crashes w3wp and error not logged

I am experiencing some randomly happening unhandled exception causing w3wp to crash. I want to trace the cause of that exception. I already have a global Application_Error handler override in my MvcApplication class, so the crash must be caused by some out-of-http-context exception. In order to replicate the problem I genereate one myself in a timer callback, and try to trace it. Simplified code like
public static class MonitorTimers
{
public static Timer _taskMonitorTimer = new Timer(state: null, dueTime: 1000, period: 1000, callback: (state) =>
{
throw new Exception("Ouch! Me dead.");
});
}
In my local development environment (iisexpress launched by VS2017) and test environment (IIS 8.5), when the app starts and then crashes, the following can be seen in event viewer:
The most useful Event 1325 and 1026 sourced from ASP.NET and .NET Runtime shows the stack trace - just the thing I need.
My problem is, in my production machine (also IIS 8.5) I can't find the useful event 1325. Only a crash report, bearing no more information than I know. So I don't know what caused the error. I could surround my timer callback with try...catch block but the error could well be caused by something else (unmanaged libraries, error in static class initialization) then I still can't trace.
So suggestions on why event 1325 is missing or some tools that can show the log and analyse the stack trace is greatly appreciated. Thank you.
So, in your case you generate Exception diring Loading of application domain.
When CLR load application domain it firstly init static fields. So, if your code has problem with static fields, then exception will throw until it specifies Application_Error handler.
One more point, Is your application take a lot of memory? There are 2 cases when application can not write logs and execute code in catch block: StackOverflowException and OutOfMemoryException. Can you check is it has some memory leaks or infinite recursion?
One more point: set in visual studion setting to break when any exception throwed.
One more point: It is better to move your initialization logic from static constructors to ApplicationStart or something like this. You can do it temporary, for catch the bag and then move it to previous state.

GetAsync gives AggregateException

HttpResponseMessage response =
client.GetAsync("api/MOB_Vw_UsersAPI/GetMOB_Vw_Users?Uname=" +
uname + "&Pass=" + pass).Result;
When I run this part of code on Windows Phone emulator things going well and it works fine. However, when I run it on an Android emulator it gives me this strange error:
System.AggregateException one or more errors occurred.
What you are seeing here is an AggregateException, which means that the async method you are calling synchronously with .Result (which is bad) is failing internally for some reason.
Checking the InnerException(s), would reveal why the error occurs.
Please stop calling async methods synchronously or you are going to encounter bad issues and you will lock up your UI and potentially deadlock your application making it unresponsive.

What file change is meteor waiting for?

When I run meteor, sometimes I get an error and it hangs on
=> Your application has errors. Waiting for file change.
I think I've let it sit before and it eventually got past that message, but it always takes a long time. What file change is it waiting for? Is it npm or meteor? And is it slow for others, or is it my Koding box being finicky? Can I just stop the process or should I wait?
I don't need help resolving the error that caused this message in this specific instance, just wondering how to handle meteor errors in general when it hangs on this message and curious as to what it means.

Flex Module throwing security sandbox violation

I converted a standalone Flex app into a module. Now that it's a module, when I login (and call the backend services), I'm getting a security sandbox violation.
The login handler throws this fault String: 'Send Failed', with a more descriptive: 'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed:url: 'http://myUrl:8080/AppManager/messagebroker/amf'.
Then the FB console throws an 'unhandled security sandbox violation error'.
Can converting an app into a module cause a sandbox violation?
Thanks for any helpful tips.
I'm making extensive use of modules and haven't run into this. There are memory issues I ran into that I had to fix by actually declaring an instance of the modules in the main modules...I didn't have to create an instance, just declare a variable to get the linkage right, then have all the other modules compile against that main module. Memory errors went away, and all the other modules were much smaller too.

Resources