voxpupuli / puppet-puppetboard

Puppet module to install and manage puppetboard
https://forge.puppet.com/puppet/puppetboard
Apache License 2.0
53 stars 165 forks source link

Class[Python]: has no parameter named 'manage_virtualenv_package' with v7.0.2 version #319

Closed KpuCko closed 3 years ago

KpuCko commented 3 years ago

Hello, In the past I had some issues getting puppetboard working and all dependencies. I had some comunication with the developer, but because lack of time he won't be able to help resolving this. Today I noticed that there is a new version, so I get happy because I assumed my issues has been resolved, unfortunately I've got another issues :-)

Let me show you my node manifest, and more details about the versions and OS I'm using.

All installed puppet modules:

root@puppet.home.lan:~# puppet module list
/etc/puppetlabs/code/environments/production/modules
├── KpuCko-init (v0.0.1)
├── KpuCko-nagios (v0.0.1)
├── duxklr-manageusers (v1.0.2)
├── example42-puppi (v2.2.11)
├── example42-timezone (v2.0.16)
├── gbrown-yumrepos (v0.0.3)
├── herculesteam-augeasproviders_base (v2.1.0)
├── herculesteam-augeasproviders_core (v2.6.0)
├── herculesteam-augeasproviders_mounttab (v2.1.1)
├── herculesteam-augeasproviders_shellvar (v4.0.0)
├── herculesteam-augeasproviders_ssh (v3.3.0)
├── herculesteam-augeasproviders_sysctl (v2.5.0)
├── nanliu-staging (v1.0.3)
├── pdxcat-nrpe (v2.1.1)
├── puppet-puppetboard (v7.0.2)
├── puppet-python (v3.0.1)
├── puppet-unattended_upgrades (v5.0.0)
├── puppetlabs-apache (v5.4.0)
├── puppetlabs-apt (v7.4.2)
├── puppetlabs-concat (v6.2.0)
├── puppetlabs-firewall (v2.4.0)
├── puppetlabs-inifile (v4.2.0)
├── puppetlabs-mailalias_core (v1.0.6)
├── puppetlabs-motd (v4.1.1)
├── puppetlabs-mount_providers (v2.0.1)
├── puppetlabs-nagios_core (v1.0.3)
├── puppetlabs-ntp (v8.3.0)
├── puppetlabs-postgresql (v6.6.0)
├── puppetlabs-puppetdb (v7.5.0)
├── puppetlabs-registry (v3.1.0)
├── puppetlabs-stdlib (v6.3.0)
├── puppetlabs-translate (v2.2.0)
├── puppetlabs-vcsrepo (v3.1.1)
├── razorsedge-snmp (v3.2.0)
├── saz-locales (v2.5.1)
├── saz-sudo (v6.0.0)
├── stahnma-epel (v1.3.1)
└── thias-sysctl (v1.0.6)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)
root@puppet.home.lan:~#

My OS version:

root@puppet.home.lan:~# lsb_release -cid
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Codename:       bionic
root@puppet.home.lan:~#

Last few lines of my puppetmaster manifest:

# Install and confugre puppetboard reporting tool

    class { 'puppetboard':
        manage_git        => true,
        manage_virtualenv => true,
    }

# Apache confguration for puppetboard

    class { 'apache':
        purge_configs => false,
        default_vhost => true,
        default_mods  => true,
        default_ssl_vhost => true,
        confd_dir => '/etc/apache2/conf-enabled',
        mpm_module => prefork,
    }

    class { 'apache::mod::wsgi': }
    class { 'puppetboard::apache::conf': }

}

The issue:

root@puppet.home.lan:~# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Python]: has no parameter named 'manage_virtualenv_package' (file: /etc/puppetlabs/code/environments/production/modules/puppetboard/manifests/init.pp, line: 188, column: 5) on node puppet.home.lan
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
root@puppet.home.lan:~#

Can you help me with that? Thanks!

kenyon commented 3 years ago

├── puppet-python (v3.0.1)

The manage_virtualenv_package parameter was added to the python module in v4.1.0: https://github.com/voxpupuli/puppet-python/commit/a6b8f4dd6b6faea0b2439d42b2f2686be8037fb9

So if you update to at least puppet-python v4.1.0, this should fix it.


It seems that we are missing some acceptance test coverage in this puppetboard module if our tests are passing. Metadata says some old python module versions are acceptable, but that seems not to be the case: https://github.com/voxpupuli/puppet-puppetboard/blob/v7.0.2/metadata.json#L44

KpuCko commented 3 years ago

Thanks, I've upgraded the python module and all related modules as well. Unfortunately I've got the same error I had in the past, here is it:


[Fri Jan 15 10:27:04.334493 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] mod_wsgi (pid=19286): Target WSGI script '/srv/puppetboard/puppetboard/wsgi.py' cannot be loaded as Python module.
[Fri Jan 15 10:27:04.334525 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] mod_wsgi (pid=19286): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Fri Jan 15 10:27:04.334542 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] Traceback (most recent call last):
[Fri Jan 15 10:27:04.334592 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]   File "/srv/puppetboard/puppetboard/wsgi.py", line 14, in <module>
[Fri Jan 15 10:27:04.334676 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]     from puppetboard.app import app as application
[Fri Jan 15 10:27:04.334722 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]   File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 21, in <module>
[Fri Jan 15 10:27:04.334971 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]     from pypuppetdb.QueryBuilder import (ExtractOperator, AndOperator,
[Fri Jan 15 10:27:04.334994 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] ImportError: No module named pypuppetdb.QueryBuilder```
kenyon commented 3 years ago

Thanks, I've upgraded the python module and all related modules as well. Unfortunately I've got the same error I had in the past, here is it:

[Fri Jan 15 10:27:04.334493 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] mod_wsgi (pid=19286): Target WSGI script '/srv/puppetboard/puppetboard/wsgi.py' cannot be loaded as Python module.
[Fri Jan 15 10:27:04.334525 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] mod_wsgi (pid=19286): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Fri Jan 15 10:27:04.334542 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] Traceback (most recent call last):
[Fri Jan 15 10:27:04.334592 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]   File "/srv/puppetboard/puppetboard/wsgi.py", line 14, in <module>
[Fri Jan 15 10:27:04.334676 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]     from puppetboard.app import app as application
[Fri Jan 15 10:27:04.334722 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]   File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 21, in <module>
[Fri Jan 15 10:27:04.334971 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635]     from pypuppetdb.QueryBuilder import (ExtractOperator, AndOperator,
[Fri Jan 15 10:27:04.334994 2021] [wsgi:error] [pid 19286] [remote 192.168.0.15:54635] ImportError: No module named pypuppetdb.QueryBuilder```

That is different and unrelated. https://github.com/voxpupuli/puppetboard/issues/371 and https://github.com/voxpupuli/puppetboard/issues/391 appear when googling that error. :man_shrugging:

KpuCko commented 3 years ago

Ok, none of the linked articles solved the problem. I except when I use this puppet module with manage git and virtualenv, the module to take care of adding/removing all the things to get puppetboard working. Unfortunately this is not the true.

There is a complete mess, I'm struggling with this issue more then a year. This makes puppetboard totally useless. Dead project for me.

mergwyn commented 3 years ago

Hi, I also have just upgraded and have the same issue. My versions are:

mod 'puppet-puppetboard', '7.0.2'
mod 'puppet-python', '6.0.0'

I've used onceover to check and all modules are at their latest versions.

This is my unit test log:

Failures:

  1) role::puppet_master on ubuntu-20.04-x86_64 is expected to compile into a catalogue without dependency cycles
     Failure/Error: it { is_expected.to compile.with_all_deps }

       error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Class[Python]:
         has no parameter named 'virtualenv'
         has no parameter named 'manage_virtualenv_package' (file: /usr/src/control-repo/spec/fixtures/modules/puppetboard/manifests/init.pp, line: 188, column: 5) on node unittest.xxxxxxx.xxx
     # ./spec/classes/role/puppet_master_spec.rb:19:in `block (4 levels) in <top (required)>'

Finished in 57.06 seconds (files took 5.86 seconds to load)
kenyon commented 3 years ago

@mergwyn you can't use puppet-python 6.0.0 with puppet-puppetboard 7.0.2.

https://github.com/voxpupuli/puppet-puppetboard/blob/v7.0.2/metadata.json#L43-L44

puppet-puppetboard will need to be updated to be compatible with puppet-python 6.0.0.