Unknown Null pointer exception at line ( -1 ) - grails

I have the following null pointer exception, I am unable to debug that due to insufficient stack trace, the exception I am getting as following,
Exception stack trace :
org.codehaus.groovy.grails.web.errors.GrailsWrappedRuntimeException#3855a1c
className=Unknown lineNumber=-1
stackTrace=java.lang.NullPointerException codeSnippet=[] gspFile=null
cause=java.lang.NullPointerException
resolver=org.springframework.core.io.support.PathMatchingResourcePatternResolver#27dee612
stackTraceLines=[java.lang.NullPointerException ] fileName=null
detailMessage=null cause=java.lang.NullPointerException stackTrace=[]
suppressedExceptions=[]
My application is working fine, but I'm continuously receiving this exception in email, I am not able to debug this issue, any help is appreciated!

Related

Azure KeyVault: Exceptions when using GetSecretAsync

In development mode, on my local machine VS2017 15.7.5, I'm using
Asp.Net MVC Core 2.1
Azure KeyVault 3.0.0
AppAuthentication 1.1.0-preview
I've built a separate project used to get secrets from the vault, adding logging and other stuff. I reference that project from my MVC project.
When I launch the site I get:
Exception thrown: 'System.IO.FileLoadException' in Microsoft.AspNetCore.Hosting.dll
Which I can't track down.
{EDIT: I found this, it as a bad reference in the CSPROJ. Everything else remains the same.}
I instantiate a AzureServiceTokenProvider like this:
_provider = new AzureServiceTokenProvider();
_client = new KeyVaultClient(new KeyVaultClient
.AuthenticationCallback(_provider.KeyVaultTokenCallback));
and then I use it like this:
try
{
var secretBundle = await _client
.GetSecretAsync(_config[$"{SecretUrlsKey}:{secretName}"])
.ConfigureAwait(false);
Debug.WriteLine("Secret retrieved from vault ...");
_secretCache.Add(secretName, secretBundle.Value);
return secretBundle?.Value;
}
catch (Exception e)
...
I then I get a flurry of errors (none of which are returned to my code). Like these:
Exception thrown: 'Microsoft.Rest.TransientFaultHandling.HttpRequestWithStatusException' in Microsoft.Rest.ClientRuntime.dll
Exception thrown: 'Microsoft.Rest.TransientFaultHandling.HttpRequestWithStatusException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Sockets.SocketException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in Microsoft.Azure.Services.AppAuthentication.dll
Exception thrown: 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.Services.AppAuthentication.AzureServiceTokenProviderException' in System.Private.CoreLib.dll
Eventually I get the value I'm looking for, but this seems a little wonky.
FWIW, I have had zero success deploying it to Azure.
Anyone have any ideas about any of this?
TIA
As for the second problem, it happened to me on two different machines. With no real scientific analysis (no time for that) my hunch is that the dotnet core update that allows you to run VS while it installs is causing the problem.
In the end, I used the Visual Studio Installer repair option and the problem went away. Something must have been corrupted.
Don't forget to backup your extensions and settings, cause the repair will nuke all that.
Nuget package clearing and reinstalling did nothing.

React Native - RCTFatalException: Unhandled JS Exception: "version" is a required argument

I'm doing a React Native App
(react-native: 0.43.4)
And I'm having problems on running Release schema on iOS.
I have Pods (Crashlytics) and I'm running my app through the Workspace Project.
On Debug schema it runs without a problem, when I switch to Release it throws this exception:
*** Terminating app due to uncaught exception 'RCTFatalException:
Unhandled JS Exception: "version" is a required argument.',
reason: 'Unhandled JS Exception: "version" is a required argument., stack:
a#551:111
i#550:244
o#550:143
l#543:504
<unknown>#381:901
<unknown>#381:676
<unknown>#381:851
<unknown>#381:676
go#381:525
<unknown>#381:651
<unknown>#381:651
<unknown>#381:651
<unknown>#381:651
<unknown>#12:741
i#2:965
t#2:572
global code#667:9
'
*** First throw call stack:
(0x18f35efd8 0x18ddc0538 0x18f35ef20 0x1000e3010 0x1000dd54c 0x18f364e80 0x18f25a2b4 0x18f25ee7c 0x1000e0f6c 0x100106e0c 0x1001067bc 0x1005f1a50 0x1005f1a10 0x1005ff2e8 0x1005f5634 0x1005ff810 0x100601630 0x10060139c 0x18e41f1d0 0x18e41ed7c)
libc++abi.dylib: terminating with uncaught exception of type NSException
I've been searching this exception although I haven't find a solution yet...
Any clue what this is?
Thank you.
Your error comes from your javascript
Unhandled JS Exception
Since it's happening only on release mode, check any js code that is executed only in that mode (for example, search for any if (!__DEV__) or other flags you might use to distinguish between release and debug mode)

Where do I get a readable stack trace in Xcode?

The following is the exception I get from iOS. It looks ridiculously unreadable (my brain is screaming wtf ten thousand miles per second). So this can’t be right. When I am developing for android, and I get an exception, the stack trace is completely readable, no magic such as 0x187d27bc8. So am I looking at the wrong window? Where in Xcode to I go to find a readable version of my stack trace? In eclipse there is a line number I can click on to get to the exact line that caused the error.
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(0x1835a6084 0x193b840e4 0x18348f300 0x18349b5b8 0x100185c94 0x100185af4 0x10009f7b4 0x10009ede4 0x10009ec9c 0x10006c5a0 0x1882f32b8 0x10006c358 0x187d5d2f4 0x187d4644c 0x187d5cc90 0x187d1c724 0x187d567b8 0x187d55e58 0x187d29660 0x187fc7d6c 0x187d27bc8 0x18355e324 0x18355d5c8 0x18355b678 0x183489664 0x18c5cb5a4 0x187d8e984 0x100139854 0x1941f2a08)
libc++abi.dylib: terminating with uncaught exception of type NSException
In your menu bar go to: Debug -> BreakPoints -> Create Exception BreakPoints. And that should do it. So the next time you run the code, it will stop at the line that caused the exception. And then to the left, you should see the stack trace.

What do the different exception codes in OS X / iOS Crash reports mean?

In Apple crash reports, there are two lines providing Exception Type and Exception Codes for the crash report. Does anybody know what all these codes actually mean?
There are some self-explaining ones ones, like KERN_INVALID_ADDRESS:
For example, this one is a NULL Pointer dereference:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
If you made an error with pointer arithmetic, you'll end up with something very similar:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00007fff50399000
But there are lots of these exception codes! For example, here's one I recently encountered and I have no clue what it means (the address points to a big memory-mapped file):
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: 0x000000000000000a, 0x0000000137676004
All I found about crash reports was this technote, but no detailed reference how to interpret exception codes.
A list of exception codes can be found in the xnu source. 0x000000000000000a is KERN_MEM0RY_ERROR:
#define KERN_MEMORY_ERROR 10
/* During a page fault, the memory object indicated
* that the data could not be returned. This failure
* may be temporary; future attempts to access this
* same data may succeed, as defined by the memory
* object.
*/

Find the root cause of a first chance exception [duplicate]

I have a project that runs perfect under windows xp.
Now I have tried to run it under Windows 7 and got there a lot of exceptions under Immediate window.
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
A first chance exception of type 'System.ArgumentException' occurred in LP_Wizard.exe
A first chance exception of type 'System.NullReferenceException' occurred in LP_Wizard.exe
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
A first chance exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in LP_Wizard.exe
Any idea what wrong with that Microsoft.VisualBasic.dll in windows 7 and how i correct that problem ?
Thanks a lot for help .
If you want to pinpoint where the exceptions are occurring, you can select the Debug->Exceptions menu item, and in the dialog that appears, check the first checkbox for "Common Language Runtime Exceptions". This will make the debugger break as soon as an exception occurs instead of only breaking on unhandled exceptions.
This is also one reason why it is generally a bad idea to catch generic exceptions unless you are clearly logging the information caught.
What is happening is the debugger can "see" exceptions as soon as they are raised (hence the "first chance") before any catch block is hit. Any exception which is not handled by a catch block is considered a "second chance" exception and will break normally.
If these exceptions aren't stopping the running of your application because they are unhandled then you are probably OK. Most of the time the exception is handled by code and this isn't a problem. The output is simply Visual Studio letting you know the exceptions were raised.
See the "Avoiding first chance exception messages when the exception is safely handled" question for some methods to reduce this if there are too many to ignore.
Are your in the debugger? Are these exceptions your program is handling? If so you need to find a setting that tells VB to supress warning you of handled exceptions. Maybey this was set when installed on XP but not when you installed on W7. See if this helps:
http://www.helixoft.com/blog/archives/24

Resources