Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ido-mysql install fails while using official icinga packages #302

Closed
hboetes opened this issue May 12, 2017 · 5 comments
Closed

ido-mysql install fails while using official icinga packages #302

hboetes opened this issue May 12, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@hboetes
Copy link

hboetes commented May 12, 2017

Here is a minimal recipe that fails. If you set manage_repo to false the same recipe succeeds.

I have a clean install, made a snapshot, ran this recipe with manage_repo true and it fails. Error input included below:

                                                  
  # Settings                                                                                                                                                                                   
  $mysql_root_password = 'strongpassword2'                                                                                                                                                     
  $ic2db     = 'icinga2'                                                                                                                                                                       
  $ic2dbuser = 'icinga2'                                                                                                                                                                       
  $ic2dbpass = 'secret1'                                                                                                                                                                       
                                                                                                                                                                                               
  class { '::mysql::server':                                                                                                                                                                   
    create_root_user        => true,                                                                                                                                                           
    create_root_my_cnf      => true,                                                                                                                                                           
    root_password           => $mysql_root_password,                                                                                                                                                                                                                                                                                                                           
                                                                                                                                                                                      
  mysql::db { 'icinga2':                                                                                                                                                                       
    user     => 'icinga2',                                                                                                                                                                     
    password => "${ic2dbpass}",                                                                                                                                                                
    host     => 'localhost',                                                                                                                                                                   
    grant    => ['ALL'],                                                                                                                                                                       
  }                                                                                                                                                                                            
                                                                                                                                                                                               
  class { '::icinga2':                                                                                                                                                                         
    manage_repo => true,                                                                                                                                                                       
    require => Mysql::Db[$ic2db],                                                                                                                                                              
  }                                                                                                                                                                                            
                                                                                                                                                                                               
  class{ '::icinga2::feature::idomysql':                                                                                                                                                       
    database      => $ic2db,                                                                                                                                                                   
    user          => $ic2dbuser,                                                                                                                                                               
    password      => "${ic2dbpass}",                                                                                                                                                           
    import_schema => true,                                                                                                                                                                     
    require       => Mysql::Db[$ic2db],                                                                                                                                                        
  }                                                                                                                                                                                            
}                                                                                                                                                                                              
May 12 15:12:25 james puppet-agent[20361]: Setting up icinga2-ido-mysql (2.6.3-1~ppa1~xenial1) ...
May 12 15:12:25 james puppet-agent[20361]: Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
May 12 15:12:25 james puppet-agent[20361]: dbconfig-common: writing config to /etc/dbconfig-common/icinga2-ido-mysql.conf
May 12 15:12:25 james puppet-agent[20361]: creating database backup in /var/cache/dbconfig-common/backups/icinga2-ido-mysql_2.4.1-2ubuntu1.2017-05-12-17.12.20.
May 12 15:12:25 james puppet-agent[20361]: mysql: [Warning] mysql: Empty value for 'port' specified. Will throw an error in future versions
May 12 15:12:25 james puppet-agent[20361]: ERROR 1045 (28000): Access denied for user 'icinga2'@'localhost' (using password: YES).
May 12 15:12:25 james puppet-agent[20361]: unable to connect to mysql server.
# stripcom /etc/dbconfig-common/icinga2-ido-mysql.conf|grep pass
dbc_dbpass='nEVTjDW0Mzx8'

With manage_repo disabled I get this output:

May 12 15:17:03 james puppet-agent[20365]: (/Stage[main]/Icinga2::Feature::Idomysql/Package[icinga2-ido-mysql]/ensure) created
May 12 15:17:05 james puppet-agent[20365]: (/Stage[main]/Icinga2::Feature::Idomysql/Exec[idomysql-import-schema]/returns) executed successfully

And the password in /etc/dbconfig-common/icinga2-ido-mysql.conf is also wrong.

stripcom /etc/dbconfig-common/icinga2-ido-mysql.conf|grep pass
dbc_dbpass='RgdOFUsbFGGH'

In both cases mysql -psecret1 -u icinga2 works fine.

@bobapple
Copy link
Contributor

bobapple commented May 19, 2017

What does show grants for 'icinga2'@'localhost'; print?
Which module is logging the error message, mysql or icinga2?

@lbetz
Copy link
Contributor

lbetz commented Jun 19, 2017

Ok, if I understand right this is a problem when updating the package icinga2-ido-mysql? That mean we have to set the dbc_dbpass correctly for debian/ubuntu via puppet?

@lbetz lbetz added the question label Jun 19, 2017
@lbetz lbetz self-assigned this Jun 19, 2017
@lbetz
Copy link
Contributor

lbetz commented Jun 19, 2017

Please try branch: bug/ido-mysql-install-fails-while-using-official-icinga-packages-302

@hboetes
Copy link
Author

hboetes commented Jun 19, 2017

I’m sorry, I can’t test the new changes since I’ve given up on the installing icinga with puppet project since I ran into too many problems. But thanks for taking my bug report seriously and good luck with fixing the existing problems.

@lbetz
Copy link
Contributor

lbetz commented Jun 20, 2017

It's too bad that you stopped your work with this module. Maybe you can answer my question? Pop up the described problem if you updated icinga2 or thru an initial setup by puppet?

@lbetz lbetz closed this as completed in 988f409 Jun 20, 2017
@lbetz lbetz added bug and removed question labels Jun 20, 2017
@lbetz lbetz added this to the v1.3.0 milestone Jun 20, 2017
n00by pushed a commit to n00by/puppet-icinga2 that referenced this issue Apr 26, 2018
n00by pushed a commit to n00by/puppet-icinga2 that referenced this issue Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants