Error processing master status in API Gateway ssg logs
search cancel

Error processing master status in API Gateway ssg logs

book

Article ID: 246507

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We have configured a new API Gateway with the internal MySQL database , but we get the following error every 10 seconds:

  • 2022-07-20T08:59:46.426+0200 WARNING 74 com.l7tech.server.cluster.ClusterMasterImpl: Error processing master status.
  • org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
  • at org.springframework.dao.support.DataAccessUtils.nullableSingleResult(DataAccessUtils.java:97)
  • at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:509)
  • at com.l7tech.server.cluster.ClusterMasterImpl$MasterCheckTask.getMasterInfo(Unknown Source)
  • at com.l7tech.server.cluster.h.doInTransaction(Unknown Source)
  • at com.l7tech.server.cluster.h.doInTransaction(Unknown Source)
  • at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
  • at com.l7tech.server.cluster.ClusterMasterImpl$MasterCheckTask.run(Unknown Source)
  • at com.l7tech.server.util.ab.doRun(Unknown Source)
  • at com.l7tech.server.util.ManagedTimerTask.run(Unknown Source)
  • at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
  • at java.base/java.util.TimerThread.run(Timer.java:506)

 

Environment

Release : 10.1

Component :

Resolution

The cluster_master table should have at least one entry which is created when the cluster is setup. 

Resolution Steps:

1. Stop the Gateway service on all  nodes that are part of the same Gateway cluster by running the following command at OS prompt 

# service ssg stop

2. Once Gateway service is stopped on all nodes, open MySQL console on the Primary DB node

3. Execute the following SQL statements in the order shown below:

# delete from ssg.cluster_master;

# INSERT INTO ssg.cluster_master (nodeid, touched_time, version) VALUES (NULL, 0, 0);

Then confirm cluster_master table is now showing empty values by running :

# select * from ssg.cluster_master;

The output must look as below example:


4. The active replication should update the cluster_master table on the Secondary DB node as well. Hence open MySQL console on the secondary and confirm that is indeed the case by running:

# select * from ssg.cluster_master;

5. Restart Gateway service on all nodes, firstly Primary DB node, then Secondary DB node and finally the remaining two Gateway nodes.

6. Once Gateway nodes are started, check again the cluster_master table on both Primary and Secondary DB node by running below command:

# select * from ssg.cluster_master;

They should both show the exact nodeid value this time.