When cf push failed to push my APP to CF in AWS, I got the following error.

Using manifest file /home/user/cf-env/manifest.yml

Updating app cf-env in org codex / space cf-app-testing as admin...  
OK

Uploading cf-env...  
FAILED  
Error processing app files: Error uploading application.  
Server error, status code: 500, error code: 10001, message: An unknown error occurred.

I was hoping to find out more useful information by checking the logs. Unfortunately, I got nothing more than "an unknown error occurred" log message. I spent 10 minutes complaining about how the logging system does not give more helpful error messages and was a bit frustrated. I then sat back and thought through what happens when I push an APP to CF.

It failed at the "uploading application" step where files should be uploaded to the CC Blobstore. In my case, I use an S3 bucket as the Blobstore, so I logged into my AWS console and found that none of the buckets were there! I created the missing buckets in the same region where I deployed my CF and ran cf push again. It almost worked!

The app then uploaded successfully, however, I then saw the following warning in the logs.

[2016-08-18 16:39:21+0000] [fog][WARNING] fog: the specified s3 bucket name(example.com-cc-packages) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance.  For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html

In Bucket Restriction document, it explains with more details:

When using virtual hosted–style buckets with SSL, the SSL wildcard certificate only matches buckets that do not contain periods. To work around this, use HTTP or write your own certificate verification logic. We recommend that you do not use periods (".") in bucket names.

I replaced the period in the bucket name with a dash - and then modified the blobstore configuration accordingly and redeployed, now everything works as expected!

To summarize, make sure your buckets are created and do NOT use a period (.) in your bucket name.

中文版请见:调试 Cloud Foundry 发布应用过程中的”Unknown Error“.