Error deploying firebase security rules - firebase

I am trying to deploy this:
firestore.rules file:
service cloud.firestore {
match /databases/{database}/documents {
match /documents/{document} {
// must be authenticated to view or create doc
allow create, read: if request.auth != null;
// must be your own doc to update
allow update, delete: if request.auth.uid == resource.data.uid;
}
}
}
with firebase deploy --only firestore:rules
but I am getting an ungooglable error.
Here is my firebase-debug.log:
[debug] [2018-02-25T14:55:55.801Z] ----------------------------------------------------------------------
[debug] [2018-02-25T14:55:55.803Z] Command: /Users/swyx/.nvm/versions/node/v8.5.0/bin/node /Users/swyx/.nvm/versions/node/v8.5.0/bin/firebase deploy --only firestore:rules
[debug] [2018-02-25T14:55:55.803Z] CLI Version: 3.14.0
[debug] [2018-02-25T14:55:55.804Z] Platform: darwin
[debug] [2018-02-25T14:55:55.804Z] Node Version: v8.5.0
[debug] [2018-02-25T14:55:55.804Z] Time: Sun Feb 25 2018 09:55:55 GMT-0500 (EST)
[debug] [2018-02-25T14:55:55.804Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-02-25T14:55:55.818Z] > 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"]
[debug] [2018-02-25T14:55:55.818Z] > authorizing via signed-in user
[debug] [2018-02-25T14:55:55.819Z] > 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"]
[debug] [2018-02-25T14:55:55.820Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '1/redacted',
client_id: '563584335869-redacted.apps.googleusercontent.com',
client_secret: 'redacted',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Sun Feb 25 2018 09:55:55 GMT-0500 (EST)
[debug] [2018-02-25T14:55:55.935Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:55:55.943Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/testfirepup1
Sun Feb 25 2018 09:55:55 GMT-0500 (EST)
[debug] [2018-02-25T14:55:56.224Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:55:56.225Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/testfirepup1/tokens
Sun Feb 25 2018 09:55:56 GMT-0500 (EST)
[debug] [2018-02-25T14:55:56.699Z] <<< HTTP RESPONSE 200
[info] 1
[info]
[info] === Deploying to 'testfirepup1'...
[info]
[info] i deploying firestore
[info] i firestore: checking firestore.rules for compilation errors...
[debug] [2018-02-25T14:55:56.917Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1:test { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:55:56 GMT-0500 (EST)
[debug] [2018-02-25T14:55:57.103Z] <<< HTTP RESPONSE 200
[info] ✔ firestore: rules file firestore.rules compiled successfully
[info] i firestore: uploading rules firestore.rules...
[debug] [2018-02-25T14:55:57.105Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1/rulesets { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:55:57 GMT-0500 (EST)
[debug] [2018-02-25T14:55:57.416Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:55:57.416Z] [rules] created ruleset projects/testfirepup1/rulesets/6e8dfacc-8c69-4fd6-95b4-a28593bdb8c1
[debug] [2018-02-25T14:55:57.417Z] [rules] releasing cloud.firestore with ruleset projects/testfirepup1/rulesets/6e8dfacc-8c69-4fd6-95b4-a28593bdb8c1
[debug] [2018-02-25T14:55:57.417Z] >>> HTTP REQUEST PUT https://firebaserules.googleapis.com/v1/projects/testfirepup1/releases/cloud.firestore { name: 'projects/testfirepup1/releases/cloud.firestore',
rulesetName: 'projects/testfirepup1/rulesets/6e8dfacc-8c69-4fd6-95b4-a28593bdb8c1' }
Sun Feb 25 2018 09:55:57 GMT-0500 (EST)
[debug] [2018-02-25T14:55:57.525Z] <<< HTTP RESPONSE 404
[debug] [2018-02-25T14:55:57.526Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
[debug] [2018-02-25T14:55:57.527Z] TypeError: Cannot create property 'error' on string '<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
'
at module.exports (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/responseToError.js:11:16)
at Request._callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/api.js:43:25)
at Request.self.callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
[error]
[error] Error: An unexpected error has occurred.
[debug] [2018-02-25T14:56:50.487Z] ----------------------------------------------------------------------
[debug] [2018-02-25T14:56:50.489Z] Command: /Users/swyx/.nvm/versions/node/v8.5.0/bin/node /Users/swyx/.nvm/versions/node/v8.5.0/bin/firebase deploy --only firestore:rules
[debug] [2018-02-25T14:56:50.490Z] CLI Version: 3.14.0
[debug] [2018-02-25T14:56:50.490Z] Platform: darwin
[debug] [2018-02-25T14:56:50.490Z] Node Version: v8.5.0
[debug] [2018-02-25T14:56:50.491Z] Time: Sun Feb 25 2018 09:56:50 GMT-0500 (EST)
[debug] [2018-02-25T14:56:50.491Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-02-25T14:56:50.505Z] > 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"]
[debug] [2018-02-25T14:56:50.505Z] > authorizing via signed-in user
[debug] [2018-02-25T14:56:50.507Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/testfirepup1
Sun Feb 25 2018 09:56:50 GMT-0500 (EST)
[debug] [2018-02-25T14:56:51.081Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:56:51.082Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/testfirepup1/tokens
Sun Feb 25 2018 09:56:51 GMT-0500 (EST)
[debug] [2018-02-25T14:56:51.586Z] <<< HTTP RESPONSE 200
[info] 1
[info]
[info] === Deploying to 'testfirepup1'...
[info]
[info] i deploying firestore
[info] i firestore: checking firestore.rules for compilation errors...
[debug] [2018-02-25T14:56:51.847Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1:test { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:56:51 GMT-0500 (EST)
[debug] [2018-02-25T14:56:52.036Z] <<< HTTP RESPONSE 200
[info] ✔ firestore: rules file firestore.rules compiled successfully
[info] i firestore: uploading rules firestore.rules...
[debug] [2018-02-25T14:56:52.038Z] >>> HTTP REQUEST POST https://firebaserules.googleapis.com/v1/projects/testfirepup1/rulesets { source: { files: [ [Object] ] } }
Sun Feb 25 2018 09:56:52 GMT-0500 (EST)
[debug] [2018-02-25T14:56:52.331Z] <<< HTTP RESPONSE 200
[debug] [2018-02-25T14:56:52.331Z] [rules] created ruleset projects/testfirepup1/rulesets/e1d12cdc-2551-42eb-957a-25e7a9aa7bca
[debug] [2018-02-25T14:56:52.332Z] [rules] releasing cloud.firestore with ruleset projects/testfirepup1/rulesets/e1d12cdc-2551-42eb-957a-25e7a9aa7bca
[debug] [2018-02-25T14:56:52.332Z] >>> HTTP REQUEST PUT https://firebaserules.googleapis.com/v1/projects/testfirepup1/releases/cloud.firestore { name: 'projects/testfirepup1/releases/cloud.firestore',
rulesetName: 'projects/testfirepup1/rulesets/e1d12cdc-2551-42eb-957a-25e7a9aa7bca' }
Sun Feb 25 2018 09:56:52 GMT-0500 (EST)
[debug] [2018-02-25T14:56:52.444Z] <<< HTTP RESPONSE 404
[debug] [2018-02-25T14:56:52.444Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
[debug] [2018-02-25T14:56:52.446Z] TypeError: Cannot create property 'error' on string '<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1/projects/testfirepup1/releases/cloud.firestore</code> was not found on this server. <ins>That’s all we know.</ins>
'
at module.exports (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/responseToError.js:11:16)
at Request._callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/lib/api.js:43:25)
at Request.self.callback (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/Users/swyx/.nvm/versions/node/v8.5.0/lib/node_modules/firebase-tools/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:314:30)
[error]
[error] Error: An unexpected error has occurred.
I can't tell what's wrong so I have no idea what to fix. Please help!

The OP indicated in a comment that the failure was the result was not having the latest version of the Firebase CLI. To see the installed version number, use firebase -V.
Because features are continuously being added in new versions of the Firebase CLI, the documentation recommends frequently updating to ensure you have the latest version:
In many cases, new features and bug fixes are available only with the
latest version of the Firebase CLI and the firebase-functions SDK.
It's a good practice to frequently update both the Firebase CLI and
the SDK with these commands inside the functions folder of your
Firebase project:
npm install firebase-functions#latest firebase-admin#latest --save
npm install -g firebase-tools
For reference, the Firebase CLI is open-source and is available here.

It was solved by updating the firebase-tools version. breaking change from 3.14 to 3.17 :( Thank you very much #bob snyder.

Related

Empty S3 remote log files in Airflow 2.3.2

I configured remote S3 logging with the following variables:
- name: AIRFLOW__LOGGING__REMOTE_LOGGING
value: 'True'
- name: AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER
value: 's3://my-airflow/airflow/logs'
- name: AIRFLOW__LOGGING__REMOTE_LOG_CONN_ID
value: 'my_s3'
- name: AIRFLOW__LOGGING__LOGGING_LEVEL
value: 'ERROR'
- name: AIRFLOW__LOGGING__ENCRYPT_S3_LOGS
value: 'False'
So far the log files are created with the DAG and task path with the name attempt=1.log or similar but always with 0 bytes size (empty). When I try to see the logs from Airflow I get this message (I'm using the KubernetesExecutor):
*** Falling back to local log
*** Trying to get logs (last 100 lines) from worker pod ***
*** Unable to fetch logs from worker pod ***
(400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Audit-Id': 'f3e0dd67-c8f4-42fc-945f-95dc42e8c2b5', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Mon, 01 Aug 2022 13:07:07 GMT', 'Content-Length': '136'})
HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"name must be provided","reason":"BadRequest","code":400}\n'
Why are my logs files empty?

How to Perform Large Deletes in the Firebase Realtime Database

I am using Firebase realtime database. I want to delete a node which has huge records. So i can not delete with normal ways. When i try to delete with using rest, i can not do that. Default setting is "large". I have to set defaultWriteSizeLimit to "unlimited".
$firebase database:settings:set defaultWriteSizeLimit unlimited --instance <dbname>
When i execute above code, i receive an error message.
"Error: Unexpected error fetching configs at defaultWriteSizeLimit"
Below is firebase-debug.log:
[debug] [2020-12-09T09:24:13.317Z] ----------------------------------------------------------------------
[debug] [2020-12-09T09:24:13.318Z] Command: /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js /Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase database:settings:set defaultWriteSizeLimit unlimited --instance dbname
[debug] [2020-12-09T09:24:13.318Z] CLI Version: 8.17.0
[debug] [2020-12-09T09:24:13.318Z] Platform: darwin
[debug] [2020-12-09T09:24:13.318Z] Node Version: v12.18.1
[debug] [2020-12-09T09:24:13.319Z] Time: Wed Dec 09 2020 12:24:13 GMT+0300 (GMT+03:00)
[debug] [2020-12-09T09:24:13.319Z] ----------------------------------------------------------------------
[debug] [2020-12-09T09:24:13.319Z]
[debug] [2020-12-09T09:24:13.322Z] > 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"]
[debug] [2020-12-09T09:24:13.323Z] > authorizing via signed-in user
[debug] [2020-12-09T09:24:13.324Z] [iam] checking project dbname for permissions ["firebase.projects.get","firebasedatabase.instances.update"]
[debug] [2020-12-09T09:24:13.325Z] > 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"]
[debug] [2020-12-09T09:24:13.325Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-09T09:24:13.668Z] <<< HTTP RESPONSE 200 {"date":"Wed, 09 Dec 2020 09:24:14 GMT","expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:13.682Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/dbname:testIamPermissions
{"permissions":["firebase.projects.get","firebasedatabase.instances.update"]}
[debug] [2020-12-09T09:24:14.782Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 09 Dec 2020 09:24:15 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=768","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:14.783Z] >>> HTTP REQUEST GET https://firebasedatabase.googleapis.com/v1beta/projects/dbname/locations/-/instances/dbname
[debug] [2020-12-09T09:24:15.499Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 09 Dec 2020 09:24:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:15.501Z] > refreshing access token with scopes: []
[debug] [2020-12-09T09:24:15.501Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-09T09:24:15.766Z] <<< HTTP RESPONSE 200 {"date":"Wed, 09 Dec 2020 09:24:16 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:15.780Z] >>> [apiv2][query] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json [none]
[debug] [2020-12-09T09:24:15.780Z] >>> [apiv2][body] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json "unlimited"
[debug] [2020-12-09T09:24:16.568Z] <<< [apiv2][status] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json 400
[debug] [2020-12-09T09:24:16.568Z] <<< [apiv2][body] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json {"error":"defaultWriteSizeLimit should be one of {\"large\", \"medium\", \"small\", \"unlimited\"}"}
[debug] [2020-12-09T09:24:16.907Z] FirebaseError: HTTP Error: 400, defaultWriteSizeLimit should be one of {"large", "medium", "small", "unlimited"}
at module.exports (/Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/responseToError.js:38:12)
at Client.<anonymous> (/Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:191:27)
at Generator.next (<anonymous>)
at fulfilled (/Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error]
[error] Error: Unexpected error fetching configs at defaultWriteSizeLimit
I was able to fix this problem for myself by patching firebase-tools: in database/settings.js I replaced line 23 with return JSON.stringify(input) and updated the setting successfully.
This has also been reported to Firebase Tools Issues on Github and fixed and merged today in this Pull Request
I assume we can expect a version bump on firebase-tools and then running
firebase database:settings:set defaultWriteSizeLimit unlimited
should work after updating to the latest version.

how can I add firebase to pwa project

I am new in pwa.I want to use firebase on my project. I use these commands to init firebase :
npm install -g firebase-tools
firebase login
firebase init
but firebase init not show my projects!!
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
and this is firebase-debug-log file
You're about to initialize a Firebase project in this directory:
E:\pwa\pwagram
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] [2020-04-10T07:10:34.248Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?pageSize=100
[debug] [2020-04-10T07:10:34.840Z] <<< HTTP RESPONSE 403 {"content-type":"text/html; charset=UTF-8","referrer-policy":"no-referrer","content-length":"1595","date":"Fri, 10 Apr 2020 07:10:34 GMT","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,h3-T050=\":443\"; ma=2592000"}
[debug] [2020-04-10T07:10:34.840Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 403 (Forbidden)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}#media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}#media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}#media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>403.</b> <ins>That’s an error.</ins>
<p>Your client does not have permission to get URL <code>/v1beta1/projects</code> from this server. <ins>That’s all we know.</ins>
[debug] [2020-04-10T07:10:34.841Z] HTTP Error: 403, Unknown Error
[debug] [2020-04-10T07:10:35.437Z] FirebaseError: HTTP Error: 403, Unknown Error
at module.exports (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:38:12)
at Request._callback (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:40:35)
at Request.self.callback (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:185:22)
at Request.emit (events.js:310:20)
at Request.EventEmitter.emit (domain.js:482:12)
at Request.<anonymous> (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1154:10)
at Request.emit (events.js:310:20)
at Request.EventEmitter.emit (domain.js:482:12)
at IncomingMessage.<anonymous> (C:\Users\PZHR.DESKTOP-9L7JS1Q\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1076:12)
at Object.onceWrapper (events.js:416:28)
at IncomingMessage.emit (events.js:322:22)
at IncomingMessage.EventEmitter.emit (domain.js:482:12)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.
whats wrong with me?
First you need to create a firebase project at https://console.firebase.google.com/
then you will get credentials for that app
then install npm package for firebase -
npm i firebase
then use below lines to initialise firebase in your app
import * as firebase from 'firebase';
const config = {
apiKey: "ENTER YOURS HERE",
authDomain: "ENTER YOURS HERE",
databaseURL: "ENTER YOURS HERE",
projectId: "ENTER YOURS HERE",
storageBucket: "ENTER YOURS HERE",
messagingSenderId: "ENTER YOURS HERE"
}
firebase.initializeApp(config);
you need not to add global configuration for firebase or any cli commands;
for more just follow - https://firebase.google.com/docs/web/setup

Http post request to Google Script resulting in 411 error length required

I am using AT Command (similar to C or C++) to send a post request to Google Script where it saves the data. I get the error saying 411 error.
This is the code sent:
AT+CHTTPACT="script.google.com",80
//Wait for the +CHTTPACT: REQUEST from the module
WAIT=1
POST script.google.com HTTP/1.1<cr><lf>
Host: script.google.com/macros/s/AKfycbwALy3GCY_r5fNOzxzut_RnbDR01Caq83MmsLPRuxoE5EQ7mUE/exec\r\nContent-Length: 0\r\nContent-Type: json/application<cr><lf>
<cr><lf>^z<cr><lf>
and this is the error:
+CHTTPACT: DATA,1408
http/1.0 411 length required
content-type: text/html; charset=utf-8
referrer-policy: no-referrer
content-length: 1564
date: wed, 06 mar 2019 12:36:35 gmt
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 411 (Length Required)!!1</title>
<style>
_150x54dp.png) no-repeat
+CHTTPACT: DATA,317
;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>411.</b> <ins>That’s an error.</ins>
<p>POST requests require a <code>Content-length</code> header. <ins>That’s all we know.</ins>
+CHTTPACT: 0
I got it working with my own Node JS server but I need it to work with json body so it works with Google and other cloud servers:
AT+CHTTPACT="59.102.xx.xxx",3000
//Wait for the +CHTTPACT: REQUEST from the module
WAIT=1
POST http://59.102.xx.xxx HTTP/1.1<cr><lf>
Host: http://59.102.xx.xxx:3000<cr><lf>
Content-Type: text/html<cr><lf>
<cr><lf>^z<cr><lf>

Firebase checking deployed files

When I run firebase deploy command, I would like to know which files are deployed.
I tried firebase deploy --debug, but I don't see any information about uploaded files.
[2018-05-25T09:48:26.423Z] ----------------------------------------------------------------------
[2018-05-25T09:48:26.426Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --debug
[2018-05-25T09:48:26.427Z] CLI Version: 3.18.4
[2018-05-25T09:48:26.427Z] Platform: darwin
[2018-05-25T09:48:26.427Z] Node Version: v9.2.0
[2018-05-25T09:48:26.428Z] Time: Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:26.428Z] ----------------------------------------------------------------------
[2018-05-25T09:48:26.439Z] > 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"]
[2018-05-25T09:48:26.440Z] > authorizing via signed-in user
[2018-05-25T09:48:26.441Z] > 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"]
[2018-05-25T09:48:26.442Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
{ refresh_token: '1/sNSNg7xxbzwVujBEzRAQ2eZHkEuT0d6A2jVVUGa-e9Jgrc8NASizU4RK7MEmNnov',
client_id: '563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com',
client_secret: 'j9iVZfS8kkCEFUPaAeJV0sAi',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:26.585Z] <<< HTTP RESPONSE 200 cache-control=no-cache, no-store, max-age=0, must-revalidate, pragma=no-cache, expires=Mon, 01 Jan 1990 00:00:00 GMT, date=Fri, 25 May 2018 09:48:26 GMT, vary=X-Origin, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, x-content-type-options=nosniff, x-frame-options=SAMEORIGIN, x-xss-protection=1; mode=block, server=GSE, alt-svc=hq=":443"; ma=2592000; quic=51303433; quic=51303432; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close
[2018-05-25T09:48:26.593Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/test-table
Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:27.222Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:27 GMT, content-type=application/json; charset=utf-8, content-length=141, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-05-25T09:48:27.223Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/test-table/tokens
Fri May 25 2018 11:48:27 GMT+0200 (CEST)
[2018-05-25T09:48:27.777Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:27 GMT, content-type=application/json; charset=utf-8, content-length=274, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
=== Deploying to 'test-table'...
i deploying hosting
i hosting: preparing dist directory for upload...
[2018-05-25T09:48:28.900Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/test-table/uploads/-LDLglCdzpfzQK77Fbrb?fileCount=2&message=
Fri May 25 2018 11:48:28 GMT+0200 (CEST)
Uploading: [ ] 0%[2018-05-25T09:48:32.752Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:32 GMT, content-type=application/json; charset=utf-8, content-length=49, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
[2018-05-25T09:48:32.753Z] [hosting] .tgz uploaded successfully, waiting for extraction
✔ hosting: 2 files uploaded successfully
[2018-05-25T09:48:33.642Z] [hosting] deploy completed after 5190ms
[2018-05-25T09:48:33.643Z] >>> HTTP REQUEST POST https://deploy.firebase.com/v1/projects/test-table/releases
{ hosting:
{ public: 'dist',
ignore: [ 'firebase.json', '**/.*', '**/node_modules/**' ],
version: '-LDLglCdzpfzQK77Fbrb',
prefix: '-LDLglCdzpfzQK77Fbrb/',
manifest: [] } }
Fri May 25 2018 11:48:33 GMT+0200 (CEST)
[2018-05-25T09:48:34.951Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:34 GMT, content-type=application/json; charset=utf-8, content-length=34, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
✔ Deploy complete!
The only information the Firebase CLI shows is:
i hosting: preparing dist directory for upload...
So this means that everything in your dist directory is deployed, and nothing else.
Since the files are uploaded as a single .tgz file, there is no progress report for individual files.

Resources