====== Troubleshooting ======
===== Desktop client =====
Recommended tooling:
* MS WebView2 Chromium DevTools, activated via SHIFT+CTRL+I from any ActionPad
* [[https://www.telerik.com/fiddler/fiddler-classic|Fiddler Classic Web Debugger]] running with HTTPS-decryption
* [[https://docs.microsoft.com/en-us/sysinternals/downloads/debugview|Microsoft SysInternals DebugView]]
Note: The remaining information in this article largely relates to legacy versions 10.18 and older.
==== Safe mode ====
Lime CRM can be started in //safe mode// which disables all addins that are otherwise loaded at startup. In safe mode the Internet pane web page is also set to a blank page. Use safe mode to temporarily log in to Lime CRM in case of problems. Safe mode is enabled by using a command-line argument to ''lime.exe'':
"C:\Program Files (x86)\Lundalogik\Lime CRM\lime.exe" /safemode
==== Debug mode ====
There are a number of registry settings that can make troubleshooting and optimizations easier. The following values can be entered under the registry key ''HKEY_CURRENT_USER\Software\Lundalogik\Lime\Debug'' (1 = enabled, 0 = disabled):
^ Value ^ Type ^ Description ^
| DebugMode | DWORD | This is the master switch that controls all values below and must thus be enabled for any other setting to be enabled. |
| DataAccessBeep| DWORD | When enabled Lime CRM will beep every time a database call is triggerd (useful when optimizing VBA database access). |
| DataUpdateBeep | DWORD | When enabled Lime CRM will beep every time a data update is triggered. |
| ShowErrors | DWORD | Specifies if error messages that usually only go to the event log also should be displayed on the screen. |
| ShowDatabaseFieldNames | DWORD | Displays the database names of fields in all inspectors. |
| VerboseLogging ((available starting with version 10.12)) | DWORD | Enables extra logging to the event log. Useful for e.g. troubleshooting startup problems. |
| File.Contents | DWORD | When enabled all document retrievals will be logged with ID and file name. |
==== Application crash logging ====
To make diagnosing serious problems in Lime CRM easier logging of application crashes can be enabled. When this feature is enabled (available in version 10.7 and later) a detailed log and crash dump will automatically be created if the Lime CRM desktop client crashes.
The crash logging feature is enabled by adding or changing values in the Windows registry below the key ''HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Lundalogik\Lime\CrashHandler''. The following values can be set:
^ Name ^ Type ^ Description ^
| Enabled | DWORD | 0 = disabled (default), 1 = enabled |
| ReportPath | String | Path to the folder where crash logs are to be saved. Environment variables are automatically expanded which makes it possible to specify e.g. ''%USERPROFILE%\Desktop\LIME Crash Reports'' to save the logs in a folder on the users desktop. This value is optional and if not specified logs will be sent to Lundalogik by e-mail (after prompting). |
===== Lime CRM Server =====
==== Logging SQL Server calls ====
The LDC component can be instructed to log all SQL statements that it is about to execute by changing a value in the registry on the application server.
On 32-bit Windows editions the value is located in the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Lundalogik\Lundalogik Data Components\Databases\<>\Auditing
On 64-bit Windows editions it is located in the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Lundalogik\Lundalogik Data Components\Databases\<>\Auditing
^ Value ^ Type ^ Description ^
| SQLExecution | DWORD | 1 = log only successful calls, 2 = log only errors (default), 3 = log everything.
=== Important! ===
If you change this value remember to set it back to the default since the amount of logs created quickly can become immense. |
===== Stored procedures =====
Sometimes it can be interesting for debug or optimization purposes to see which stored procedures are executing and how long they need to execute. By setting ''sys_procedure_log_level'' in the ''setting'' system table to 1 then calls to some system procedurse (lsp_) will be logged to the table ''procedurelog''.
=== Important! ===
Do not forget to disable logging (''sys_procedure_log_level'' = 0) after you are done debugging. Having logging enabled for longer periods of time will reduce database performance and the ''procedurelog'' table will grow until disk space runs out.
==== Logging in custom stored procedures ====
You can also use the stored procedure logging functionality in custom procedures and functions (csp_, cfn_) by using the following template:
CREATE PROCEDURE [dbo].[csp_myprocedure]
AS
BEGIN
SET NOCOUNT ON
DECLARE @retval int
DECLARE @starttime datetime
SET @retval = 0
SET @starttime = GETDATE()
-- Stored procedure logic here
-- ...
-- ...
-- ...
-- ...
-- Log procedure
EXECUTE lsp_addprocedurelog @@procedureid = @@procid, @@starttime = @starttime
RETURN @retval
END
==== Retrieving log data ====
The following query can be used for retrieving log data from the ''procedurelog'' table:
SELECT
pl.[timestamp] AS N'Timestamp',
ao.name AS N'Procedure',
pl.prm AS N'Parameters',
ISNULL(u.username, N'Unknown') AS N'Username',
pl.duration AS N'Duration (ms)'
FROM
procedurelog pl
LEFT JOIN
sys.all_objects ao ON ao.object_id = pl.procid
LEFT JOIN
[user] u ON u.iduser = pl.iduser
===== Web client =====
Lime CRM Server stores logs in ''C:\ProgramData\Lundalogik\Lime CRM Server\\logs\'', where is ''Web Server'' for the main server.
The server logs errors and warnings by default, but info and debug logging can be enabled by adding the following to ''C:\ProgramData\Lundalogik\Lime CRM Server\Web Server\configs\config.ini''
[logging]
level = DEBUG
errorloglevel = DEBUG
==== Common problems ====
=== Web Server service do not start ===
Check the server log for the cause, but the two most common reasons are:
* Service user does not have access to the ''Lundalogik'' folder in ''C:\ProgramData''
* The certificate used was not exported/converted correctly, see [[configuration:webserver|Web server configuration]]
=== An error is shown when using the search in the Web application ===
Database is not indexed, run ''limefu search index -a ''
=== Fields missing from cards ===
View is not up to date, log in as admin and use the view editor to add the missing fields, see [[configuration:views|Views and indexes]]
=== Webclient login page is not found ===
Webclient is not enabled, open ''C:\ProgramData\Lundalogik\Lime CRM Server\Web Server\configs\config.ini'' and add the following:
[features]
webclient_login = True
api = True
=== Installation fails on upgrade ===
Services might be locked from other open windows so that they cannot be uninstalled properly. Make sure to not have any other windows open when you run the installation.