Webserver is not able to connect to the database (MongoDB)

Article: 100048359
Last Published: 2020-11-30
Ratings: 0 1
Product(s): Appliances

Problem

If an appliance is in a rollback state after upgrading from 3.1.2 to 3.3.0.1, then the ASCWS service is unable to connect to the MongoDB database which causes the Monitor -> Hardware ShowHealth command to fail to provide any data.

Error Message

In the appliance Web Interface, the users will not be displayed in the Command Line Shell an error similar to below will be displayed:

Support> Maintenance

<!-- Maintenance Mode --!>
maintenance's password:
maintenance-!> less /log/autosupport/webservice.out

An exception is encountered in the webservice.out file as below which states the socket connection issue of tomcat and mongod-

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DBPurgeServiceImpl' defined in file [/opt/apache-tomcat/vxos/webapps/ascws/WEB-INF/classes/com/symantec/appliance/autosupport/client/webservice/purge/DBPurgeServiceImpl.class]: Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=127.0.0.1:27017, type=UNKNOWN, state=CONNECTING, exception=

{com.mongodb.MongoSocketOpenException: Exception opening socket}

, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=127.0.0.1:27017, type=UNKNOWN, state=CONNECTING, exception=

{com.mongodb.MongoSocketOpenException: Exception opening socket}

Cause

There is an issue with the webserver which handles the configuration of the database. It fails to connect to database in the case where the database has not started before the webserver. This causes the services that utilize the webserver's data, and in turn, fails to report the requested data to the user.

Scenarios

  • Perform an upgrade from 3.1.2 to 3.3.0.1, if there is a rollback then the webserver is unable to connect to MongoDB
  • All the services that are using ASCWS will not provide the expected data.

Solution

Restart the webserver after verifying that the MongoD has started using the following commands, in order, in the CLISH menu:

  1. Support> InfraServices

  2. Support -> InfraServices> Show All

  3. Support -> InfraServices> Stop All

  4. Support -> InfraServices> Start All

After these steps, all the required services should be up and running, and the ASCWS will be able to provide the data requested by Monitor -> Hardware ShowHealth.

Was this content helpful?