Troubleshooting

Crash reporting can sometimes be tricky to get going. If you're having trouble, see if you're effected by some these common setup issues. If you have another issue please get in touch.


There are many reasons why crash reports may not be sent through.

Raygun providers have an throwOnError property; set to false by default. Setting this to true will allow any errors occurring in Raygun4Net to bubble up the stack, and be reported as an unhandled exception.

Add this attribute in the raygun4Net Config section or enable it in the config options of the client:

<RaygunSettings apikey="paste_your_api_key_here" throwOnError="true"/>

Internal errors will be sent to the OS the event viewer. Alternatively you could attach a trace listener and log to a text file as well.

If the Event Viewer error message mentions "The underlying connection was closed: An unexpected error occurred on a send." This is probably a TLS handshake issue (See Below). Confirm this by inspecting the inner exception or the rest of the trace and look for a cipher mismatch phrase.


When sending events to Raygun, it is essential to ensure that your systems communicate using current Transport Layer Security (TLS) protocols and secure ciphers. Failure to comply with relevant security standards may result in event discarding at the gate. Raygun's ingestion nodes currently support TLS Versions 1.1, 1.2, and 1.3.

To guarantee successful communication, please follow these guidelines:

Events sent to Raygun must be transmitted using the following TLS versions:

  • TLS 1.1
  • TLS 1.2
  • TLS 1.3

Ensure that your hosting Operating System supports an accepted set of TLS versions and ciphers. Refer to the documentation specific to your system for more information:

If you are using any of the following Raygun Crash Reporting Provider versions, make sure to upgrade them to a minimum version that offers TLS 1.1, TLS 1.2, and TLS 1.3 support:

  • Serilog.Sinks.Raygun 5.3.3+
  • Mindscape.Raygun4Net 6.0.3+
  • Mindscape.Raygun4Net.Core 6.0.3+
  • Mindscape.Raygun4Net.Mvc 6.0.3+
  • Mindscape.Raygun4Net.WebApi 6.0.3+

If you are working with legacy C# code that prevents you from updating the Raygun provider, you can enable support for TLS 1.1 or TLS 1.2 by adding the following code snippet in your main method:

using System.Net;
 
 // Enable TLS 1.1 or TLS 1.2
 ServicePointManager.SecurityProtocol |= (SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12);
 

For crashes and errors occurring at end-users' devices, TLS limitations are less likely to be a concern. Modern browsers, when updated, automatically support the current TLS versions. To verify if a browser supports TLS 1.1, TLS 1.2, or TLS 1.3, refer to the following resources:

By ensuring compliance with TLS protocols and adopting secure ciphers, you can securely transmit events to Raygun and effectively monitor crashes and errors in your applications.


Re-setting an application API key, will require deploying the updated API key to your apps configuration.

Please check the API key matches the Raygun Application expecting to see crash reports in. You can check the API key by:

  1. Selecting the Raygun Application (Top menu)
  2. Clicking "Application settings" in the left-hand menu
  3. Checking the field Api Key

Please double check that you application was built and deployed correctly, and the deployment configuration settings of your Production Application API Key are set correctly.


You can send a test Crash Report from your server to check if there any networking issues which need to be addressed. (e.g., a firewall which need a whitelist rule added)

Here is an example powershell script which can be used:


$apikey = 'paste_your_api_key_here'


$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("X-ApiKey", $apikey)
$headers.Add("Content-Type", "application/json")

$occurredOn = [datetime]::Now.ToUniversalTime().ToString("o");

$body = "{
`n    `"OccurredOn`": `"$occurredOn`",
`n    `"Details`": {
`n        `"MachineName`": `"WIN-0HOJHN7A0D7`",
`n        `"Version`": `"Not supplied`",
`n        `"Error`": {
`n            `"Data`": {},
`n            `"ClassName`": `"Demo123`",
`n            `"Message`": `"Powershell to Raygun test`",
`n            `"StackTrace`": [
`n                {
`n                    `"LineNumber`": 15,
`n                    `"ClassName`": `"test test ya`",
`n                    `"MethodName`": `"methodname`"
`n                },
`n                {
`n                    `"LineNumber`": 15,
`n                    `"ClassName`": `"critical`",
`n                    `"MethodName`": `"awesomesauceness`"
`n                },
`n                {
`n                    `"LineNumber`": 0,
`n                    `"ClassName`": `"bar`",
`n                    `"MethodName`": `"bare`"
`n                },
`n                {
`n                    `"LineNumber`": 0,
`n                    `"ClassName`": `"test`",
`n                    `"MethodName`": `"testerestser`"
`n                }
`n            ]
`n        },
`n        `"Environment`": {
`n            `"ProcessorCount`": 99,
`n            `"OSVersion`": `"6.2.9200`",
`n            `"WindowBoundsWidth`": 1024,
`n            `"WindowBoundsHeight`": 768,
`n            `"Cpu`": `"Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz`",
`n            `"Architecture`": `"AMD64`",
`n            `"TotalVirtualMemory`": 8388607,
`n            `"AvailableVirtualMemory`": 8379462,
`n            `"DiskSpaceFree`": [
`n                55.498355865478516,
`n                52.96750259399414,
`n                21.393081665039062
`n            ],
`n            `"TotalPhysicalMemory`": 7679,
`n            `"AvailablePhysicalMemory`": 2570,
`n            `"UtcOffset`": 12,
`n            `"Locale`": `"English (United States)`"
`n        },
`n        `"Client`": {
`n            `"Name`": `"Raygun4Net4.0`",
`n            `"Version`": `"5.1.0.0`",
`n            `"ClientUrl`": `"https://github.com/MindscapeHQ/raygun4net`"
`n        },
`n        `"UserCustomData`": {
`n            `"handler`": `"From Raygun4JS snippet global error handler`"
`n        },
`n        `"Tags`": [
`n            `"Awesome`",
`n            `"Critical`"
`n        ],
`n        `"User`": {
`n            `"Identifier`": `"123users1nique_id1`",
`n            `"IsAnonymous`": `"`",
`n            `"Email`": `"emailAddr`",
`n            `"FullName`": `"A Full Name`",
`n            `"FirstName`": `"A First Name`",
`n            `"UUID`": `"uuid`"
`n        },
`n        `"Response`": {
`n            `"statusCode`": 404,
`n            `"statusDescription`": `"Not Found`"
`n        }
`n    }
`n}"

$response = Invoke-RestMethod 'https://api.raygun.com/entries' -Method 'POST' -Headers $headers -Body $body
$response 
$response | ConvertTo-Json

An empty {} 201 response means the event reached the Raygun servers correctly.

You should see a fake error "Demo123: Powershell to Raygun test" when you refresh the Raygun Application page.

Alternatively you can use curl:

curl -L -s -H 'X-ApiKey: {api-key}' -d @api.raygun.io.entries.json https://api.raygun.com/entries

If you have setup a server-side Raygun provider, you may also need to setup the the client-side provider to get browser errors.

Insert the raygun4js snippet into the of the html document

<script type="text/javascript">
      !function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){
      (a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0],
      f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){
      h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({
      e:g})}}(window,document,"script","//cdn.raygun.io/raygun4js/raygun.min.js","rg4js");
    </script>
    <script type="text/javascript">
      rg4js('apiKey', '@Configuration["RaygunSettings:ApiKey"]');
      rg4js('enableCrashReporting', true);
      rg4js('enableRUM', true); <!-- optional, enable RealUserMonitoring -->
    </script>

Please check that rg4js('enableCrashReporting', true); has been set.

You may also want to check enable Raygun Real User Monitoring (RUM) has been enabled with the rg4js('enableCrashReporting', true); setting.


Some Browsers extensions mistakenly think that the raygun js provider is an advertizing script.

Please get in touch, and let us know the details, if this happens to you. So we can get Raygun added to the extension white list.


Some times a bug in a mobile app will crash the whole application, before the Raygun provider has had a chance to send the event to the Raygun servers. The Raygun provider however, will endeavor to try and resend the error when the app next starts.