The file /etc/opscode/pivotal.pem is missing

When I tried installing chef server and run chef-server-ctl reconfigure, I keep getting the following error,

chef-server-ctl reconfigure

Starting Chef Client, version 12.12.19
resolving cookbooks for run list: [“private-chef::default”]
Synchronizing Cookbooks:

  • yum (3.11.0)
  • chef-sugar (3.3.0)
  • packagecloud (0.2.4)
  • openssl (4.4.0)
  • runit (1.6.0)
  • private-chef (0.1.0)
  • enterprise (0.10.1)
  • apt (2.9.2)
    Installing Cookbook Gems:
    Compiling Cookbooks…
    [2016-08-18T14:04:13+05:30] WARN: Chef::Provider::AptRepository already exists! Cannot create deprecation class for LWRP provider apt_repository from cookbook apt
    [2016-08-18T14:04:13+05:30] WARN: AptRepository already exists! Deprecation class overwrites Custom resource apt_repository from cookbook apt
    Recipe: private-chef::default
  • directory[/etc/opscode] action create (up to date)
  • directory[/etc/opscode/logrotate.d] action create (up to date)
    [2016-08-18T14:04:13+05:30] FATAL:

BOOT007: The secrets file (/etc/opscode/private-chef-secrets.json) is present
but the file /etc/opscode/pivotal.pem is missing.

     Ensure that private-chef-secrets.json is copied into /etc/opscode from the
     first Chef Server node that you brought online, then run
     'chef-server-ctl reconfigure' again.

What way I can solve this error, Please help.

I tried re installing chef server, at last I get the following error,

  • execute[restart_rabbitmq_log_service] action run
    • execute /opt/opscode/embedded/bin/sv restart /opt/opscode/sv/rabbitmq/log

Running handlers:
[2016-08-18T14:15:10+05:30] ERROR: Running exception handlers
Running handlers complete
[2016-08-18T14:15:10+05:30] ERROR: Exception handlers complete
Chef Client failed. 21 resources updated in 46 seconds
[2016-08-18T14:15:10+05:30] FATAL: Stacktrace dumped to /var/opt/opscode/local-mode-cache/chef-stacktrace.out
[2016-08-18T14:15:10+05:30] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-08-18T14:15:10+05:30] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[/opt/opscode/embedded/bin/chpst -u opscode -U opscode /opt/opscode/embedded/bin/rabbitmqctl wait /var/opt/opscode/rabbitmq/db/rabbit@localhost.pid] (private-chef::rabbitmq line 121) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘2’
---- Begin output of /opt/opscode/embedded/bin/chpst -u opscode -U opscode /opt/opscode/embedded/bin/rabbitmqctl wait /var/opt/opscode/rabbitmq/db/rabbit@localhost.pid ----
STDOUT: Waiting for rabbit@localhost …
pid is 13389 …
STDERR: Error: process_not_running
---- End output of /opt/opscode/embedded/bin/chpst -u opscode -U opscode /opt/opscode/embedded/bin/rabbitmqctl wait /var/opt/opscode/rabbitmq/db/rabbit@localhost.pid ----
Ran /opt/opscode/embedded/bin/chpst -u opscode -U opscode /opt/opscode/embedded/bin/rabbitmqctl wait /var/opt/opscode/rabbitmq/db/rabbit@localhost.pid returned 2

Try removing the rpm and remove the full directories under /etc/ /opt/ / releated to chef server.
remove the userids created while installing chef server like opscode etc and their home directories too.
After removing these, try to install chef rpm and configure it… You may not get that error again

I have faced the same issue and the following commands solved the problem

sudo mkdir /usr/lib/systemd/system
cp /opt/opscode/embedded/service/omnibus-ctl/spec/fixtures/pivotal.pem /etc/opscode/

Please try these