ALM Service Configuration Editor: The 'DbProviderFactories' section can only appear once per config file

Document ID : KB000004277
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

We are getting the following error message when starting the ALM Service: 

Unhandled exception has occurred in your application. If you click Continue, the application will ignore the error and attempt to continue. If you click Quit, the application will close immediately. The 'DbProviderFactories' section can only appear once per config file. 

db factories alm error.PNG

Environment:
CA Agile Requirements Designer (ARD)- Agile DesignerGTHPALMService- HP ALM Service
Cause:

This error occurs when the line 'DbProviderFactories' appears twice in your Microsoft.NET configuration file and your ALM Group Policies need to be configured. 

Resolution:

Remove the DbProviderFactories mentioned in the error message:
1. Go to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config 
2. Open machine.config in Notepad++ or a similar program. 
3. Search for 'DbProviderFactories'. 
4. Click the 'Next' button twice on the Find window.
5. Take a backup (copy/paste into another file) of this 3rd DbProviderFactories mention (line 158 typically).
6. Now delete this line because it has nothing in it but <DbProviderFactories/>. 

Re-Start ALM Connection:
1. Go to C:\Grid-Tools\GTHPALMService\GTHPALMService_ConfigEditor 
2. Open the ALMServiceConfigEditor.exe. 
3. On the Connection String tab, click the 'Verify' button. 
4. You should get a 'Connection opened successfully' message. 

Check Group Policy Status: 
1. Go to the 'Status' tab in the config editor. 
2. Click the 'Get Task Status' button. You will most likely receive the message 'GT ALMService is currently: Unknown'. This means we will need to enable this and start the service now. 
3. Click the 'Create Task' button. 
4. Enter in the username/password you would use to create Windows task. You might need administrator access. This information should be the domain name/username and password. 
5. Click the 'Check Group Policy Status' button. You will most likely receive the error message 'Setting is not enabled for group policy- Do not forcefully unload the user's registry at user logoff'. This means we will have to the enable group policy status now. 

Enable the Group Policy Status:
1. Open a command prompt. 
2. Type gpedit.msc and hit enter. 
3. In the Local Group Policy Editor that opens, go to 'Computer Configuration'. 
4. Click on 'Administrator Templates'. 
5. Click on 'System'. 
6. Click on 'User Profile'. 
7. Double click on 'Do not forcefully unload the user's registry at logoff'. 
8. Click the radio button for 'Enabled'. 
9. Click the 'Apply' button. 
10. Click the 'OK' button. 

Check Group Policy Status: (again)
1. Go to C:\Grid-Tools\GTHPALMService\GTHPALMService_ConfigEditor 
2. Open ALMServiceConfigEditor.exe 
3. Go to the Status tab in the config editor. 
4. Click the 'Check Group Policy Status' button. 
5. Now we should receive the message 'Group Policy settings verified'. This means the group policy settings are enabled. 

Start ALM Service:
1. Click the 'Start Service' button. This is a service task in Windows. 
2. Click the 'Get Service Status' button. You should receive the message 'GT ALM Service is running'. 
3. Verify the service is started by going to the log files at C:\Grid-Tools\GTHPALMService\logs\alm-(date).log 

Connect to ALM Connectors in Agile Designer:
1. Launch Agile Designer. 
2. In the left-hand pane, click the 'Connectors' option. 
3. Choose 'GT HP ALM Service' option. 
4. In the 'Connectors Dock' on the right hand pane, click on the 'Login' button. 
5. In the 'Login to ALM window, type in your ALM Service URL, User Name, and Password. 
- ALM Service URL: http://localhost:8095/ALMService 
- Now username and password that you use to login to HP ALM 
6. Select a 'Domain' and 'Project' and click the 'OK' button. 
7. Check to see if test cases from ALM are listing in the connectors dock. 

Additional Information:

If you experience any issues, please open a support case by going to https://support.ca.com/us.html or calling one of these numbers https://www.ca.com/us/services-support/ca-support/contact-support.html#numbers