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

Ubutnu 16.04 second provisioning fails & puts node.js in invalid state #360

Closed
MichaelMackus opened this issue Mar 22, 2018 · 4 comments
Closed
Labels
needs-feedback Further information is requested

Comments

@MichaelMackus
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.3.3
  • Ruby: 2.3.1p112 (2016-04-26)
  • Distribution: Ubuntu 16.04
  • Module version: 5.0.0

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

class { '::nodejs' }

What are you seeing

First provision, everything works fine. Second time I provision the server (no matter what combination of repo_url_suffix or manage_repo settings), I get a circular symlink error. It seems like /usr/bin/node is symlinked to /etc/alternatives/nodejs which is also symlinked to /usr/bin/node!

What behaviour did you expect instead

Idempotent node.js installation, no matter how many times provision is run.

Output log

Notice: /Stage[main]/Nodejs::Install/File[/usr/bin/node]/ensure: ensure changed 'file' to 'link'
Notice: /Stage[main]/Nodejs::Install/File[/usr/share/man/man1/node.1.gz]/ensure: ensure changed 'file' to 'link'
Error: Execution of '/usr/local/bin/npm install --global bower' returned 126: /usr/bin/env: 'node': Too many levels of symbolic links
Error: /Stage[main]/Base::Provision::Nodejs/Package[bower]/ensure: change from 'absent' to 'present' failed: Execution of '/usr/local/bin/npm install --global bower' returned 126: /usr/bin/env: 'node': Too many levels of symbolic links
Error: Execution of '/usr/local/bin/npm install --global yarn' returned 126: /usr/bin/env: 'node': Too many levels of symbolic links
Error: /Stage[main]/Base::Provision::Nodejs/Package[yarn]/ensure: change from 'absent' to 'present' failed: Execution of '/usr/local/bin/npm install --global yarn' returned 126: /usr/bin/env: 'node': Too many levels of symbolic links
@MichaelMackus
Copy link
Author

MichaelMackus commented Mar 22, 2018

NOTE: the yarn package I'm installing doesn't seem to matter, it is just showing the underlying issue of the circular symlink created by puppet-nodejs. The relevant lines (that shouldn't be happening) are the first 2 lines in the output log above. Node.js is working before this point, and if puppet-nodejs can be stopped from creating the circular symlink this issue will be solved.

Also note, the first provision installs Node.js & NPM correctly. Here are the relevant output lines after the first provision:

Notice: /Stage[main]/Nodejs::Install/File[/usr/bin/node]/ensure: created
Notice: /Stage[main]/Nodejs::Install/File[/usr/share/man/man1/node.1.gz]/ensure: created
Notice: /Stage[main]/Nodejs::Install/Package[nodejs]/ensure: created

Afterwards, if I run provision again, it puts the system in an invalid state. This is even more so annoying since apt-get remove nodejs doesn't work due to the circular symlinks (which have to be manually removed first).

@juniorsysadmin juniorsysadmin added the needs-feedback Further information is requested label Mar 22, 2018
@juniorsysadmin
Copy link
Member

@MichaelMackus We dropped symlink management in #347 , which is in 5.0.0. Can verify the source and version of the module that you are using?

@MichaelMackus
Copy link
Author

Hmm. I'm using 5.0.0 of puppet-nodejs, commit SHA c771342 - looks like that's the latest commit according to Github.

@MichaelMackus
Copy link
Author

OK that was weird! Looks like my puppet module inside the container was different than the one on my host (which is 5.0.0). I did a quick update of the module, and everything is working as expected now!

Sorry for the false alarm. In any case, glad this is figured out, was a huge annoyance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants