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

Warning: The directory '/srv/puppetboard/puppetboard' contains 1936 entries, which exceeds the default soft limit 1000 #351

Closed
ifreislich opened this issue Mar 25, 2022 · 0 comments · Fixed by #352

Comments

@ifreislich
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.15.0, server 7.6.1
  • Ruby: 2.7.5
  • Distribution: Ubuntu 18.04.6 LTS
  • Module version: 8.1.0

How to reproduce (e.g Puppet code you use)

Thanks for a great module BTW.

puppet 7.6 or 7.6.1 or introduced a warning when a File resource affects more than 1000 files by default. The puppetboard module trips over the limit and produces a warning because of the number of files in the puppetboard repository.

puppetboard/manifests/init.pp at line 224:

  file { "${basedir}/puppetboard":
    owner   => $user,
    recurse => true,
    require => Vcsrepo["${basedir}/puppetboard"],
    max_files => -1,
  }

max_files defaults to 0 (issues a warning). I added the attribute with a value -1 which disables the warning. You might want to choose a different value, but that may cause the resource to fail at some later time when the files in the repo exceed the limit.

I have a slightly unusual puppetboard setup managed by puppet because I couldn't at the time figure out to make the puppetboard module manage the apache vhost with SSL certificate authentication. The apache portion of the configuration is is not relevant to the warning but I've included it anyway.

$ssl_dir = $::settings::ssldir
$puppetboard_certname = $trusted['certname']
class { 'puppetboard':
    manage_virtualenv => true,
    manage_git        => true,
    revision          => 'master',
    puppetdb_host     => 'puppetdb01.xxxxx.com',
    puppetdb_port     => 8081,
    puppetdb_key        => "${ssl_dir}/private_keys/${puppetboard_certname}.pem",
    puppetdb_ssl_verify => "${ssl_dir}/certs/ca.pem",
    puppetdb_cert       => "${ssl_dir}/certs/${puppetboard_certname}.pem",
    reports_count => 35,
    enable_catalog  => true,
    default_environment => 'production',
    extra_settings  => {
        'DAILY_REPORTS_CHART_DAYS' => '15',
        'TABLE_COUNT_SELECTOR' => '[10, 20, 50, 100, 500]',
        'GRAPH_TYPE' => '"pie"',
        'GRAPH_FACTS' => "['architecture', 'clientversion', 'domain',
            'lsbcodename', 'lsbdistcodename', 'lsbdistid',
            'lsbdistrelease', 'lsbmajdistrelease', 'netmask', 'osfamily',
            'puppetversion', 'processorcount', 'windows_product_name',
            'windows_release_id', 'windows_edition_id', 'kernelversion']"
    },
}

file { '/etc/ssl/certs/xxxxx_Certificate_Authority.pem':
    content => file('xxxxx_ssl/xxxxx_Certificate_Authority.pem'),
    notify  => Service['httpd'],
}
file { '/etc/ssl/certs/puppetboard-test.xxxxx.com.pem':
    content => file('xxxxxx_puppetboard/puppetboard-test.xxxxx.com.pem'),
    notify  => Service['httpd'],
}
file {'/etc/ssl/private/puppetboard-test.xxxxxx.com.key':
    content => file('xxxxx_puppetboard/puppetboard-test.xxxxx.com.key'),
    notify  => Service['httpd'],
}
class { 'apache':
    default_vhost => false,
}
class { 'apache::mod::wsgi':
    package_name    => 'libapache2-mod-wsgi-py3',
    mod_path        => '/usr/lib/apache2/modules/mod_wsgi.so',
}
apache::vhost { $trusted[certname]:
    vhost_name  => $trusted[certname],
    ip          => '192.168.1.131',
    port        => 443,
    docroot     => '/srv/puppetboard/puppetboard',

    wsgi_application_group  => 'puppetboard',
    wsgi_process_group      => 'puppetboard',
    wsgi_daemon_process     => 'puppetboard',
    wsgi_daemon_process_options => {
        python-home     => '/srv/puppetboard/virtenv-puppetboard',
        user            => 'puppetboard',
        processes       => 5,
        threads         => 25,
        display-name    => 'puppetboard',
    },
    wsgi_script_aliases => { '/' => '/srv/puppetboard/puppetboard/wsgi.py' },

    ssl                 =>  true,
    ssl_ca              => '/etc/ssl/certs/xxxxx_Certificate_Authority.pem',
    ssl_cert            => '/etc/ssl/certs/puppetboard-test.xxxxx.com.pem',
    ssl_key             => '/etc/ssl/private/puppetboard-test.xxxxx.com.key',
    ssl_options         => '+StdEnvVars',
    ssl_verify_client   => 'require',
    ssl_verify_depth    => 1,
}

What are you seeing

root@puppetdb01:/etc/puppetlabs/puppetdb/conf.d# puppet agent -t
Info: Using environment 'infrastructure'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppetdb01.xxxxxx.com
Info: Applying configuration version '1648231182'
Warning: The directory '/srv/puppetboard/puppetboard' contains 1936 entries, which exceeds the default soft limit 1000 and may cause excessive resource consumption and degraded performance. To remove this warning set a value for max_files parameter or consider using an alternate method to manage large directory trees

What behaviour did you expect instead

No warning.

Output log

Any additional information you'd like to impart

smortex added a commit that referenced this issue Mar 26, 2022
Instead of cloning as root and using a file resource to change files
ownership to the configured user, directly clone the repository with
this user.

This fix a warning issued by puppet:
Warning: The directory '/srv/puppetboard/puppetboard' contains 1936 entries, which exceeds the default soft limit 1000

Fixes #351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant