title: GCloud Functions debugging deployment failure
body: <p>Just started using <code>GCloud Functions</code> today, and I am having a problem.
  I've updated one of my projects to be function-ready and used google's <code>local-emulator</code> (@google-cloud/functions-emulator) to debug and test my new function.
  Everything went well and emulator deployment went just fine.
  ```</p>
  
  <pre><code>$ functions deploy doThing --trigger-http --timeout=540s
  Copying file:///var/folders/nw/.../T/us-central1-doThing-....zip...
  Waiting for operation to finish...done.
  Deploying function.......done.
  Function doThing deployed.
  </code></pre>
  
  <p>```</p>
  
  <p>But when i try to do the same thing using the actual <code>gcloud beta functions</code> I get a build error without any reason or obvious way to debug it:</p>
  
  <p>```</p>
  
  <pre><code>$ gcloud beta functions deploy doThing --stage-bucket test-bucket --trigger-http --timeout=360s
  Copying file:///var/folders/nw/.../T/tmpUJvuxd/fun.zip [Content-Type=application/zip]...
  | [1 files][  7.5 MiB/  7.5 MiB]
  Operation completed over 1 objects/7.5 MiB.
  Deploying function (may take a while - up to 2 minutes)...failed.
  ERROR: (gcloud.beta.functions.deploy) OperationError: code=13, message=Error in the build environment
  </code></pre>
  
  <p>```</p>
  
  <p>In the GClould logs I'm not getting any other details either ==> <a href="https://pastebin.com/6H7DRkE8" rel="nofollow noreferrer">https://pastebin.com/6H7DRkE8</a></p>
  
  <p>How can I debug this deployment issue?</p>