Error uploading cookbook on AWS OpsWorks for Chef Automate


#1

Hi,

On my Chef Automate Server on OpsWorks, I am able to successfully run knife ssl check. However, when I try to upload a cookbook, I get the following:

PS > knife cookbook upload httpd
Uploading learn_chef_httpd [0.1.0]
ERROR: Server returned error 500 for https://xxxxxxxx.us-east-1.opsworks-cm.io/organizations/default/sandboxes/f85fc5e1331ad7fe3f9efb5e7bb1b0fa, retrying 1/5 in 4s

Has anyone else run into this issue on a new OpsWorks Chef Automate server?

Thanks!


#3

This sounds like an ACL problem.

You should connect to your instance and run a chef-server-ctl tail while uploading to see what is wrong.


#4

I found out what was causing my issue. the hostname on the AWS instance needed to be set to the FQDN hostname as supplied by AWS when Chef Automate server has completed spinning up. I set the hostname to that and cookbook uploads are working now.
Thanks for the suggestions.


#5

When you say set the hostname on the instance, what exactly did you change to get yours working?

I’m having what seems to be the same issue with a newly-created Chef Automate server. I’ve tried re-creating it a bunch of times, all with the same result. At first, we thought it was a connectivity issue related to the configuration of the VPC we put it in, relating to setting up an s3 endpoint. We added that and it still fails.

Here’s what appears to be the main error in the logs when running berks upload or knife cookbook upload:

==> /var/log/opscode/opscode-erchef/current <==
2016-12-15_16:58:29.71013 [error] Checking presence of file (checksum: <<“2d0133b2d753adac27212d067fc64ed4”>>) for org <<“c1c26214cfc500e555169f001806f698”>> from bucket “bookshelf” (key: “organization-c1c26214cfc500e555169f001806f698/checksum-2d0133b2d753adac27212d067fc64ed4”) raised exception error:{badmatch,{error,{malformed_url,https,“https:”}}}

It’s like the URI for the storage isn’t being set during the cloudformation provisioning.

Any suggestions would be quite welcome.


#6

After talking with AWS support, it appears this is a relatively common issue and they gave us a workaround for it.

After the Chef Automate service completes its provisioning through the AWS console, SSH into the ec2 instance.

Edit /etc/opscode/chef-server.rb and make sure the following line exists:

bookshelf[‘vip’] = ‘127.0.0.1’

Reconfigure the chef server:

sudo chef-server-ctl reconfigure

That worked for us and cookbook uploading now succeeds as expected.