modxevil / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

Invalid MIME type: "x-pkcs12" #531

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1 - Put a .p12 file in your repository (it's a private key).
2 - gcloud app preview deploy app.yaml

What is the expected output? What do you see instead?
The app should deploy with the .p12 file.

What is the output of 'gcloud info'?
The deployment fails, looking in the logs, you can see the root cause is the 
following line:
  Uploading   ...com/26d9d1c09c438d92f51af97acdf4c041005db637.p12: 0 B/1.69 KiB    
  Invalid MIME type: "x-pkcs12"

Please provide any additional information below.
  This error gets raised in the following file / function:

  C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\third_party\apitools\base\py\utils.py:AcceptableMimeType

The above function checks to see if there is a slash in each mimetype. On 
compute engine, most mime types are determined by the mimetypes python library, 
and particularly, mimetypes.guess_type. When you run this function on a .p12 
file, it incorrectly returns ('x-pkcs12', None)
, when it should return ('application/x-pkcs12', None). This appears to be a 
bug with mimetypes, but Google should be able to work around it.

Original issue reported on code.google.com by michael....@gmail.com on 9 Feb 2016 at 10:58

GoogleCodeExporter commented 8 years ago
I should add, I ran into this issue when deploying a managed vm instance.

Original comment by michael....@gmail.com on 9 Feb 2016 at 10:58

GoogleCodeExporter commented 8 years ago
Workaround--
add the following line to skip_files in app.yaml (adding it to .dockerignore is 
not enough)
- ^(.*/)?.*p12^

Original comment by michael....@gmail.com on 9 Feb 2016 at 2:21