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

foreman export systemd raises undefined method `exists?' for File:Class (NoMethodError) #794

Open
snex opened this issue May 20, 2023 · 1 comment

Comments

@snex
Copy link

snex commented May 20, 2023

> foreman export systemd /home/snex/

/home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/base.rb:86:in `rescue in chown': undefined method `exists?' for File:Class (NoMethodError)
    error("Could not chown #{dir} to #{user}") unless File.writable?(dir) || ! File.exists?(dir)
                                                                                   ^^^^^^^^
Did you mean?  exist?
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/base.rb:83:in `chown'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/base.rb:49:in `export'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/systemd.rb:7:in `export'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/cli.rb:62:in `export'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/command.rb:27:in `run'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor.rb:369:in `dispatch'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/base.rb:444:in `start'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/bin/foreman:7:in `<top (required)>'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/foreman:25:in `load'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/foreman:25:in `<main>'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/ruby_executable_hooks:22:in `eval'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/ruby_executable_hooks:22:in `<main>'
/home/snex/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/fileutils.rb:1954:in `getpwnam': can't find user for app (ArgumentError)

      Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil
                   ^^^^
	from /home/snex/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/fileutils.rb:1954:in `fu_get_uid'
	from /home/snex/.rvm/rubies/ruby-3.2.1/lib/ruby/3.2.0/fileutils.rb:1914:in `chown'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/base.rb:84:in `chown'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/base.rb:49:in `export'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/export/systemd.rb:7:in `export'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/cli.rb:62:in `export'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/command.rb:27:in `run'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor.rb:369:in `dispatch'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/lib/foreman/vendor/thor/lib/thor/base.rb:444:in `start'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/gems/foreman-0.87.2/bin/foreman:7:in `<top (required)>'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/foreman:25:in `load'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/foreman:25:in `<main>'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/ruby_executable_hooks:22:in `eval'
	from /home/snex/.rvm/gems/ruby-3.2.1@xpg/bin/ruby_executable_hooks:22:in `<main>'
@jcoyne
Copy link

jcoyne commented Aug 16, 2023

@snex there is a fix in #788

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