Pre-checks
- One or more of the following options are configured for using Amazon RDS (tested with MariaDB) instance as external database for Bosh or PAS
- Operations Manager UI -> Bosh Director tile -> Director Config tab -> Database location -> External MySQL database*
- Operations Manager UI -> PAS tile -> UAA tab -> Choose the location of your UAA database -> other external database*
- Operations Manager UI -> PAS tile -> Credhub tab -> Choose the location of your CredHub database -> other external database*
- Operations Manager UI -> PAS tile -> Databases -> Choose the location of your system databases -> External Databases - (e.g. AWS RDS)*
- One of the following conditions holds true when we are configuring certificates for external databases:
- Either we already have 2015 RDS bundle applied and are adding the new 2019 RDS Bundle
- Or we are configuring the external database to use 2019 RDS Bundle
- The following are specific locations where we are adding certificates:
- Operations Manager UI -> Bosh Director tile -> Director Config tab -> Database location
- Enable TLS is checked
TLS CA
is where we put certificates
- Operations Manager UI -> PAS tile -> UAA tab -> Choose the location of your UAA database -> other external database -> CA Certificate
- Operations Manager UI -> PAS tile -> Credhub tab -> Choose the location of your CredHub database -> other external database -> Database CA Certificate
- Operations Manager UI -> PAS tile -> Databases -> Choose the location of your system databases -> External Databases -> Database CA Certificate
*This is where we put the RDS instance credentials and certificates
Symptoms
- Apply change fails with
"Mysql2::Error: MySQL server has gone away
" error:

Task 233 debug logs shows the following
UPDATE query to "
deployments" database failed with MySQL server has gone away error:
E, [2019-10-28T05:31:18.087192 #4426] [task:233] ERROR -- DirectorJobRunner: Mysql2::Error: MySQL server has gone away: (conn: 47089563510420) UPDATE `deployments` SET `name` = 'cf',
`manifest` = '---\naddons: []\ninstance_groups:\n- azs:\n - us-west-1a\n - us-west-1b\n env:\n bosh:\n password: \"$6$5ee878bd422106b9$EOpyR7AsPPZcGsCvRY0N8xdnYC5IPeI5dL6ojqHaZK/FFyPriPApF9lJBLtB9uUxa9ZP/rruNotVuY36cBuVE/\"\n instances: 0\n jobs:\n - consumes: {}\n name: loggregator_agent\n properties:\n loggregator:\n tls:\n agent:\n cert: \"((/opsmgr/cf/doppler/metron_tls_cert.cert_pem))\"\n key: \"((/opsmgr/cf/doppler/metron_tls_cert.private_key_pem))\"\n ca_cert: <BIG CHUNK OF DATA>
Cause
Check out the general reasons and resolution for
"MySQL server has gone away" when connecting to my Amazon RDS for MySQL DB instance? and specifically this resolution statement:
"If the query that is generating the error is retrieving a large data set, increase the
max_allowed_packet
size parameter by using a custom parameter group. For more information, see
Modifying Parameters in a DB Parameter Group"