Error: Problem preparing functions directory for upload.
Version info
3.12.0
Steps to reproduce
firebase deploy --only functions:dash
Expected behavior
Deploy my fns to firebase.
Actual behavior
[2017-09-19T15:05:15.272Z] ---------------------------------------------------------------------- [2017-09-19T15:05:15.277Z] Command: /Users/tyler/.nvm/versions/node/v6.11.2/bin/node /Users/tyler/.nvm/versions/node/v6.11.2/bin/firebase deploy --debug --only functions:dash [2017-09-19T15:05:15.277Z] CLI Version: 3.12.0 [2017-09-19T15:05:15.278Z] Platform: darwin [2017-09-19T15:05:15.278Z] Node Version: v6.11.2 [2017-09-19T15:05:15.278Z] Time: Tue Sep 19 2017 11:05:15 GMT-0400 (EDT) [2017-09-19T15:05:15.279Z] ----------------------------------------------------------------------
[2017-09-19T15:05:15.293Z] > 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"] [2017-09-19T15:05:15.293Z] > authorizing via signed-in user [2017-09-19T15:05:15.295Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/rabble-dev Tue Sep 19 2017 11:05:15 GMT-0400 (EDT) [2017-09-19T15:05:15.705Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 19 Sep 2017 15:05:15 GMT, content-type=application/json; charset=utf-8, content-length=105, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store [2017-09-19T15:05:15.707Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/rabble-dev/tokens Tue Sep 19 2017 11:05:15 GMT-0400 (EDT) [2017-09-19T15:05:16.226Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 19 Sep 2017 15:05:16 GMT, content-type=application/json; charset=utf-8, content-length=258, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
=== Deploying to 'rabble-dev'...
i deploying functions [2017-09-19T15:05:16.816Z] > [functions] package.json contents: { "name": "functions", "description": "Cloud Functions for Firebase", "dependencies": { "@google-cloud/storage": "^0.4.0", "@google-cloud/vision": "^0.5.0", "child-process-promise": "^2.2.0", "cors": "^2.8.4", "firebase-admin": "^5.1.0", "firebase-functions": "^0.6.2", "moment": "^2.18.1", "request": "^2.81.0", "request-promise": "^4.2.0", "request-promise-native": "^1.0.4", "sendinblue-api": "^1.0.8" }, "private": true, "scripts": { "deploy": " cd ../ && firebase deploy --only functions" }, "devDependencies": { "chai": "^4.1.2", "chai-as-promised": "^7.1.1", "mocha": "^3.5.3", "sinon": "^3.2.1" } } i functions: ensuring necessary APIs are enabled... i runtimeconfig: ensuring necessary APIs are enabled... [2017-09-19T15:05:16.818Z] >>> HTTP REQUEST GET https://servicemanagement.googleapis.com/v1/services/cloudfunctions.googleapis.com/projectSettings/rabble-dev?view=CONSUMER_VIEW Tue Sep 19 2017 11:05:16 GMT-0400 (EDT) [2017-09-19T15:05:16.819Z] >>> HTTP REQUEST GET https://servicemanagement.googleapis.com/v1/services/runtimeconfig.googleapis.com/projectSettings/rabble-dev?view=CONSUMER_VIEW Tue Sep 19 2017 11:05:16 GMT-0400 (EDT) [2017-09-19T15:05:17.454Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 19 Sep 2017 15:05:17 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="39,38,37,35", accept-ranges=none, connection=close ✔ runtimeconfig: all necessary APIs are enabled [2017-09-19T15:05:17.463Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 19 Sep 2017 15:05:17 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="39,38,37,35", accept-ranges=none, connection=close ✔ functions: all necessary APIs are enabled [2017-09-19T15:05:17.465Z] >>> HTTP REQUEST GET https://appengine.googleapis.com/v1/apps/rabble-dev Tue Sep 19 2017 11:05:17 GMT-0400 (EDT) [2017-09-19T15:05:17.466Z] >>> HTTP REQUEST GET https://apikeys.googleapis.com/v1/projects/rabble-dev/apiKeys Tue Sep 19 2017 11:05:17 GMT-0400 (EDT) [2017-09-19T15:05:17.616Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 19 Sep 2017 15:05:17 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="39,38,37,35", accept-ranges=none, connection=close [2017-09-19T15:05:17.779Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Tue, 19 Sep 2017 15:05:17 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="39,38,37,35", accept-ranges=none, connection=close i functions: preparing functions directory for uploading...
Error: Problem preparing functions directory for upload.
I'm not able to reproduce this myself, so it's probably something with your machine or set up. Here are a couple of ideas:
- firebase-tools failed to write to your temp directory because of permissions (you might be able to run the command again with "sudo", or change the permissions of the temp directory)
- The folder name of your functions source code is different from the default ("functions") or what's defined in firebase.json.
Your report also made me realize that we currently do not log the actual error, which makes this hard to debug. I created https://github.com/firebase/firebase-tools/pull/463 to fix that. So you can also try checking out that commit, running "npm link" to globally link any firebase commands to your local copy of firebase-tools, and then running the command again to get more verbose logs.
I felt it was something on my local machine as well. I deploy functions quite often and this was the first time I encountered this Error. Glad this uncovered the lack of further debug info, cause it had me stumped. Removing the local dir and re-cloning the repo worked the bug out, even though that might be overkill. If it happens again, I'll come back to this or look into #463
Thanks for the update!
I am seeing this today. Except after i functions: preparing functions directory for uploading...
it returns to the command prompt. instead of Error: Problem preparing functions directory for upload. like @rtmalone mention.
afterwards, the exit status is zero. there are no logs created.
--debug reveals no extra information
I also had to reclone my repository to be able to deploy the function.
I went to the original repository directory and ran
rsync -R `git ls-files --others --exclude-standard` ~/Desktop/Backup
to move all my untracked files and then git clean -df and I could deploy again. not sure what the issue was, but I did download a backup of some firebase collections earlier.. also tried to run the firebase emulator with the import command pointed at the back up, which didn't actually load the data. I already deleted the backup directory though, so I am not sure if the back up was the issue or the emulator. I have had issues with rouge emulator changes in the past but I cannot recall what they were.
I should also say that I am not actually using firebase-tools, just
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0",
@RichardJohnn can you open a new bug please (this one is 5 years old, is pretty generic, and we'll need more information prompted by the template). Thanks.
we are having this issue also. Recloning the repo unfortunately did not help.
"firebase-functions": "^3.23.0",
Running npm install -g firebase-tools fixed for me. Bumped from 11.8.1 to 11.9.0 and all working again. I was half way through creating the issue report when fixed.
I ran into this recently on Linux where the CLI would just exit after the "preparing functions directory for upload".
My issue ended up being that my computer was low on temp directory space. Maybe the CLI doesn't handle the case well. Anyway, leaving this note here since google brought me to this thread.