voxpupuli / puppet-nodejs

Puppet module to install nodejs and global npm packages
https://forge.puppet.com/puppet/nodejs
Apache License 2.0
113 stars 248 forks source link

npm provider fails when executed as a daemon #455

Open vchepkov opened 2 years ago

vchepkov commented 2 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

Error occurs when provider is instantiated

What are you seeing

Mar 23 19:40:11 web201 puppet-agent[1488784]: Could not prefetch package provider 'npm': invalid byte sequence in US-ASCII
Mar 23 19:40:11 web201 puppet-agent[1488784]: Failed to apply catalog: invalid byte sequence in US-ASCII

Any additional information you'd like to impart

provider works with no issues with puppet agent -t command from a command line session, I presume while running as a daemon some environment variable, which provider uses, is missing

vchepkov commented 2 years ago

It seems provider requires LANG variable to be set

# env -i puppet agent -t
Info: Applying configuration version 'c78cfbcf'
Error: Could not prefetch package provider 'npm': invalid byte sequence in US-ASCII
Error: Failed to apply catalog: invalid byte sequence in US-ASCII

# env -i LANG=en_US.UTF-8 puppet agent -t
Info: Applying configuration version 'c78cfbcf'
Notice: Applied catalog in 17.17 seconds