title: Failed to create function project when deploying firebase cloud function
body: <p>I'm trying to deploy the firebase function from my local machine</p>
  <p>I run the following code:</p>
  <pre><code>firebase deploy --only functions  
  </code></pre>
  <p>I'm getting this error.</p>
  <pre><code>✔  functions: Finished running predeploy script.
  i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
  i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
  ✔  functions: required API cloudbuild.googleapis.com is enabled
  ✔  functions: required API cloudfunctions.googleapis.com is enabled
  i  functions: preparing functions directory for uploading...
  i  functions: packaged functions (95.46 KB) for uploading
  ✔  functions: functions folder uploaded successfully
  i  functions: creating Node.js 14 function messageNotification(us-central1)...
  ⚠  functions: failed to create function projects/xxx/locations/us-central1/functions/messageNotification
  </code></pre>
  <p>There isn't any error message. It merely stated that the function failed to be created. Does anyone know why? Thanks in advance!</p>
  <p><strong>Edit</strong></p>
  <p>I followed what John Hanley suggested and ran</p>
  <pre><code>firebase deploy --debug --only functions
  </code></pre>
  <p>and got the following error message</p>
  <pre><code>[2021-08-05T01:49:33.605Z] &lt;&lt;&lt; HTTP RESPONSE 400 {&quot;vary&quot;:&quot;X-Origin, Referer, Origin,Accept-Encoding&quot;,&quot;content-type&quot;:&quot;application/json; charset=UTF-8&quot;,&quot;date&quot;:&quot;Thu, 05 Aug 2021 01:49:33 GMT&quot;,&quot;server&quot;:&quot;ESF&quot;,&quot;cache-control&quot;:&quot;private&quot;,&quot;x-xss-protection&quot;:&quot;0&quot;,&quot;x-frame-options&quot;:&quot;SAMEORIGIN&quot;,&quot;x-content-type-options&quot;:&quot;nosniff&quot;,&quot;alt-svc&quot;:&quot;h3=\&quot;:443\&quot;; ma=2592000,h3-29=\&quot;:443\&quot;; ma=2592000,h3-T051=\&quot;:443\&quot;; ma=2592000,h3-Q050=\&quot;:443\&quot;; ma=2592000,h3-Q046=\&quot;:443\&quot;; ma=2592000,h3-Q043=\&quot;:443\&quot;; ma=2592000,quic=\&quot;:443\&quot;; ma=2592000; v=\&quot;46,43\&quot;&quot;,&quot;accept-ranges&quot;:&quot;none&quot;,&quot;transfer-encoding&quot;:&quot;chunked&quot;}
  [2021-08-05T01:49:33.605Z] &lt;&lt;&lt; HTTP RESPONSE BODY {&quot;error&quot;:{&quot;code&quot;:400,&quot;message&quot;:&quot;The request has errors&quot;,&quot;status&quot;:&quot;INVALID_ARGUMENT&quot;,&quot;details&quot;:[{&quot;@type&quot;:&quot;type.googleapis.com/google.rpc.BadRequest&quot;,&quot;fieldViolations&quot;:[{&quot;field&quot;:&quot;event_trigger&quot;,&quot;description&quot;:&quot;Expected value channels/{channelId}/{messageId} to match regular expression [^/]+/[^/]+(/[^/]+/[^/]+)*&quot;}]}]}}
  </code></pre>
  <p>I realized the way I was writing the function was wrong. I was writing it</p>
  <pre><code>export const messageNotification = functions.firestore
      .document(&quot;channels/{channelId}/{messageId}&quot;)...
  </code></pre>
  <p>But I should have written it as shown below instead</p>
  <pre><code>export const messageNotification = functions.firestore
      .document(&quot;channels/{channelId}/messages/{messageId}&quot;)
  </code></pre>