firebase / firebase/firebase-tools
"Error: Could not read source directory" can mask network errors
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
When I run a lot of firebase deploys (functions) in a short period of time, I get the error message "Error: Could not read source directory. Remove links and shortcuts and try again". But it seems that this is not because source directory but because Google checks unusual traffic. I get an HTML page response, but I can't deal with it because I am accessing it through the CLI from a server. I would like to know if there is a way to avoid this.
### [REQUIRED] Environment info
**firebase-tools:**
9.0.1
**Platform:** Ubuntu
(20.04.1 LTS)
### [REQUIRED] Test case
none
### [REQUIRED] Steps to reproduce
Run firebase deploy many times in a short period of time
### [REQUIRED] Expected behavior
I expect deploy finish without error or get proper error message.
### [REQUIRED] Actual behavior
```
=== Deploying to ''...
i deploying functions
[2020-12-21T03:01:36.059Z] > [functions] package.json contents: {
...
}
[2020-12-21T03:01:36.493Z] getFunctionsSDKVersion was unable to retrieve 'firebase-functions' version
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
[2020-12-21T03:01:36.495Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects//services/cloudfunctions.googleapis.com
[2020-12-21T03:01:36.496Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects//services/runtimeconfig.googleapis.com
[2020-12-21T03:01:36.496Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects//services/cloudbuild.googleapis.com
[2020-12-21T03:01:36.828Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 21 Dec 2020 03:01:36 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","accept-ranges":"none","transfer-encoding":"chunked"}
✔ functions: required API cloudbuild.googleapis.com is enabled
[2020-12-21T03:01:37.415Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 21 Dec 2020 03:01:37 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","accept-ranges":"none","transfer-encoding":"chunked"}
✔ functions: required API cloudfunctions.googleapis.com is enabled
[2020-12-21T03:01:37.430Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 21 Dec 2020 03:01:37 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-12-21T03:01:37.431Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects//adminSdkConfig
[2020-12-21T03:01:37.914Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 21 Dec 2020 03:01:37 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","accept-ranges":"none","transfer-encoding":"chunked"}
i functions: preparing ./packages/functions/build directory for uploading...
[2020-12-21T03:01:37.917Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects//configs
[2020-12-21T03:01:38.789Z] <<< HTTP RESPONSE 429 {"date":"Mon, 21 Dec 2020 03:01:38 GMT","pragma":"no-cache","expires":"Fri, 01 Jan 1990 00:00:00 GMT","cache-control":"no-store, no-cache, must-revalidate","content-type":"text/html","server":"HTTP server (unknown)","content-length":"2919","x-xss-protection":"0"}
[2020-12-21T03:01:38.789Z] <<< HTTP RESPONSE BODY
https://runtimeconfig.googleapis.com/v1beta1/projects/<PROJECT_ID>/configs
To continue, please type the characters below:
About this page
Our systems have detected unusual traffic from your computer network. This page checks to see if it's really you sending the requests, and not a robot. Why did this happen?
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the Terms of Service. The block will expire shortly after those requests stop. In the meantime, solving the above CAPTCHA will let you continue to use our services.
This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests. If you share your network connection, ask your administrator for help — a different computer using the same IP address may be responsible. Learn more
Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known to use, or sending requests very quickly.
IP address: xx.xx.xx.xx
Time: 2020-12-21T03:01:38Z
URL: https://runtimeconfig.googleapis.com/v1beta1/projects//configs
[2020-12-21T03:01:38.791Z] FirebaseError: HTTP Error: 429, Unknown Error
[2020-12-21T03:01:40.223Z] Error: input source must be valid Stream or Buffer instance
at Archiver.append (/node_modules/archiver/lib/core.js:575:24)
at /node_modules/firebase-tools/lib/prepareFunctionsUpload.js:63:17
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async deploy (/node_modules/firebase-tools/lib/deploy/functions/deploy.js:25:24)
Error: Could not read source directory. Remove links and shortcuts and try again.
```
Contributor guide
Assessment
This issue has not been assessed yet.