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

Using third party repo on Debian (11) does not work correctly #475

Open
sid3windr opened this issue Jun 24, 2023 · 2 comments
Open

Using third party repo on Debian (11) does not work correctly #475

sid3windr opened this issue Jun 24, 2023 · 2 comments

Comments

@sid3windr
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.25 (Puppetlabs)
  • Distribution: Debian 11
  • Module version: 9.0.1

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

  class { '::nodejs':
    repo_url_suffix     => '16.x',
    manage_package_repo => true,
  }

What are you seeing

Starting from a machine which has no node or npm installed at all.

On the first Puppet run when adding the nodejs class to the machine, the nodesource apt repo configuration is added. Node is installed from Debian sources (not the 3rd party repo) along with a zillion node-* support packages. The npm package is pulled in by this, I believe, then removed by the Puppet module at the end of the run.

I run apt-get upgrade to install available updates. This, now using the nodesource apt repo, will remove all packages pulled in earlier and replace them by a single nodejs package in version 16, as requested.

On every Puppet run after this upgrade happened, the module now tries to install the npm package from Debian's repositories, which conflicts with the nodesource nodejs package (which already contains its own npm, it is not a separate package). The Puppet run fails due to this error.

Setting npm_package_ensure to absent makes no difference to this behaviour.

What behaviour did you expect instead

Installation of node v16 (preferrably immediately), but more importantly, non-failing Puppet runs after this has happened.

Output log

Info: Applying configuration version '1687605455'
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install npm' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libnode72 : Conflicts: nodejs-legacy
 nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages.
@cruelsmith
Copy link

Duplicate of #452
See #452 (comment) for a workaround

@sid3windr
Copy link
Author

The outcome is markedly differnet though, in the case of #452 npm and because of that nodejs is removed again but their Puppet run is not broken. This is not the case in my output above - the module in fact tries to install npm when it shouldn't, failing the run.

Setting npm_package_name to false (both through class parameter and hiera) does not fix this situation either - it tries to do exactly the same, and the run still fails.

Info: Applying configuration version '1688501423'
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install npm' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libnode72 : Conflicts: nodejs-legacy
 nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages.
Error: /Stage[main]/Main/Package[yarn]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install npm' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libnode72 : Conflicts: nodejs-legacy
 nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages. (corrective)
Info: Class[Main]: Unscheduling all events on Class[Main]
Info: Stage[main]: Unscheduling all events on Stage[main]
Notice: Applied catalog in 20.88 seconds

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

No branches or pull requests

2 participants