firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 932 forks source link

Deployment error. Failed to verify the provided Cloud Storage Signed URL #1852

Closed warteruzannan closed 4 years ago

warteruzannan commented 4 years ago

node: v8.16.2

firebase-functions: ^2.0.0

firebase-tools: 7.9.0

firebase-admin: ^7.0.0

I'm trying deploy functions using only:

firebase --project ddmania deploy --only functions

However, a got the following error: Deployment error. Failed to verify the provided Cloud Storage Signed URL

How can i solve it?

I have no any file in Cloud Storage...

When a try to access any function i get the following error:

Error: Forbidden Your client does not have permission to get URL

I tried set the role function as allUsers but still giving error...

I also have a service account set up.... but no success..

content of my index.js

const functions = require('firebase-functions');
const admin = require('firebase-admin');

var serviceAccount = require("./ddmania-live.json");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://ddmania-live.firebaseio.com",  
});

exports.teste = functions.https.onRequest((req,res) => {
  res.send({"message":"WORKKKK :)"})
})
google-oss-bot commented 4 years ago

I found a few problems with this issue:

joehan commented 4 years ago

Hey @warteruzannan, sorry to see that you are having trouble. Could you run firebase --project ddmania deploy --only functions --debug and post the output here?

It looks like, from the error message you included, firebase-tools is unable to upload your function code. Behind the scenes, this uses a signed Cloud Storage URL, hence the slightly confusing error message.

warteruzannan commented 4 years ago

@joehan thanks for you help. same error... this's the output.

[2019-12-06T21:16:59.221Z] ----------------------------------------------------------------------
[2019-12-06T21:16:59.236Z] Command:       /usr/bin/node /usr/bin/firebase --project ddmania deploy --only functions --debug
[2019-12-06T21:16:59.238Z] CLI Version:   7.9.0
[2019-12-06T21:16:59.239Z] Platform:      linux
[2019-12-06T21:16:59.239Z] Node Version:  v8.16.2
[2019-12-06T21:16:59.243Z] Time:          Fri Dec 06 2019 18:16:59 GMT-0300 (-03)
[2019-12-06T21:16:59.243Z] ----------------------------------------------------------------------
[2019-12-06T21:16:59.244Z] 
[2019-12-06T21:16:59.277Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-12-06T21:16:59.278Z] > authorizing via signed-in user
[2019-12-06T21:16:59.280Z] [iam] checking project ddmania for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2019-12-06T21:16:59.289Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[2019-12-06T21:16:59.291Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[2019-12-06T21:16:59.797Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=utf-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:16:59 GMT, server=scaffolding on HTTPServer2, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:16:59.810Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/ddmania:testIamPermissions  
 permissions=[cloudfunctions.functions.create, cloudfunctions.functions.delete, cloudfunctions.functions.get, cloudfunctions.functions.list, cloudfunctions.functions.update, cloudfunctions.operations.get, firebase.projects.get]
[2019-12-06T21:17:01.053Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:00 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=853, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked

=== Deploying to 'ddmania'...

i  deploying functions
[2019-12-06T21:17:05.704Z] > [functions] package.json contents: {
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "dependencies": {
    "axios": "^0.19.0",
    "crypto-js": "^3.1.9-1",
    "firebase-admin": "^8.8.0",
    "firebase-functions": "^3.3.0",
    "nodemailer": "^4.0.1"
  },
  "engines": {
    "node": "8"
  },
  "private": false
}
i  functions: ensuring necessary APIs are enabled...
[2019-12-06T21:17:05.712Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/ddmania/services/cloudfunctions.googleapis.com  

[2019-12-06T21:17:05.716Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/ddmania/services/runtimeconfig.googleapis.com  

[2019-12-06T21:17:07.024Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:06 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:12.030Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:11 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
✔  functions: all necessary APIs are enabled
[2019-12-06T21:17:12.032Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/ddmania/adminSdkConfig  

[2019-12-06T21:17:12.626Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:12 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
i  functions: preparing functions directory for uploading...
[2019-12-06T21:17:12.634Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/ddmania/configs  

[2019-12-06T21:17:13.240Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:13 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:13.243Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/ddmania/configs/gmail/variables  

[2019-12-06T21:17:13.797Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:13 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:13.800Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/ddmania/configs/gmail/variables/email  

[2019-12-06T21:17:13.801Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/ddmania/configs/gmail/variables/password  

[2019-12-06T21:17:14.137Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:14 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:15.088Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:14 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
i  functions: packaged functions (42.9 KB) for uploading
[2019-12-06T21:17:15.687Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/ddmania/locations/us-central1/functions:generateUploadUrl  

[2019-12-06T21:17:17.040Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:16 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:17.043Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-c155df2e-b10d-42bf-b08d-12d4c91e3045/b84b7428-d935-467a-b348-a7c50200128d.zip?GoogleAccessId=service-254212774609@gcf-admin-robot.iam.gserviceaccount.com&Expires=1575668836&Signature=S7F4%2B46ebGy9IGM%2BsRn0FuepBNY32m6mWaH1jaLfCXrF4Kb2uUcHzPCyUfclbvvDFn%2Bh2Qa540wYLJStr26rvcuN3ZzLRJrCOu1PkGvHy5DuEj2ytwZKrVSBeLA8MG0VV%2BgPSVsB2SYltOoCoWKSDrOyfdNINYFdcR7wgpSrL6g2QZ%2F6iGiGQl8HxshsaweeXIIKNpmEu6G1qgSXIMS%2FhP4xasV0XpJfzku5nkZbF5%2FoJRWn6FX9cfWz%2FM9I1DgxjwrYZwoEGYgspjrDSM3WxpJ0hK2zLVwsf3NcoJsNa1rjpHHZtyKL0I8RXzcSbXJzx8z96QM9OlvjWISgZofWXw%3D%3D  
 <request body omitted>
[2019-12-06T21:17:17.528Z] <<< HTTP RESPONSE 200 x-guploader-uploadid=AEnB2UoNWAYLAVTclkOuoctDL61ILi9GrKSUlljeGC4RsiIINDUOBU_0tL5Gqs-aX0PW5NGG-eMYqJTsA5iAyPvOARh_iUqPOQ, etag="f21d4046f864f8aa8abd548c536ed18a", x-goog-generation=1575667037417008, x-goog-metageneration=1, x-goog-hash=crc32c=EiMFsQ==, md5=8h1ARvhk+KqKvVSMU27Rig==, x-goog-stored-content-length=43932, x-goog-stored-content-encoding=identity, vary=Origin, content-length=0, date=Fri, 06 Dec 2019 21:17:17 GMT, server=UploadServer, content-type=text/html; charset=UTF-8, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
✔  functions: functions folder uploaded successfully
[2019-12-06T21:17:17.538Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/ddmania/locations/-/functions  

[2019-12-06T21:17:19.121Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:18 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
i  functions: updating Node.js 8 function teste(us-central1)...
[2019-12-06T21:17:19.130Z] Trigger is:  {"httpsTrigger":{}}
[2019-12-06T21:17:19.133Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/ddmania/services/cloudscheduler.googleapis.com  

[2019-12-06T21:17:20.206Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:20 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:20.210Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/ddmania/locations/us-central1/functions/teste {"updateMask":"sourceUploadUrl,name,labels,runtime,httpsTrigger"} 
 sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-c155df2e-b10d-42bf-b08d-12d4c91e3045/b84b7428-d935-467a-b348-a7c50200128d.zip?GoogleAccessId=service-254212774609@gcf-admin-robot.iam.gserviceaccount.com&Expires=1575668836&Signature=S7F4%2B46ebGy9IGM%2BsRn0FuepBNY32m6mWaH1jaLfCXrF4Kb2uUcHzPCyUfclbvvDFn%2Bh2Qa540wYLJStr26rvcuN3ZzLRJrCOu1PkGvHy5DuEj2ytwZKrVSBeLA8MG0VV%2BgPSVsB2SYltOoCoWKSDrOyfdNINYFdcR7wgpSrL6g2QZ%2F6iGiGQl8HxshsaweeXIIKNpmEu6G1qgSXIMS%2FhP4xasV0XpJfzku5nkZbF5%2FoJRWn6FX9cfWz%2FM9I1DgxjwrYZwoEGYgspjrDSM3WxpJ0hK2zLVwsf3NcoJsNa1rjpHHZtyKL0I8RXzcSbXJzx8z96QM9OlvjWISgZofWXw%3D%3D, name=projects/ddmania/locations/us-central1/functions/teste, deployment-tool=cli-firebase, , runtime=nodejs8
[2019-12-06T21:17:26.941Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:26 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:26.946Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/ddmania/locations/-/functions  

[2019-12-06T21:17:28.483Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:28 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2019-12-06T21:17:28.489Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/aW5mb3NvaWwtbGl2ZS91cy1jZW50cmFsMS90ZXN0ZS9sMThQM2xGSlRJWQ  

[2019-12-06T21:17:29.847Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 06 Dec 2019 21:17:29 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
⚠  functions[teste(us-central1)]: Deployment error.
Failed to verify the provided Cloud Storage Signed URL

Functions deploy had errors with the following functions:
    teste

To try redeploying those functions, run:
    firebase deploy --only functions:teste

To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.
joehan commented 4 years ago

Thanks for the quick reply. I'm pretty certain that this is a firebase-tools/Cloud Functions API issue. 2 things for you to try: 1 - Do you have the environment variable GOOGLE_APPLICATION_CREDENTIALS set? If so, can you unset it and try again? 2 - Can you update to the latest versions of firebase-functions, firebase-admin, and firebase-tools?

warteruzannan commented 4 years ago

Thanks, @joehan. I'll try this.

joehan commented 4 years ago

No problem - I'm also going to move this issue over to firebase-tools, since thats where the code to deploy functions lives.

warteruzannan commented 4 years ago

@joehan it didn't work... I updated the firebase-functions, firebase-admin, and firebase-tools to the latest versions...

firebase-functions@3.3.0 firebase-admin@8.8.0 firebase-tools@7.9.0

I have set the google credentials..

export GOOGLE_APPLICATION_CREDENTIALS="/home/warteruzannan/Projects/ddmania-firebase-adminsdk.json"

echo $GOOGLE_APPLICATION_CREDENTIALS
/home/warteruzannan/Projects/ddmania-firebase-adminsdk.json

But a got the same error...

joehan commented 4 years ago

Hey @warteruzannan, sorry for the delayed response. After looking into this error a bit more, it is coming from the Google Cloud Functions API. I don't know all that much about the internal workings of that API, so I've filed an internal bug (146018787) with the team responsible for that API, and I'll post any updates I get on it here.

I did try to look into the GCF code that would be throwing this error, but its unclear to me exactly whats causing it here. One shot in the dark - have you tried to deploy this function without a service account? So unset GOOGLE_APPLICATION_CREDENTIALS firebase --project ddmania deploy --only functions

Could you also file this issue on the Cloud Functions issue tracker for increased visibility? https://issuetracker.google.com/issues/new?component=187195&template=802601

warteruzannan commented 4 years ago

Hello, @joehan. Thanks for your answer.

I've deployed my functions using the online editor.. I've uploaded a .zip with my functions and chosen it for creating the functions...

Using the firebase-tool still not working...

joehan commented 4 years ago

Glad to hear that you found a workaround! I'm going to keep this open until we figure out what is going wrong when you deploy via firebase-tools

its-dibo commented 4 years ago

the same here

warteruzannan commented 4 years ago

@eng-dibo, you can try using the online editor. I've have deployed my functions from a .zip

its-dibo commented 4 years ago

@warteruzannan more details please, and from where can I get the online editor?

warteruzannan commented 4 years ago

@eng-dibo..

You can access from Cloud Console. https://console.cloud.google.com/functions

Click on "Create Function" and in "Source code" check "Zip Upload"

Upload a zip with your functions..

joehan commented 4 years ago

Hey all, this is proving to be a very tricky one. I've been working with an Google Cloud engineer to try to figure out what is happening. Here's what we've figured out so far:

With these things in mind, I suspect the issue is related to the either the service account you are using, or the auth headers that the CLI passes in during the generateUploadUrl or createFunction calls:

admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://ddmania-live.firebaseio.com",
});


from your repro code? 

Apologies for the lack of a quick resolution on this, this is one of the weirder errors I've seen from functions deployment.
joehan commented 4 years ago

Hey all, I've got an update from the Google Cloud Storage team. @warteruzannan and @eng-dibo - it looks like your issues were caused by an internal bug that caused signed upload URLs to be signed with an invalid certificate. They are currently looking into why this was happening (internal bug 146018787), but we think it should be resolved for these projects, and you should be able to deploy through the Firebase CLI now.

its-dibo commented 4 years ago

Good jon @joehan

this is google cloud console, not firebase to access it one has to create a paid account at google cloud, whitch I don't need nowadays @warteruzannan

seanphoenix commented 4 years ago

Hi guys, I have same issue here. Would you mind take a look at my log to see if the main cause is the same? Thanks.

[2020-01-14T04:45:32.156Z] ----------------------------------------------------------------------
[2020-01-14T04:45:32.169Z] Command:       /usr/local/bin/node /usr/local/bin/firebase deploy --only functions --debug
[2020-01-14T04:45:32.171Z] CLI Version:   7.11.0
[2020-01-14T04:45:32.172Z] Platform:      darwin
[2020-01-14T04:45:32.173Z] Node Version:  v13.6.0
[2020-01-14T04:45:32.190Z] Time:          Tue Jan 14 2020 12:45:32 GMT+0800 (台北標準時間)
[2020-01-14T04:45:32.190Z] ----------------------------------------------------------------------
[2020-01-14T04:45:32.190Z] 
[2020-01-14T04:45:32.212Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2020-01-14T04:45:32.213Z] > authorizing via signed-in user
[2020-01-14T04:45:32.219Z] [iam] checking project PROJECT_NAME for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2020-01-14T04:45:32.220Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[2020-01-14T04:45:32.221Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[2020-01-14T04:45:32.355Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=utf-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:32 GMT, server=scaffolding on HTTPServer2, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:32.361Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/PROJECT_NAME:testIamPermissions  
 permissions=[cloudfunctions.functions.create, cloudfunctions.functions.delete, cloudfunctions.functions.get, cloudfunctions.functions.list, cloudfunctions.functions.update, cloudfunctions.operations.get, firebase.projects.get]
[2020-01-14T04:45:33.267Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:33 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=873, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked

=== Deploying to 'PROJECT_NAME'...

i  deploying functions
[2020-01-14T04:45:35.318Z] > [functions] package.json contents: {
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "dependencies": {
    "firebase-admin": "^8.9.0",
    "firebase-functions": "^3.3.0",
    "request": "^2.88.0"
  },
  "engines": {
    "node": "8"
  },
  "private": true
}
i  functions: ensuring necessary APIs are enabled...
[2020-01-14T04:45:35.320Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/PROJECT_NAME/services/cloudfunctions.googleapis.com  

[2020-01-14T04:45:35.320Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/PROJECT_NAME/services/runtimeconfig.googleapis.com  

[2020-01-14T04:45:36.785Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:36 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:36.817Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:36 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
✔  functions: all necessary APIs are enabled
[2020-01-14T04:45:36.819Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/PROJECT_NAME/adminSdkConfig  

[2020-01-14T04:45:37.414Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:37 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
i  functions: preparing functions directory for uploading...
[2020-01-14T04:45:37.417Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/PROJECT_NAME/configs  

[2020-01-14T04:45:37.923Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:37 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:37.924Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/PROJECT_NAME/configs/shippo/variables  

[2020-01-14T04:45:37.924Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/PROJECT_NAME/configs/shopify/variables  

[2020-01-14T04:45:38.176Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:38 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:38.177Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/PROJECT_NAME/configs/shopify/variables/url  

[2020-01-14T04:45:38.177Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:38 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:38.178Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/PROJECT_NAME/configs/shippo/variables/token  

[2020-01-14T04:45:38.178Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/PROJECT_NAME/configs/shippo/variables/tracking  

[2020-01-14T04:45:38.409Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:38 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:38.417Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:38 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:38.436Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:38 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
i  functions: packaged functions (32.27 KB) for uploading
[2020-01-14T04:45:39.197Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/us-central1/functions:generateUploadUrl  

[2020-01-14T04:45:39.844Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:39 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:39.845Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-1a5bfe43-b562-4e71-8e6b-c7df7df58c19/2b41bf52-8f0f-4b03-ae2d-5514317a905b.zip?GoogleAccessId=ACCESS_ID@gcf-admin-robot.iam.gserviceaccount.com&Expires=1578978939&Signature=SIGNATURE  
 <request body omitted>
[2020-01-14T04:45:40.214Z] <<< HTTP RESPONSE 200 x-guploader-uploadid=AEnB2Urt1mv3jpWoDM3JJc-t5pFsXWCKGdki30H70Y4CFiQNHRQb0Q_Q99BaVuyI0Rhf-oryVMnemnRSoto60wN5EBTzQANLD66NGxCXgZ8mk3zGE2nST6M, etag="2fdf9ab7b5febfa203923e3ebf07a81d", x-goog-generation=1578977140092961, x-goog-metageneration=1, x-goog-hash=crc32c=zOphwA==, md5=L9+at7X+v6IDkj4+vweoHQ==, x-goog-stored-content-length=33045, x-goog-stored-content-encoding=identity, vary=Origin, content-length=0, date=Tue, 14 Jan 2020 04:45:40 GMT, server=UploadServer, content-type=text/html; charset=UTF-8, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
✔  functions: functions folder uploaded successfully
[2020-01-14T04:45:40.217Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/-/functions  

[2020-01-14T04:45:40.574Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:40 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
i  functions: updating Node.js 8 function dailyNotificationJob(us-central1)...
[2020-01-14T04:45:40.576Z] Trigger is:  {"eventTrigger":{"resource":"projects/PROJECT_NAME/topics/daily-tick","eventType":"google.pubsub.topic.publish","service":"pubsub.googleapis.com"}}
i  functions: updating Node.js 8 function tracking(us-central1)...
[2020-01-14T04:45:40.577Z] Trigger is:  {"httpsTrigger":{}}
i  functions: updating Node.js 8 function pushTestNotification(us-central1)...
[2020-01-14T04:45:40.606Z] Trigger is:  {"httpsTrigger":{}}
i  functions: updating Node.js 8 function validateDiscountCode(us-central1)...
[2020-01-14T04:45:40.607Z] Trigger is:  {"httpsTrigger":{}}
[2020-01-14T04:45:40.607Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/PROJECT_NAME/services/cloudscheduler.googleapis.com  

[2020-01-14T04:45:41.868Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:41 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:41.870Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/us-central1/functions/dailyNotificationJob {"updateMask":"sourceUploadUrl,name,labels,runtime,eventTrigger.resource,eventTrigger.eventType,eventTrigger.service"} 
 sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-1a5bfe43-b562-4e71-8e6b-c7df7df58c19/2b41bf52-8f0f-4b03-ae2d-5514317a905b.zip?GoogleAccessId=ACCESS_ID@gcf-admin-robot.iam.gserviceaccount.com&Expires=1578978939&Signature=SIGNATURE, name=projects/PROJECT_NAME/locations/us-central1/functions/dailyNotificationJob, deployment-tool=cli-firebase, resource=projects/PROJECT_NAME/topics/daily-tick, eventType=google.pubsub.topic.publish, service=pubsub.googleapis.com, runtime=nodejs8
[2020-01-14T04:45:42.106Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/us-central1/functions/tracking {"updateMask":"sourceUploadUrl,name,labels,runtime,httpsTrigger"} 
 sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-1a5bfe43-b562-4e71-8e6b-c7df7df58c19/2b41bf52-8f0f-4b03-ae2d-5514317a905b.zip?GoogleAccessId=ACCESS_ID@gcf-admin-robot.iam.gserviceaccount.com&Expires=1578978939&Signature=SIGNATURE, name=projects/PROJECT_NAME/locations/us-central1/functions/tracking, deployment-tool=cli-firebase, , runtime=nodejs8
[2020-01-14T04:45:42.125Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/us-central1/functions/pushTestNotification {"updateMask":"sourceUploadUrl,name,labels,runtime,httpsTrigger"} 
 sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-1a5bfe43-b562-4e71-8e6b-c7df7df58c19/2b41bf52-8f0f-4b03-ae2d-5514317a905b.zip?GoogleAccessId=ACCESS_ID@gcf-admin-robot.iam.gserviceaccount.com&Expires=1578978939&Signature=SIGNATURE, name=projects/PROJECT_NAME/locations/us-central1/functions/pushTestNotification, deployment-tool=cli-firebase, , runtime=nodejs8
[2020-01-14T04:45:42.158Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/us-central1/functions/validateDiscountCode {"updateMask":"sourceUploadUrl,name,labels,runtime,httpsTrigger"} 
 sourceUploadUrl=https://storage.googleapis.com/gcf-upload-us-central1-1a5bfe43-b562-4e71-8e6b-c7df7df58c19/2b41bf52-8f0f-4b03-ae2d-5514317a905b.zip?GoogleAccessId=ACCESS_ID@gcf-admin-robot.iam.gserviceaccount.com&Expires=1578978939&Signature=SIGNATURE, name=projects/PROJECT_NAME/locations/us-central1/functions/validateDiscountCode, deployment-tool=cli-firebase, , runtime=nodejs8
[2020-01-14T04:45:42.991Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:42 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:43.006Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:42 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:43.025Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:43.026Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:43.045Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/PROJECT_NAME/locations/-/functions  

[2020-01-14T04:45:43.393Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
[2020-01-14T04:45:43.394Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/YmxhY2ticmFzcy02OTQwNi91cy1jZW50cmFsMS9kYWlseU5vdGlmaWNhdGlvbkpvYi9TS0RnUmdmdTExZw  

[2020-01-14T04:45:43.394Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/YmxhY2ticmFzcy02OTQwNi91cy1jZW50cmFsMS90cmFja2luZy9ScGI3SFdhMlY1Yw  

[2020-01-14T04:45:43.395Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/YmxhY2ticmFzcy02OTQwNi91cy1jZW50cmFsMS9wdXNoVGVzdE5vdGlmaWNhdGlvbi9vdTc3SWRBRjk0VQ  

[2020-01-14T04:45:43.605Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/YmxhY2ticmFzcy02OTQwNi91cy1jZW50cmFsMS92YWxpZGF0ZURpc2NvdW50Q29kZS9EejVkRXZCZW5OWQ  

[2020-01-14T04:45:43.835Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
⚠  functions[tracking(us-central1)]: Deployment error.
Failed to verify the provided Cloud Storage Signed URL
[2020-01-14T04:45:43.843Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
⚠  functions[dailyNotificationJob(us-central1)]: Deployment error.
Failed to verify the provided Cloud Storage Signed URL
[2020-01-14T04:45:43.944Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
⚠  functions[validateDiscountCode(us-central1)]: Deployment error.
Failed to verify the provided Cloud Storage Signed URL
[2020-01-14T04:45:43.948Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 14 Jan 2020 04:45:43 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, accept-ranges=none, transfer-encoding=chunked
⚠  functions[pushTestNotification(us-central1)]: Deployment error.
Failed to verify the provided Cloud Storage Signed URL

Functions deploy had errors with the following functions:
        dailyNotificationJob
        pushTestNotification
        tracking
        validateDiscountCode

To try redeploying those functions, run:
    firebase deploy --only functions:dailyNotificationJob,functions:pushTestNotification,functions:tracking,functions:validateDiscountCode

To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.
sa-webb commented 4 years ago

@warteruzannan @seanphoenix I had the same issue with my project. I was able to get mine working by only using the export GOOGLE_APPLICATION_CREDENTIALS="path/to/key.json" and removing `var serviceAccount = require("path/to/serviceAccountKey.json");

admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://.firebaseio.com",
});` as @joehan recommended. Node version 8 and firebase version 7.12.1

seanphoenix commented 4 years ago

@sa-webb thanks for the advice. But admin is heavily used in my function code. I cannot just remove it. Is there another way to instancing an admin? Any idea?

sa-webb commented 4 years ago

@seanphoenix In my Typescript application I use admin as so.. import * as admin from 'firebase-admin'; admin.initializeApp(); .... await admin.auth().setCustomUserClaims(uid, { role }); so I am able to use admin in my code, I just initialized the app a different way. Hope this helps, feel free to ask if you're still having issues.

enzomanuelmangano commented 4 years ago

The same here.

sa-webb commented 4 years ago

The same here. @egeondundee Same as in you are experiencing the error or same as in you got it to work a particular way? As I mentioned I was able to configure my admin account by using the command line as so - export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json" Then initialized the app with using import * as admin from 'firebase-admin'; admin.initializeApp();

enzomanuelmangano commented 4 years ago
import * as functions from "firebase-functions";

const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);

I do it in that way. I already use my index.ts in another project and it worked fine, that's strange.

samthecodingman commented 4 years ago

@egeondundee PSA functions.config().firebase has been deprecated since v1.0.0.

You shouldn't use it in modern Firebase Functions code. If using a recent version of firebase-functions, it at least resolves to undefined here so that it doesn't mess with modern code.

Use the following for the same functionality:

import * as functions from "firebase-functions";

const admin = require("firebase-admin");
admin.initializeApp();
enzomanuelmangano commented 4 years ago

It still doesn't work. I tried everything.

sa-webb commented 4 years ago

Add your project to github and I will see if I can get it working.

SenikFarsyan commented 4 years ago

Hey any updates on this error ? I have the same problem. and even when trying to upload with Cloud Console ZIP file it gives error.

here is the log from dashboard firebase functions Logs {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"INVALID_ARGUMENT"},"authenticationInfo":{"principalEmail":"tripleearp@gmail.com"},"requestMetadata":{"requestAttributes":{},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/tripleearplatform/locations/us-central1/functions/newUser"}

enzomanuelmangano commented 4 years ago

I solved that problem using Javascript instead of Typescript.

joehan commented 4 years ago

Hey all, if you are seeing this error, please file an issue on the Cloud Functions issue tracker: https://issuetracker.google.com/issues/new?component=187195&template=802601, and make sure to include your project name . They'll be able to look into your project and assist - unfortunately, I am unable to do so.

This error isn't caused by anything that you write in your functions code - its caused by a backend issue at the project level. The Google Cloud Functions team has implemented a fix for the certificate issue that should stop this from happening to future projects, but it may still be affecting your projects.

I'm going to close this for now to hopefully funnel any other users affected by this to the Cloud Functions issue tracker where they can be better served.

jhrtn commented 4 years ago

I just had this same error and found this thread. I use two separate firebase projects, one for dev and one for prod. Using the firebase-cli I'd just added the dev project. I'd used firebase use project-name-prod but had the issue deploying cloud functions. I used firebase logout and then firebase login and everything worked fine. Seems like my projects were out of sync on the backend when I was trying to deploy.

MeshackT commented 7 months ago

Hello, I have been trying to deploy the default test function provided when I first enable firebase functions in my project and I am getting an error which is persistent.

const {onRequest} = require("firebase-functions/v2/https"); const logger = require("firebase-functions/logger");

exports.helloWorld = onRequest((request, response) => { logger.info("Hello logs!", {structuredData: true}); response.send("Hello from Firebase!"); });

These are the versions of my softwares installed below node: v18.17.0 (Even when I install the latest version of node, the error is persistent)

firebase-functions: ^4.7.0

firebase-tools: ^13.3.1

firebase-admin: ^7.0.0

here is my firebase.json file

    {
       "functions": [
         {
           "source": "functions",
           "codebase": "default",
           "ignore": [
             "node_modules",
             ".git",
             "firebase-debug.log",
            "firebase-debug.*.log"
            ],

             //Even when I remove this part (predeploy) the error keeps showing
            "predeploy": [
             "npm --prefix \"%RESOURCE_DIR%\" run lint"
           ] 
         }
       ]
     }

Here is the Package.json file

    {
      "devDependencies": {
        "eslint": "^8.57.0"
      },
      "dependencies": {
        "firebase-functions": "^4.7.0"
      },
      "scripts": {
        "start": "node index.js",
        "test": "echo \"Error: no test specified\" && exit 1",
        "lint": "eslint ."
      }

    }

```I'm trying deploy functions using only:
**firebase deploy --only functions**

=== Deploying to 'revival-academy'...  
i  deploying functions               
i  functions: preparing codebase default for deployment
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...         
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...             
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
+  functions: required API cloudfunctions.googleapis.com is enabled
+  functions: required API cloudbuild.googleapis.com is enabled
+  artifactregistry: required API artifactregistry.googleapis.com is enabled
i  functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8844

i  functions: preparing functions directory for uploading...
i  functions: packaged C:\src\StudioProjects\Revival_academies\creche\functions (74.18 KB) for uploading
i  functions: ensuring required API run.googleapis.com is enabled...
i  functions: ensuring required API eventarc.googleapis.com is enabled...
i  functions: ensuring required API pubsub.googleapis.com is enabled...
i  functions: ensuring required API storage.googleapis.com is enabled...
+  functions: required API eventarc.googleapis.com is enabled
+  functions: required API pubsub.googleapis.com is enabled
+  functions: required API run.googleapis.com is enabled
+  functions: required API storage.googleapis.com is enabled
i  functions: generating the service identity for pubsub.googleapis.com...
i  functions: generating the service identity for eventarc.googleapis.com...
24c.zip?GoogleAccessId=service-372042583890%40gcf-admin-robot.iam.gserviceaccount.com&Expires=1709026786&Signature=JfBwxH%2BIfbth7FfVGpUUKLC%2FXgoOscYD153RtpZ
V2zLLpq1lH4%2FZEsD7hJn7s3SI0YxHN41NAWdZ0O6tzpEKBMse%2B7s%2FFkLxhlKIP4YJL9%2F6BAEzKYabew5IXL%2FzrQhALT%2B%2FxuahbJrKlB%2FJwRioaOoMIy8ay6r2DU1gEzY%2BwoCh9snoa%2

Error: Failed to make request to https://storage.googleapis.com/gcf-v2-uploads-372042583890-us-central1/3a8f57d9-815f-4959-94a4-b856fe06524c.zip?GoogleAccessI
d=service-372042583890%40gcf-admin-robot.iam.gserviceaccount.com&Expires=1709026786&Signature=JfBwxH%2BIfbth7FfVGpUUKLC%2FXgoOscYD153RtpZCNiwpaZQJ838LMXFagkLf
7crUQ0KsBKOp315T8OkMobIkFS6WsqgeXk3CqflqH1%2BNoktwhNOg097gQxVJbTPJiDESMuZI6iu3r90xWLvozblce6N5OkHnUbzbYCCo3x0NeuaCpYGO%2F3tUiLp%2FjgwMxKbV2zLLpq1lH4%2FZEsD7hJ
n7s3SI0YxHN41NAWdZ0O6tzpEKBMse%2B7s%2FFkLxhlKIP4YJL9%2F6BAEzKYabew5IXL%2FzrQhALT%2B%2FxuahbJrKlB%2FJwRioaOoMIy8ay6r2DU1gEzY%2BwoCh9snoa%2B0Dw2Q8oihoAQ%3D%3D  
**When I run firebase functions:log, this is what I am getting**  

2024-02-26T09:09:39.997131Z I undefined: {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":"Mishack.templeton@ gmail.com","principalSubject":"user:Mishack.templeton@gmail.com"},"requestMetadata":{"callerIp":"41.116.70.216","callerSuppliedUserAgent":"FirebaseCLI/13.3.1, gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2024-02-26T09:09:50.029165Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis .com","methodName":"google.cloud.functions.v1.CloudFunctionsService.GenerateUploadUrl","authorizationInfo":[{"resource":"projects/revival-academy/locations/us -central1","permission":"cloudfunctions.functions.sourceCodeSet","granted":true,"resourceAttributes":{},"permissionType":"ADMIN_WRITE"}],"resourceName":"proje cts/revival-academy/locations/us-central1","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.GenerateUploadUrlRequest","parent":"projects/revi val-academy/locations/us-central1"},"response":{"@type":"type.googleapis.com/google.cloud.functions.v1.GenerateUploadUrlResponse","uploadUrl":"https://storage .googleapis.com/uploads-912355258456.us-central1.cloudfunctions.appspot.com/c3b23a83-e243-4a26-a87b-7842da5131ee.zip?GoogleAccessId=service-372042583890@gcf-a dmin-robot.iam.gserviceaccount.com&Expires=1708940389&Signature=WwYbBXHMpzn%2B5alLVKmmJ8MeoiQgSUJIZWHWvWE2ZLuUHaVDgHlm7vtb7sT9pZ2%2BKL72Ukyp11to5dKkWBLDdPqTdk Lifw0f0u9qBqaoXvmUTdLMTwqG4HafE70rKMvoEmhuaXeOVicVwFg7CZ%2F28XpEfEi4cW5tod4UxjAUoDqUWQ6l%2FoR9Y1Ax0LErWZKoIPMDGtxfDcTeOnQJG5gFnSowkuqXzeAfosuOdWe8AySUf%2Fli%2 F0Zs0EDZV3lAjxQUxhbjpiGOaxjx3ub0kNRNhKkdqUMTZWxFFPFHcCsg2%2B7ABom9%2BEn7Z4jazitDehhLlMS0F5SLtBYqG%2BGbywYRjQ%3D%3D"},"resourceLocation":{"currentLocations":[" us-central1"]}} 2024-02-26T09:09:49.969070Z I undefined: {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{},"authenticationInfo":{},"serviceName":"cloudfu nctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.GenerateUploadUrl","resourceName":"projects/revival-academy/locations/us -central1"} 2024-02-26T10:24:16.848004Z I undefined: {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":"Mishack.templeton@ gmail.com","principalSubject":"user:Mishack.templeton@gmail.com"},"requestMetadata":{"callerIp":"41.116.70.216","callerSuppliedUserAgent":"FirebaseCLI/13.3.1, gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2024-02-26T10:24:17.401683Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis .com","methodName":"google.cloud.functions.v1.CloudFunctionsService.GenerateUploadUrl","authorizationInfo":[{"resource":"projects/revival-academy/locations/us -central1","permission":"cloudfunctions.functions.sourceCodeSet","granted":true,"resourceAttributes":{},"permissionType":"ADMIN_WRITE"}],"resourceName":"proje cts/revival-academy/locations/us-central1","request":{"parent":"projects/revival-academy/locations/us-central1","@type":"type.googleapis.com/google.cloud.func tions.v1.GenerateUploadUrlRequest"},"response":{"@type":"type.googleapis.com/google.cloud.functions.v1.GenerateUploadUrlResponse","uploadUrl":"https://storage .googleapis.com/uploads-912355258456.us-central1.cloudfunctions.appspot.com/ef7bec94-6892-45e1-9eec-94117d87c6d5.zip?GoogleAccessId=service-372042583890@gcf-a dmin-robot.iam.gserviceaccount.com&Expires=1708944857&Signature=EVnYh7DbBzLp4lVFp%2BDMFeTT7LZhpEPyrWRxIjAfWNmlpCD4yuF9rDvqbVnMHcu0PRAlYi0Vq2UDKA%2F6IAOQpOXKxS hCP3EN53v6fbgUK9WpsBqW1h8L12wGHmYltubugp5p5xogpj4FzF3F254UsocwyirqhkJekgauD27aqNd5k5dIUsfVEf3K080la1IbfPGdaVg2KIskmDl%2FcixKJ7ejZJOWjbOpQ5KmX%2FDcYdJLAXCrwTdZ CorjCe%2FIS%2FPwXPomvogWX83JeQXSqgcX1MYxtwmZB7MPoiWvAfg2P6xPmVqSsqF7%2BYbmVjs3vmsSYoY00tfoS5Mawl3EBJJSFg%3D%3D"},"resourceLocation":{"currentLocations":["us-c entral1"]}} 2024-02-26T10:24:17.339854Z I undefined: {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{},"authenticationInfo":{},"serviceName":"cloudfu nctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.GenerateUploadUrl","resourceName":"projects/revival-academy/locations/us -central1"} 2024-02-26T10:49:45.922920Z I undefined: {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":"Mishack.templeton@ gmail.com","principalSubject":"user:Mishack.templeton@gmail.com"},"requestMetadata":{"callerIp":"41.116.70.216","callerSuppliedUserAgent":"FirebaseCLI/13.3.1, gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2024-02-26T10:49:46.453098Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis .com","methodName":"google.cloud.functions.v1.CloudFunctionsService.GenerateUploadUrl","authorizationInfo":[{"resource":"projects/revival-academy/locations/us -central1","permission":"cloudfunctions.functions.sourceCodeSet","granted":true,"resourceAttributes":{},"permissionType":"ADMIN_WRITE"}],"resourceName":"proje cts/revival-academy/locations/us-central1","request":{"parent":"projects/revival-academy/locations/us-central1","@type":"type.googleapis.com/google.cloud.func tions.v1.GenerateUploadUrlRequest"},"response":{"@type":"type.googleapis.com/google.cloud.functions.v1.GenerateUploadUrlResponse","uploadUrl":"https://storage .googleapis.com/uploads-912355258456.us-central1.cloudfunctions.appspot.com/34727eaa-ef53-47e6-874b-43d816936e61.zip?GoogleAccessId=service-372042583890@gcf-a dmin-robot.iam.gserviceaccount.com&Expires=1708946386&Signature=rQvCv9G58vFhTe86pRX%2B0kMS9RlzyuZtkBmPYcFwxIiNfndaLvaI7WknqKHYJ57oqHop%2BOxE%2Fs1OmYdK8PrReJIz YMG7jXtbrvSFZvPAu8ctMP7ekH8o1nrC5eLknnx8hLVEFZfbAOuoLH0%2FJgleqgMymTkRpa%2BXuzARqzns%2BZvEXHdMiurhxKoBZ7XnGA2hJx%2BNRfYgxBElVH7xiBE0T2%2Fp5VFdsJmnNgugo%2BkHn0 nJ%2FZUpWUuTHePoF3UNQc6pT01caA1MT3n189%2FybDkXU8IydrDTM0oZIquckcJkvi5bRI7iwieK2MM4L5YxBBNH8j%2FZznZl3vd715pCdjmVJg%3D%3D"},"resourceLocation":{"currentLocatio ns":["us-central1"]}} 2024-02-26T10:49:46.393437Z I undefined: {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{},"authenticationInfo":{},"serviceName":"cloudfu nctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.GenerateUploadUrl","resourceName":"projects/revival-academy/locations/us -central1"}