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

require pear in pecl file #331

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jarro2783
Copy link

This fixes the pecl provider autoloading the pear provider. On Puppet 4.9.4, I get the following error:

     Puppet::Error:
       Could not autoload puppet/type/package: Could not autoload puppet/provider/package/pecl: cannot load such file -- puppet/provider/pear

It doesn't seem to happen on Puppet 3. This is fixed by requiring pear explicitly in the pecl provider code.

@jarro2783
Copy link
Author

It looks like my original fix might not actually work, even though it solved the problem on my dev host, it then couldn't find puppet/provider/package/pear on our CI host. I'm now doing require_relative './pear'.

@yastupin
Copy link
Contributor

Could not reproduce with puppet 4.10.0 (agent and master) and the following manifest in /etc/puppetlabs/code/environments/production/manifests/php.pp:

include apt

class { 'php': }

php::extension { 'event':
  provider => 'pecl',
}

The extension is installed correctly:

root@a75003b4bbfb:/# pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
event   2.3.0   stable

Looks like an autoload issue on your side. Are your modules in the standard path, under production (or current) environment?

@yastupin yastupin self-assigned this Apr 28, 2017
@jarro2783
Copy link
Author

At the moment it seems like it only causes problems when I use rspec-puppet. The other strange thing is that it only fails for the first test. Subsequent tests seem to have loaded the file correctly.

I don't know if it's actually related to the error that it prints before that. Here is some context:

Failure/Error: Puppet::Type.type(:package).stubs(:defaultprovider).returns(Puppet::Type.type(:package).provider(:apt))

     Puppet::Error:
       Could not autoload puppet/type/package: Could not autoload puppet/provider/package/pecl: Could not find parent provider pear of pecl

@ffrank
Copy link

ffrank commented Oct 3, 2017

What's the exact reproduction? Do you just invoke rake spec on current master?

@jarro2783
Copy link
Author

It does it for tests under spec/hosts, and I just run rake spec.

Just to be clear, this is running in our codebase, not this module. I wonder if it's actually a problem with rspec-puppet.

@ffrank
Copy link

ffrank commented Oct 15, 2017

Can you please clarify? Are you saying that this module trips up rspec-puppet running the custom tests in your own codebase? Is this module pulled as a dependency there?

@jarro2783
Copy link
Author

Yes, the problem happens running our own tests where this module is a dependency, and only for hosts tests. So I'm actually wondering if this is a problem with rspec-puppet and not this module.

@ffrank
Copy link

ffrank commented Oct 24, 2017

If you can create a clone of your environment and strip it down to the bare essentials that will still demonstrate this issue, that would be very helpful to have.

@bastelfreak
Copy link
Member

@jarro2783 can you please rebase against our latest master? We added acceptance tests and should now be able to reproduce this.

@TheMeier TheMeier marked this pull request as draft June 2, 2024 15:17
@TheMeier TheMeier marked this pull request as ready for review June 2, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants