Bug 222481 - sysutils/rubygem-chef: package installation doesn't necessarily create /var/chef/...; causes some issues with tools
Summary: sysutils/rubygem-chef: package installation doesn't necessarily create /var/c...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Enji Cooper
URL: https://reviews.freebsd.org/D12428
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-20 21:32 UTC by Enji Cooper
Modified: 2017-10-21 07:52 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (renchap)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer 2017-09-20 21:32:30 UTC
chef-solo from rubygem-chef-13.2.20 requires /var/chef exist in order to run, but unfortunately installing the package didn't create the directory. This results in a slightly cryptic error when trying to run chef-solo from the package.

Creating /var/chef beforehand, then rerunning chef-solo allows it to run to completion.

== BEFORE ==

# chef-solo
[2017-09-20T14:29:33-07:00] WARN: *****************************************
[2017-09-20T14:29:33-07:00] WARN: Did not find config file: /etc/chef/solo.rb, using command line options.
[2017-09-20T14:29:33-07:00] WARN: *****************************************
[2017-09-20T14:29:33-07:00] WARN: No cookbooks directory found at or above current directory.  Assuming /var/chef.
[2017-09-20T14:29:33-07:00] WARN: *****************************************
[2017-09-20T14:29:33-07:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2017-09-20T14:29:33-07:00] WARN: *****************************************
Starting Chef Client, version 13.2.20ESC[0m
[2017-09-20T14:29:36-07:00] ERROR: #<Errno::ENOENT: No such file or directory @ dir_s_mkdir - /var/chef/nodes>
...

ESC[0mSystem Info:ESC[0m
------------ESC[0m
chef_version=13.2.20
ESC[0mruby=ruby 2.3.4p301 (2017-03-30 revision 58214) [amd64-freebsd11]
ESC[0mprogram_name=chef-solo worker: ppid=5888;start=14:29:34;
ESC[0mexecutable=/usr/local/bin/chef-soloESC[0m

ESC[0mESC[0m
Running handlers:ESC[0m
[2017-09-20T14:29:36-07:00] ERROR: Running exception handlers
Running handlers complete
ESC[0m[2017-09-20T14:29:36-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 02 secondsESC[0m
[2017-09-20T14:29:36-07:00] FATAL: Stacktrace dumped to /etc/chef/local-mode-cache/cache/chef-stacktrace.out
[2017-09-20T14:29:36-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-09-20T14:29:36-07:00] ERROR: 500 "Internal Server Error"
[2017-09-20T14:29:36-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

== AFTER ==

# chef-solo
[2017-09-20T14:31:41-07:00] WARN: *****************************************
[2017-09-20T14:31:41-07:00] WARN: Did not find config file: /etc/chef/solo.rb, using command line options.
[2017-09-20T14:31:41-07:00] WARN: *****************************************
[2017-09-20T14:31:41-07:00] WARN: No cookbooks directory found at or above current directory.  Assuming /var/chef.
[2017-09-20T14:31:41-07:00] WARN: *****************************************
[2017-09-20T14:31:41-07:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2017-09-20T14:31:41-07:00] WARN: *****************************************
Starting Chef Client, version 13.2.20ESC[0m
resolving cookbooks for run list: []ESC[0m
Synchronizing Cookbooks:ESC[0m
Installing Cookbook Gems:ESC[0m
Compiling Cookbooks...ESC[0m
[2017-09-20T14:31:43-07:00] WARN: Node fbsd11 has an empty run list.
Converging 0 resourcesESC[0m
ESC[0m
Running handlers:ESC[0m
Running handlers complete
ESC[0mChef Client finished, 0/0 resources updated in 02 secondsESC[0m
[2017-09-20T14:31:43-07:00] WARN: *****************************************
[2017-09-20T14:31:43-07:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2017-09-20T14:31:43-07:00] WARN: *****************************************
Comment 1 commit-hook freebsd_committer 2017-10-21 07:51:08 UTC
A commit references this bug:

Author: ngie
Date: Sat Oct 21 07:50:45 UTC 2017
New revision: 452573
URL: https://svnweb.freebsd.org/changeset/ports/452573

Log:
  Create and manage /var/chef via the @dir directive

  This allows me to install rubygem-chef and run chef-solo out of the box, and
  achieves parity with variants of CentOS Linux.

  PR: 222481
  Approved by: matthew (maintainer timeout)

Changes:
  head/sysutils/rubygem-chef/Makefile
  head/sysutils/rubygem-chef/pkg-plist