Centos 7.6 install error: STDERR: useradd: cannot open /etc/passwd

  • linux_user[firezone] action create

    ================================================================================
    Error executing action create on resource ‘linux_user[firezone]’

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received ‘1’
    ---- Begin output of [“useradd”, “-M”, “firezone”] ----
    STDOUT:
    STDERR: useradd: cannot open /etc/passwd
    ---- End output of [“useradd”, “-M”, “firezone”] ----
    Ran [“useradd”, “-M”, “firezone”] returned 1

    Resource Declaration:

    In /var/opt/firezone/cache/cache/cookbooks/firezone/recipes/config.rb

    53: user node[‘firezone’][‘user’]
    54:

    Compiled Resource:

    Declared in /var/opt/firezone/cache/cache/cookbooks/firezone/recipes/config.rb:53:in `from_file’

    linux_user(“firezone”) do
    action [:create]
    default_guard_interpreter :default
    declared_type :user
    cookbook_name “firezone”
    recipe_name “config”
    end

    System Info:

    chef_version=17.10.0
    platform=centos
    platform_version=7.9.2009
    ruby=ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
    program_name=/opt/firezone/embedded/bin/chef-client
    executable=/opt/firezone/embedded/bin/chef-client

Running handlers:
[2022-08-03T11:07:34+08:00] ERROR: Running exception handlers
Running handlers complete
[2022-08-03T11:07:34+08:00] ERROR: Exception handlers complete
Infra Phase failed. 0 resources updated in 18 seconds
[2022-08-03T11:07:34+08:00] FATAL: Stacktrace dumped to /var/opt/firezone/cache/cache/chef-stacktrace.out
[2022-08-03T11:07:34+08:00] FATAL: ---------------------------------------------------------------------------------------
[2022-08-03T11:07:34+08:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2022-08-03T11:07:34+08:00] FATAL: ---------------------------------------------------------------------------------------
[2022-08-03T11:07:34+08:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: linux_user[firezone] (firezone::config line 53) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of [“useradd”, “-M”, “firezone”] ----
STDOUT:
STDERR: useradd: cannot open /etc/passwd
---- End output of [“useradd”, “-M”, “firezone”] ----
Ran [“useradd”, “-M”, “firezone”] returned 1

Thanks for the report. Is this happening with the one-line automatic install script or one of the other installation methods?

Would you mind posting the command you used to install? We do run smoke tests on CentOS 7. Curious as to why this would be failing.

the one-line automatic install script , Using
curl -1sLf ‘https://dl.cloudsmith.io/public/firezone/firezone/setup.rpm.sh’ | sudo -E bash
and
sudo yum install firezone

can work, but after change the config file , run sudo firezone-ctl reconfigure cmd also got this error .

@lin_xd Thanks for the info. Definitely a strange error. Are the permissions on /etc/passwd correct? Are you able to add users to your system with the sudo useradd command otherwise? From the looks of the error message it seems like this error may be with sudo or the /etc/passwd file itself.

Oh, this reason:

$ lsattr /etc/passwd

----i----------- /etc/passwd

Thanks.