7. Troubleshooting

7.1. Diagnostic Mode

Objective

Explain how to collect additional information that will help troubleshoot the issues.

If module doesn’t work as you expect, it’s worth to enable “Diagnostic Mode”. This will output logs that describes how the module is working. They can also diagnose issues that can occur like: config errors, failed login process, etc. Logs are created in file that is located in ~\Portals\_default\LogsYYYY.MM.DD.logs.resources, see log example below:

_images/troubleshooting-diagnostic-mode_01.png

Logs are created only when plugin is working in “Diagnostic Mode”, to enable it please follow steps below:

  1. Open log4net configuration file DotNetNuke.log4net.config, it can be found in DNN root folder, see figure below:

    _images/troubleshooting-diagnostic-mode_02.png
  2. Inside that file set log level to ALL, see code snippet below:

    <root>
        <level value="ALL" />
        <appender-ref ref="RollingFile" />
    </root>
    
  3. In the “Salesforce Authentication SPI” provider “Site Settings” -> “General” tab, enable attribute “Diagnostic Mode”, see figure below:

    _images/troubleshooting-diagnostic-mode_03.png
  4. Now logging mechanism is turned on, reproduce the sign-in process and check the log file.

7.2. How generate diagnostic logs

Please follow the instructions below on how to generate valuable logs.

  1. First enable diagnostic mode, to do that see instructions from section Diagnostic Mode

  2. Log file is usually very big, which makes it difficult to parse. To remove unncecessary informations, delete log file, before you will reproduce the issue.

    Default path to log file is: ~\Portals\_default\Logs\YYYY.MM.DD.resoures

  3. Reproduce the issue to generate log entries.

  4. Compress log file, and send it to support@glanton.com

7.3. SAML diagnostics

This section will describe how to obtain details about SAML connection. Connection that is set up between DNN and Salesforce at the login process.

  1. Open web.config file that is in your DNN main folder.

  2. In web.config at the end of <configuration> section, just before closing tag </configuration> add following code snippet:

      <system.diagnostics>
        <trace autoflush="true">
        <listeners>
            <add name="TextWriter"/>
        </listeners>
        </trace>
        <sources>
        <source name="ComponentSpace.SAML2" switchValue="Verbose">
            <listeners>
            <add name="TextWriter"/>
            </listeners>
        </source>
        </sources>
        <sharedListeners>
        <add name="TextWriter"
        type="System.Diagnostics.TextWriterTraceListener"
        initializeData="{path to your DNN website}\DesktopModules\AuthenticationServices\GS_SalesforceAuthentication_SPI\saml.log"/>
        </sharedListeners>
    </system.diagnostics>
    
  3. Note that you need change line (third line from the end) where is {path to your DNN website} according to your DNN patch.

  4. Save web.config file.

  5. Now in ~\DesktopModules\AuthenticationServices\GS_SalesforceAuthentication_SPI folder will be created file saml.log with SAML connection details.

    _images/troubleshooting-saml-diagnostic_01.png
  6. Below is example of that log.

    _images/troubleshooting-saml-diagnostic_02.png

7.4. Logs on Salesforce

Salesforce has a simple tool that collects informations about all login attempts. To display Salesforce login log follow the steps below.

  1. Go to “Setup-> Administer-> Manage Users-> Identity Provider Event Log”, see figure below.

    _images/troubleshooting-salesforce-log_01.png
  2. “Identity Provider Event Log” section will be displayed, see figure below.

    _images/troubleshooting-salesforce-log_02.png

7.5. JavaScript issues

7.5.1. Overview

User interface is created at the top of AngularJS framework. JavaScript can be moody although it’s very fast. If you will see interface issues, for example view can’t be loaded or displayed, buttons aren’t responding, it’s worth to check JavaScript errors. Depending what browser you are using, check following articles that are describing how to display these errors in your browser:

If you have any problems with your plugin, please send above error messages to support@glanton.com

7.5.2. Edit & Delete buttons doesn’t work

When you can’t update module settings, and JavaScript throws error like Method Not Allowed... or requests throws 405 HTTP error code, please make sure that WebDAV is disabled. To disable WebDAV, please add following lines to the web.config file, in the section system.webServer-> modules add following line:

<modules>
    <remove name="WebDAVModule"/> <!-- add this -->
    ...
</modules>

in the section system.webServer-> handlers add following line:

<handlers>
    <remove name="WebDAV" />
    ...
</handlers>

the ExtensionlessUrl-Integrated-4.0 handler under the system.webServer-> handlers also applies the verb PUT:

<handlers>
    ...
    <remove name="ExtensionlessUrl-Integrated-4.0" />
    <add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    ...
</handlers>

Here you can read more about WebDAV.

7.5.3. View can’t be loaded

If you see situation like on figure below, where only upper part of interface is loaded and instead of bottom part of interface is displayed message Top level state template, probably it’s caused by minified js file.

_images/troubleshooting-javascript_02.png

To fix that issue sign in as DNN host and go to menu “Servers-> Server Settings”. At the bottom is section responsible for reducing Java Script files, please disable Minify JS attribute. See figure below for more info.

_images/troubleshooting-javascript_03.png