Replication initialization failes due to "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA"
search cancel

Replication initialization failes due to "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA"

book

Article ID: 42928

calendar_today

Updated On:

Products

STARTER PACK-7 CA Rapid App Security CA API Gateway

Issue/Introduction

Solution

Background

The CA API Gateway uses MySQL replication?to leverage a mechanism database failover. This failover is used to ensure that a database host is always available to serving policies and auditing requests. This replication relationship between database hosts must be configured in advance by a system administrator or operator. The procedure may fail under certain circumstances due to a misconfiguration of the MySQL server configuration file. This article will prescribe the steps to configure the database server appropriately.

Presentation

The following error message may be printed in the console when attempting to initialize replication for the first time or when reinitializing replication after a failure or restoration event:
Error creating database when saving configuration 'Cannot create database: 'This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)' [code:-1, UNKNOWN_FAILURE]'

If this error message is printed in a log or console message then execute the following procedure to resolve.

Resolution

  1. Log in to the Gateway database node as the ssgconfig user
  2. Select Option #3: Use a privileged shell (root)
  3. Open the MySQL server configuration file in a text editor: vi /etc/my.cnf
  4. Ensure the following configuration directives are set and enabled:
log-bin=/var/lib/mysql/ssgbin-log
log-slave-update
log_bin_trust_function_creators=1
  1. Repeat steps 1-4?on the secondary Gateway database node
  2. Ensure the following configuration directive is set on the?primary?Gateway database host:

server-id=1

  1. Ensure the following configuration directive is set on the?secondary?Gateway database node:

server-id=2

  1. Restart the MySQL server on each Gateway database node: service mysql restart
  2. Attempt to initialize or reinitialize MySQL replication

Environment

Release:
Component: APIGTW