Bug 1299133 - Error: Duplicate declaration: Mysql_database[fd00] is already declared in file /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57; cannot redeclare at /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57 on node overcloud-controller-0.localdom
Error: Duplicate declaration: Mysql_database[fd00] is already declared in fil...
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates (Show other bugs)
7.0 (Kilo)
Unspecified Unspecified
urgent Severity urgent
: y3
: 7.0 (Kilo)
Assigned To: Jiri Stransky
yeylon@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-16 06:44 EST by Marius Cornea
Modified: 2016-10-17 07:18 EDT (History)
9 users (show)

See Also:
Fixed In Version: openstack-tripleo-heat-templates-0.8.6-99.el7ost
Doc Type: Bug Fix
Doc Text:
In an IPv6-based Overcloud, the director incorrectly parsed MariaDB DSN strings containing IPv6 addresses. This caused Puppet to report duplicate 'Mysql_database' resources due to all databases using the first bit grouping of the IPv6 address as the database name (e.g. 'fd00'). This fix adds logic to check if the string uses an IPv4 or IPv6 address and parse the string accordingly. Puppet no longer reports duplicate 'Mysql_database' resources.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-18 11:50:05 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
the overcloud_controller_pacemaker puppet manifest from the failed node (67.73 KB, text/plain)
2016-01-16 08:15 EST, Marios Andreou
no flags Details

  None (edit)
Description Marius Cornea 2016-01-16 06:44:21 EST
Description of problem:
Deployment fails with:

Error: Duplicate declaration: Mysql_database[fd00] is already declared in file /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57; cannot redeclare at /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57 on node overcloud-controller-0.localdomain


Version-Release number of selected component (if applicable):
openstack-puppet-modules-2015.1.8-36.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Deploy ipv6 enabled overcloud


Actual results:
Deployment failes:
{
  "status": "FAILED", 
  "server_id": "2a533762-a9ec-4347-be30-8e4bbec1b9de", 
  "config_id": "2af557bd-92e9-4ca8-8e3a-50b49f29b7e9", 
  "output_values": {
    "deploy_stdout": "", 
    "deploy_stderr": "Device \"br_ex\" does not exist.\nDevice \"ovs_system\" does not exist.\n\u001b[1;31mError: Duplicate declaration: Mysql_database[fd00] is already declared in file /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57; cannot redeclare at /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57 on node overcloud-controller-0.localdomain\u001b[0m\n\u001b[1;31mError: Duplicate declaration: Mysql_database[fd00] is already declared in file /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57; cannot redeclare at /etc/puppet/modules/openstacklib/manifests/db/mysql.pp:57 on node overcloud-controller-0.localdomain\u001b[0m\n", 
    "deploy_status_code": 1
  }, 
  "creation_time": "2016-01-16T11:14:32Z", 
  "updated_time": "2016-01-16T11:15:02Z", 
  "input_values": {}, 
  "action": "CREATE", 
  "status_reason": "deploy_status_code : Deployment exited with non-zero status code: 1", 
  "id": "62df5503-ff7f-4525-a09a-8ffa897a885c"
}
stack@instack:~>>> cat deploy.command 


Expected results:
Deployment proceeds.
Comment 4 Marios Andreou 2016-01-16 08:15 EST
Created attachment 1115428 [details]
the overcloud_controller_pacemaker puppet manifest from the failed node

contents of /var/lib/heat-config/heat-config-puppet/14205c1c-b115-45bb-afe1-672a0df51a03.pp from the error trace
Comment 5 Sofer Athlan-Guyot 2016-01-16 11:26:16 EST
In the created manifest on the controller node we have this:


    $allowed_hosts = ['%',hiera('mysql_bind_host')]
    $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
    class { 'keystone::db::mysql':
      user          => $keystone_dsn[3],
      password      => $keystone_dsn[4],
      host          => $keystone_dsn[5],
      dbname        => $keystone_dsn[6],
      allowed_hosts => $allowed_hosts,
      require       => Exec['galera-ready'],
    }
    $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
    class { 'glance::db::mysql':
      user          => $glance_dsn[3],
      password      => $glance_dsn[4],
      host          => $glance_dsn[5],
      dbname        => $glance_dsn[6],
      allowed_hosts => $allowed_hosts,
      require       => Exec['galera-ready'],
    }
    $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
    class { 'nova::db::mysql':
      user          => $nova_dsn[3],
      password      => $nova_dsn[4],
      host          => $nova_dsn[5],
      dbname        => $nova_dsn[6],
      allowed_hosts => $allowed_hosts,
      require       => Exec['galera-ready'],
    }
    $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
    class { 'neutron::db::mysql':
      user          => $neutron_dsn[3],
      password      => $neutron_dsn[4],
      host          => $neutron_dsn[5],
      dbname        => $neutron_dsn[6],
      allowed_hosts => $allowed_hosts,
      require       => Exec['galera-ready'],
    }
    $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
    class { 'cinder::db::mysql':
      user          => $cinder_dsn[3],
      password      => $cinder_dsn[4],
      host          => $cinder_dsn[5],
      dbname        => $cinder_dsn[6],
      allowed_hosts => $allowed_hosts,
      require       => Exec['galera-ready'],
    }
...

The problem when using IPv6 is this idiom : 

   split(hiera('cinder::database_connection'), '[@:/?]')

It works ok for ipv4, but with ipv6, ":" is part of the url.  For
instance:

   cinder::database_connection = mysql://cinder:7ZT8sXWMxQMm2wVGWEEvjpCbm@[fd00:fd00:fd00:2000:f816:3eff:fec7:b967]/cinder

giving dbname=fd00 instead of cinder.  This is true for all
".*::database_connection".

Then all the database will be named "fd00", giving rise to the
aforementioned error.
Comment 7 Marius Cornea 2016-01-19 05:52:03 EST
Deployed 1 ctrl + 1 compute successfuly with:
openstack-tripleo-heat-templates-0.8.6-106.el7ost.noarch
Comment 9 errata-xmlrpc 2016-02-18 11:50:05 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0264.html

Note You need to log in before you can comment on or make changes to this bug.