Updating the Config File

Marnel Catlett
Marnel Catlett
  • Updated

The most common error is a database permission error which is fixed by correcting the permissions in the database.  From time to time you may run into connection errors that requires updates to the Config File.  The steps below explains those errors and how to deal with these errors.

Database errors - Does not always require an update to the config file.

Database - Permission Error. 

Error 156, State: 1, Class: 15

Example:

This happens when the Cognition360 account does not have the correct permissions to the database. Please adjust the permissions to 'db reader' access to the ConnectWise Database.

You would need to stop, and then restart the service for the changes to take effect.  This step is explained in detail in our Setup Errors and how to deal with them Article.

 

Other - System Out Of Memory. 

Error System.OutOfMemoryException

Example:

This happens when the Log File reaches maximum file size.  Rename the current Log File with today's date.  You would need to stop, and then restart the service for the changes to take effect.  This step is explained in detail in our Setup Errors and how to deal with them Article.

A new Log File will be generated.

 

Database - Login Failed for user.

Error 233, State: 0, Class: 20

Example:

Please reset the password and set it to 'not expire' to avoid this problem from recurring.  Please note: if you are updating the password in SQL, you will also have to update the password in the config file.

You would need to stop, and then restart the service for the changes to take effect.  This step is explained in detail in our Setup Errors and how to deal with them Article.

 

Database - Password expired.

Error 18488, State: 1, Class: 14

Example:

Please reset the password and set it to 'not expire' to avoid this problem from recurring.  Please note: You will also have to update the password in the config file.

You would need to stop, and then restart the service for the changes to take effect.  This step is explained in detail in our Setup Errors and how to deal with them Article.

 

Login failed for user.

Error 18456, State: 1, Class: 14 or Login failed for user 'username'

Example:

Please check the username and the password and adjust if needed.  Please note: You will also have to update the password in the config file.

You would need to stop, and then restart the service for the changes to take effect.  This step is explained in detail in our Setup Errors and how to deal with them Article.

 

Credential Error.  

Error 4060, State: 1, Class: 11 or Cannot open database 'databaseName' requested by the login. 

Example:

Please check the username and the password and adjust if needed.  Please note: You will also have to update the password in the config file.

You would need to stop, and then restart the service for the changes to take effect.  This step is explained in detail in our Setup Errors and how to deal with them Article.

 

For Errors that require updates to the Config file.

  • If the service is installed then you will need to amend the Config file that stores the credentials. This file is located in the folder where the Cognition360 service was installed. 
  • For each section, replace the value with the correct value in the "placeholder" as indicated for the respective error.
  • Please note:  Curly Brackets are used as an indication of the section that needs to be replaced and should be omitted in the final document.

 

Incorrect SQL ServerName

In the first few lines of the Config File you will see a section called configuration. Replace the value in the example below "{SQL ServerName}" with the correct details. 

Example of the Config file text (in the relevant area)  *Curly Brackets {} are omitted

{SQLServerName}; Initial Catalog=cwwebapp_{companyinitial};User ID={SQLUserName};Password={SQLPassword}" providerName="System.Data.SqlClient" /

Example of the Config file text (in the relevant area)

 

Incorrect Database Name (ConnectWise Database) 

In the first few lines of the Config File you will see a section called configuration.  The "initial catalog" string starts with "cwwebapp_" if this is not the case for you, please correct this.  Replace the value in the example below "{companyinitial}" with the correct details.

Example of the Config file text (in the relevant area)  *Curly Brackets {} are omitted

{SQLServerName}; Initial Catalog=cwwebapp_{companyinitial};User ID={SQLUserName};Password={SQLPassword}" providerName="System.Data.SqlClient" /

Example of the Config file text (in the relevant area) 

 

Incorrect Username

Just after the Database details you will find the SQL username field. Replace the value in the example below "{SQLUserName}" with the correct details.

Example of the Config file text (in the relevant area)  *Curly Brackets {} are omitted
{SQLUserName};Password={SQLPassword}" providerName="System.Data.SqlClient" /

Example of the Config file text (in the relevant area)

 

Incorrect Password

Just after the Database details you will find the SQL password field. Replace the value in the example below "{SQLPassword}" with the correct details.

 Example of the Config file text (in the relevant area)  *Curly Brackets {} are omitted

{SQLPassword}" providerName="System.Data.SqlClient" /

 Example of config with field highlighted.

 

Once done, return back to the Main article (Setup errors and how to deal with them) to complete the final steps which are:

Save the Config File,

Stop the service,

Restart the service, 

Let us know and we will check if data is again flowing.