Firebase-tools: ์„ค์ •:์›น INVALID_ARGUMENT ์ƒํƒœ ์ฝ”๋“œ 400

์— ๋งŒ๋“  2018๋…„ 11์›” 15์ผ  ยท  41์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: firebase/firebase-tools

๋ฒ„์ „ ์ •๋ณด: 6.1.0
ํ”Œ๋žซํผ ์ •๋ณด: OSX

์žฌํ˜„ ๋‹จ๊ณ„

CD ๋””๋ ‰ํ† ๋ฆฌ
Firebase ์ดˆ๊ธฐํ™”(ํ˜ธ์ŠคํŒ… ์ „์šฉ)
๊ธฐ์กด ํ”„๋กœ์ ํŠธ ์„ ํƒ
Firebase ์„œ๋น„์Šค --๋งŒ ํ˜ธ์ŠคํŒ… --debug

์‚ฌ์ดํŠธ๋ฅผ ๋กœ์ปฌ์—์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

[2018-11-15T17:12:15.331Z] <<< HTTP ์‘๋‹ต 400 ๋‹ค์–‘ํ•จ=X-Origin, Referer, Origin, Accept-Encoding, content-type=application/json; charset=UTF-8, ๋‚ ์งœ=Thu, 15 Nov 2018 17:12:15 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="44,43,39,35", ํ—ˆ์šฉ ๋ฒ”์œ„=์—†์Œ, ์—ฐ๊ฒฐ=๋‹ซ๊ธฐ
[2018-11-15T17:12:15.331Z] <<< HTTP RESPONSE BODY ์ฝ”๋“œ=400, ๋ฉ”์‹œ์ง€=์š”์ฒญ์— ์ž˜๋ชป๋œ ์ธ์ˆ˜๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค., ์ƒํƒœ=INVALID_ARGUMENT

์˜ค๋ฅ˜: HTTP ์˜ค๋ฅ˜: 400, ์š”์ฒญ์— ์ž˜๋ชป๋œ ์ธ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
[2018-11-15T17:12:15.532Z] ์˜ค๋ฅ˜ ์ปจํ…์ŠคํŠธ: {
"๋ชธ": {
"์˜ค๋ฅ˜": {
"์ฝ”๋“œ": 400,
"message": "์š”์ฒญ์— ์ž˜๋ชป๋œ ์ธ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.",
"์ƒํƒœ": "INVALID_ARGUMENT"
}
},
"์‘๋‹ต": {
"์ƒํƒœ ์ฝ”๋“œ": 400,
"๋ชธ": {
"์˜ค๋ฅ˜": {
"์ฝ”๋“œ": 400,
"message": "์š”์ฒญ์— ์ž˜๋ชป๋œ ์ธ์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.",
"์ƒํƒœ": "INVALID_ARGUMENT"
}
},
"ํ—ค๋”": {
"vary": "X-Origin, Referer, Origin, Accept-Encoding",
"์ฝ˜ํ…์ธ  ์œ ํ˜•": "์‘์šฉ ํ”„๋กœ๊ทธ๋žจ/json; charset=UTF-8",
"๋‚ ์งœ": "2018๋…„ 11์›” 15์ผ ๋ชฉ์š”์ผ 17:12:15 GMT",
"์„œ๋ฒ„": "ESF",
"์บ์‹œ ์ œ์–ด": "๋น„๊ณต๊ฐœ",
"x-xss-๋ณดํ˜ธ": "1; ๋ชจ๋“œ=์ฐจ๋‹จ",
"x-frame-options": "SAMEORIGIN",
"x-content-type-options": "nosniff",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"44,43,39,35\"",
"์ˆ˜๋ฝ ๋ฒ”์œ„": "์—†์Œ",
"์—ฐ๊ฒฐ": "๋‹ซ๊ธฐ"
},
"์š”๊ตฌ": {
"์šฐ๋ฆฌ": {
"ํ”„๋กœํ† ์ฝœ": "https:",
"์Šฌ๋ž˜์‹œ": ์‚ฌ์‹ค,
"์ธ์ฆ": null,
"ํ˜ธ์ŠคํŠธ": "mobilesdk-pa.googleapis.com",
"ํฌํŠธ": 443,
"ํ˜ธ์ŠคํŠธ ์ด๋ฆ„": "mobilesdk-pa.googleapis.com",
"ํ•ด์‹œ": null,
"๊ฒ€์ƒ‰": null,
"์ฟผ๋ฆฌ": null,
"๊ฒฝ๋กœ ์ด๋ฆ„": "/v1/projects/540833485883/clients/_:getWebAppConfig",
"๊ฒฝ๋กœ": "/v1/projects/540833485883/clients/_:getWebAppConfig",
"href": " https://mobilesdk-pa.googleapis.com/v1/projects/540833485883/clients/_ :getWebAppConfig"
},
"๋ฉ”์†Œ๋“œ": "GET"
}
}
}

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

์ด ์‚ฌ์‹ค์„ ์•Œ๋ ค์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ์ด ๋ฌธ์ œ๋ฅผ ์ ๊ทน์ ์œผ๋กœ ์กฐ์‚ฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

(๋‚ด๋ถ€ ์ถ”์  ๋ฒˆํ˜ธ: 119615185)

๋ชจ๋“  41 ๋Œ“๊ธ€

๋™์ผ:

๋ฒ„์ „ ์ •๋ณด: 6.1.0(6.0.0, 5.0.0์—์„œ๋„ ํ…Œ์ŠคํŠธ๋จ)
ํ”Œ๋žซํผ ์ •๋ณด: OSX 10.14 macOS Mojave 18A391

$ firebase serve --only hosting,functions --debug

๊ธฐ์กด ํ”„๋กœ์ ํŠธ์™€ ์ƒˆ ํ”„๋กœ์ ํŠธ๋กœ ํ…Œ์ŠคํŠธํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ฐ™์€ ์˜ค๋ฅ˜์ž…๋‹ˆ๋‹ค.

Error: HTTP Error: 400, Request contains an invalid argument.
[2018-11-15T17:40:46.943Z] Error Context: {
  "body": {
    "error": {
      "code": 400,
      "message": "Request contains an invalid argument.",
      "status": "INVALID_ARGUMENT"
    }
  },
  "response": {
    "statusCode": 400,
    "body": {
      "error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT"
      }
    },
    "headers": {
      "vary": "X-Origin, Referer, Origin,Accept-Encoding",
      "content-type": "application/json; charset=UTF-8",
      "date": "Thu, 15 Nov 2018 17:40:46 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=\"44,43,39,35\"",
      "accept-ranges": "none",
      "connection": "close"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "mobilesdk-pa.googleapis.com",
        "port": 443,
        "hostname": "mobilesdk-pa.googleapis.com",
        "hash": null,
        "search": null,
        "query": null,
        "pathname": "/v1/projects/128559963708/clients/_:getWebAppConfig",
        "path": "/v1/projects/128559963708/clients/_:getWebAppConfig",
        "href": "https://mobilesdk-pa.googleapis.com/v1/projects/128559963708/clients/_:getWebAppConfig"
      },
      "method": "GET"
    }
  }
}

์ •ํ™•ํžˆ ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐฉ๊ธˆ ๋‹ค๋ฅธ ์ปดํ“จํ„ฐ์—์„œ ๋ณ€๊ฒฝ ์—†์ด ๋™์ผํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ํ…Œ์ŠคํŠธํ–ˆ์œผ๋ฉฐ ์•ฝ 3๊ฐœ์›” ๋™์•ˆ ์ž˜ ์‹คํ–‰๋˜๋Š” ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ์—์„œ๋„ ๋ฌธ์ œ๊ฐ€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค. ์ •์ƒ์ ์œผ๋กœ ๋ฐฐํฌ๋˜์ง€๋งŒ localhost(_firebase serve --only functions,hosting --debug_)๋Š” ์ด ์˜ค๋ฅ˜์™€ ํ•จ๊ป˜ ์ž‘๋™์„ ๋ฉˆ์ถฅ๋‹ˆ๋‹ค...
๋ฌธ์ œ๊ฐ€ ์•ฑ(๋‚ด ๊ฒƒ ๋˜๋Š” ๊ท€ํ•˜์˜ ๊ฒƒ)์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
์•ฝ 2์‹œ๊ฐ„ ์ „์—๋Š” ๋ชจ๋“  ๊ฒƒ์ด ์ž˜ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค!

๋‚˜๋ฅผ ์œ„ํ•ด +1

๊ฐ™์€ ๋ฌธ์ œ. ์–ด์ œ ๋ชจ๋“  ๊ฒƒ์ด ์ž˜ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค

[2018-11-15T17:22:20.885Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/xxx/clients/_:getWebAppConfig

[2018-11-15T17:22:21.179Z] <<< HTTP RESPONSE BODY code=400, message=Request contains an invalid argument., status=INVALID_ARGUMENT

์ €์™€ ์นœ๊ตฌ๋ฅผ ์œ„ํ•ด +1 ์–ด์ œ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ–ˆ๋Š”๋ฐ ์˜ค๋Š˜ ์•„์นจ์— ์ž‘๋™์„ ๋ฉˆ์ท„์Šต๋‹ˆ๋‹ค. https://status.firebase.google.com ์—์„œ ์ด์— ๋Œ€ํ•ด ์•„๋ฌด ๊ฒƒ๋„ ๋ณผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. Firebase์—์„œ ๋Œ“๊ธ€์„ ๋‹ฌ ์ˆ˜ ์žˆ๋Š” ์‚ฌ๋žŒ์ด ์žˆ์Šต๋‹ˆ๊นŒ?

๋‚˜๋ฅผ ์œ„ํ•ด +1 - ๋ชจ๋“  ๊ฒƒ์ด ๊ฐ‘์ž๊ธฐ ์ž‘๋™์„ ๋ฉˆ์ท„์Šต๋‹ˆ๋‹ค. 6.0.1์—์„œ 6.1.0์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ์‹œ๋„ํ–ˆ๋Š”๋ฐ ์ด์ œ firebase serve ์—์„œ๋„ ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

 functions: Preparing to emulate functions.
โš   Setup required, please run: firebase setup:emulators:firestore

ํ•ด๋‹น ๋ช…๋ น์„ ์„ฑ๊ณต์ ์œผ๋กœ ์‹คํ–‰ํ•˜๊ณ  firebase serve ๋‹ค์‹œ ์‹คํ–‰ํ•˜๋ ค๊ณ  ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

i  functions: Preparing to emulate functions.
โœ”  firestore: started on http://localhost:8080
โš   firestore: Error: Invalid or corrupt jarfile /home/alex/.cache/firebase/emulators/cloud-firestore-emulator-v1.2.1.jar

๋ฐฉ๊ธˆ ์‹คํ–‰ํ•œ ๋ช…๋ น์„ ์ฐพ์•„๋ณด๋‹ˆ ๋‹ค์Œ ํŽ˜์ด์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. https://firebase.google.com/docs/firestore/security/test-rules-emulator

6.1.0์˜ ๋ฌธ์ œ๋ผ๊ณ  ์ƒ๊ฐํ•˜๊ณ  firebase --open-sesame emulators ์‹คํ–‰ํ•˜๋ ค๊ณ  ์‹œ๋„ํ–ˆ๋Š”๋ฐ ๋‹ค์Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

Error: Did not recognize preview feature

+1 ๊ฐ™์€ ๋ฌธ์ œ, ์˜ค๋Š˜ ์•„์นจ์— ์‹œ์ž‘๋จ

+1. firebase-tools ๋ฒ„์ „ v6.0.1 ๋ฐ v6.1.0๊ณผ ํ•จ๊ป˜ ๊ธฐ์กด ํ”„๋กœ์ ํŠธ์—์„œ ๋งค๊ฐœ๋ณ€์ˆ˜ ์—†์ด firebase serve ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ firebase serve ๋ช…๋ น์€ ์„œ๋น„์Šค ํฌํŠธ๋ฅผ ์—ฌ๋Š” ๋…ธ๋“œ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ œ๋Œ€๋กœ ๋‹ซ์ง€ ์•Š๊ณ  ์ข…๋ฃŒ๋˜๋ฏ€๋กœ ํ•ด๋‹น ํ”„๋กœ์„ธ์Šค๋ฅผ ์ˆ˜๋™์œผ๋กœ ์ข…๋ฃŒํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ €์—๊ฒŒ๋„ ์ด ๋ฌธ์ œ๊ฐ€ ์žˆ์Œ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค. Firebase ์„œ๋ธŒ๋Š” ์–ด์ œ ์ž˜ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ Firebase 6.0.1๊ณผ 6.1.0 ๋ชจ๋‘์— ์žˆ์Šต๋‹ˆ๋‹ค.

๋‚˜๋Š” ๋˜‘๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฐ™์€!

๊ฐ™์€. ์ง€๊ธˆ ๋ฐฐํฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

์ €๋„ ์š”:

image

์ด ์‚ฌ์‹ค์„ ์•Œ๋ ค์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ์ด ๋ฌธ์ œ๋ฅผ ์ ๊ทน์ ์œผ๋กœ ์กฐ์‚ฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

(๋‚ด๋ถ€ ์ถ”์  ๋ฒˆํ˜ธ: 119615185)

@Neilpoulin ๋ฐฐํฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๊นŒ? ์–ด๋–ค ๋ฒ„์ „์˜ CLI๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์œผ๋ฉฐ ์–ด๋–ค ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๊นŒ?

์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค. fire base deploy ๋ช…๋ น๊ณผ ์ง์ ‘์ ์ธ ๊ด€๋ จ์ด ์—†์Šต๋‹ˆ๋‹ค. ๋‚ด ๋นŒ๋“œ
ํ”„๋กœ์„ธ์Šค์—๋Š” ์ด๋Ÿฌํ•œ ๊ตฌ์„ฑ์„ ๊ฐ€์ ธ์˜ค๋Š” ๋‹จ๊ณ„๊ฐ€ ํฌํ•จ๋˜๋ฉฐ ์‹คํŒจํ•˜๋ฏ€๋กœ
๋ฐฐํฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
2018๋…„ 11์›” 15์ผ ๋ชฉ์š”์ผ ์˜คํ›„ 12:10 Michael Bleigh [email protected]
์ผ๋‹ค:

@Neilpoulin https://github.com/Neilpoulin ๋ฐฐํฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๊นŒ? ๋ญ
์‚ฌ์šฉ ์ค‘์ธ CLI ๋ฒ„์ „์€ ๋ฌด์—‡์ด๋ฉฐ ์–ด๋–ค ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๊นŒ?

โ€”
๋‹น์‹ ์ด ์–ธ๊ธ‰๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด๊ฒƒ์„ ๋ฐ›๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/firebase/firebase-tools/issues/1015#issuecomment-439155616 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AAw-atNnP6wSmeHQke6z4EKIsx1D6r7Yks5uvbw_gaJpZM4Ygu-y
.

์ด๊ฒƒ์ด ๋ˆ„๊ตฐ๊ฐ€์—๊ฒŒ ๋„์›€์ด๋œ๋‹ค๋ฉด ๊ทธ ๋™์•ˆ ํฌํŠธ๋ฅผ ๊ฐ•์ œ๋กœ ์‹คํ–‰ํ•˜์—ฌ ๊ธฐ๋Šฅ์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋ฐฐํฌ ๋˜๋Š” ํ˜ธ์ŠคํŒ…์— ๋„์›€์ด ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜ˆ์‹œ:
sudo firebase serve --only ๊ธฐ๋Šฅ --port=9000

๊ฐ™์€ ๋ฌธ์ œ ... ์ด ๋ฌธ์ œ๋กœ ์ธํ•ด ๊ฐœ๋ฐœ์ด ์ค‘๋‹จ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ฝ˜ํ…์ธ ๋ฅผ ์ œ๊ณตํ•˜๋Š” Firebase ๊ธฐ๋Šฅ์œผ๋กœ ํ˜ธ์ŠคํŒ…๋˜๋Š” ๊ฐ๋„ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ Firebase ์„œ๋น„์Šค์™€ ๊ด€๋ จ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•˜์ง€๋งŒ ์ƒํƒœ ๋Œ€์‹œ๋ณด๋“œ๋Š” ๋ชจ๋‘ ๋…น์ƒ‰์œผ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์–ด์ œ๊นŒ์ง€๋Š” ๋ชจ๋‘ ์ž˜ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ง€๊ธˆ ์ž‘๋™ํ•˜์ง€๋งŒ ๊ฒฝ๊ณ ์™€ ํ•จ๊ป˜ ...

โš   database: WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/Users/rodrigodutra/.cache/firebase/emulators/firebase-database-emulator-v3.5.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
โš   database:
...

๋” ์ด์ƒ ์ž˜๋ชป๋œ ์ธ์ˆ˜ 400 ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์ง€๋งŒ ํ˜„์žฌ ๊ทธ ์ž๋ฆฌ์— ๋‹ค๋ฅธ ์˜ค๋ฅ˜๊ฐ€ ์žˆ์ง€๋งŒ ์—ฌ์ „ํžˆ ์‹คํ–‰๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

2018-11-15T20:01:14.098Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 15 Nov 2018 20:01:22 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="44,43,39,35", accept-ranges=none, connection=close
[2018-11-15T20:01:14.098Z] Starting @google-cloud/functions-emulator
[2018-11-15T20:01:14.115Z] Parsing function triggers
Warning: You're using Node.js v10.13.0 but Google Cloud Functions only supports v6.11.5.
[2018-11-15T20:01:14.238Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 15 Nov 2018 20:01:22 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="44,43,39,35", accept-ranges=none, connection=close
i  hosting: Serving hosting files from: public
โœ”  hosting: Local server: http://localhost:5000
โš   database: WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/qkay/.cache/firebase/emulators/firebase-database-emulator-v3.5.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
โš   database: 

error: SUPERVISOR error Error: listen EADDRINUSE 127.0.0.1:5001
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1460:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:62:10)
error: supervisorPort (5001) is already in use
error: restPort (5002) is already in use
12:01:15.254 [NamespaceSystem-akka.actor.default-dispatcher-3] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started

12:01:15.408 [main] INFO com.firebase.server.forge.App$ - Listening on port 9000

12:01:15.438 [main] ERROR com.firebase.server.forge.App$ - Error initializing Netty Listener
java.net.BindException: Address already in use
    at java.base/sun.nio.ch.Net.bind0(Native Method)
    at java.base/sun.nio.ch.Net.bind(Net.java:461)
    at java.base/sun.nio.ch.Net.bind(Net.java:453)
    at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:500)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1226)
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:495)
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:480)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:209)
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:355)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:464)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
    at java.base/java.lang.Thread.run(Thread.java:834)

12:01:15.440 [Thread-1] INFO com.firebase.server.forge.App$ - Attempting graceful shutdown.

12:01:15.444 [NamespaceSystem-akka.actor.default-dispatcher-4] INFO akka.actor.CoordinatedShutdown - Starting coordinated shutdown from JVM shutdown hook

12:01:15.448 [Thread-1] INFO com.firebase.server.forge.App$ - Graceful shutdown complete.


Error: database: emulator has exited with code: 1

๋” ์ด์ƒ ์ž˜๋ชป๋œ ์ธ์ˆ˜ 400 ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์ง€๋งŒ ํ˜„์žฌ ๊ทธ ์ž๋ฆฌ์— ๋‹ค๋ฅธ ์˜ค๋ฅ˜๊ฐ€ ์žˆ์ง€๋งŒ ์—ฌ์ „ํžˆ ์‹คํ–‰๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

2018-11-15T20:01:14.098Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 15 Nov 2018 20:01:22 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="44,43,39,35", accept-ranges=none, connection=close
[2018-11-15T20:01:14.098Z] Starting @google-cloud/functions-emulator
[2018-11-15T20:01:14.115Z] Parsing function triggers
Warning: You're using Node.js v10.13.0 but Google Cloud Functions only supports v6.11.5.
[2018-11-15T20:01:14.238Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 15 Nov 2018 20:01:22 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="44,43,39,35", accept-ranges=none, connection=close
i  hosting: Serving hosting files from: public
โœ”  hosting: Local server: http://localhost:5000
โš   database: WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/home/qkay/.cache/firebase/emulators/firebase-database-emulator-v3.5.0.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
โš   database: 

error: SUPERVISOR error Error: listen EADDRINUSE 127.0.0.1:5001
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1460:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:62:10)
error: supervisorPort (5001) is already in use
error: restPort (5002) is already in use
12:01:15.254 [NamespaceSystem-akka.actor.default-dispatcher-3] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started

12:01:15.408 [main] INFO com.firebase.server.forge.App$ - Listening on port 9000

12:01:15.438 [main] ERROR com.firebase.server.forge.App$ - Error initializing Netty Listener
java.net.BindException: Address already in use
  at java.base/sun.nio.ch.Net.bind0(Native Method)
  at java.base/sun.nio.ch.Net.bind(Net.java:461)
  at java.base/sun.nio.ch.Net.bind(Net.java:453)
  at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
  at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128)
  at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:500)
  at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1226)
  at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:495)
  at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:480)
  at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
  at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:209)
  at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:355)
  at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
  at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:464)
  at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
  at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
  at java.base/java.lang.Thread.run(Thread.java:834)

12:01:15.440 [Thread-1] INFO com.firebase.server.forge.App$ - Attempting graceful shutdown.

12:01:15.444 [NamespaceSystem-akka.actor.default-dispatcher-4] INFO akka.actor.CoordinatedShutdown - Starting coordinated shutdown from JVM shutdown hook

12:01:15.448 [Thread-1] INFO com.firebase.server.forge.App$ - Graceful shutdown complete.


Error: database: emulator has exited with code: 1

Mac์„ ์žฌ๋ถ€ํŒ…ํ•˜์‹ญ์‹œ์˜ค...

์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๋ฉด firebase serve --only hosting ๋˜๋Š” firebase serve --only functions ๋ฅผ ์‹œ๋„ํ•˜์‹ญ์‹œ์˜ค. ์ง€๊ธˆ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์ฐพ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

๋‚˜์—๊ฒŒ๋„ ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋‹ค. ๋ฐฉ๊ธˆ ๋‚ด ์ปดํ“จํ„ฐ๋ฅผ ์žฌ๋ถ€ํŒ…ํ–ˆ๋Š”๋ฐ ๋‹ค์‹œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

@Neilpoulin ๋ฐฐํฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๊นŒ? ์–ด๋–ค ๋ฒ„์ „์˜ CLI๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์œผ๋ฉฐ ์–ด๋–ค ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๊นŒ?

@mbleigh ๋‚ด ์ปดํ“จํ„ฐ๋กœ ๋Œ์•„์™€์„œ ๋” ์ž์„ธํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•˜๊ณ  ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค.

ํŠนํžˆ ๋…ธ๋“œ์—์„œ firebase-tools ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์‹คํŒจํ•œ ๋ช…๋ น์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ด ์˜ค๋ฅ˜๊ฐ€ ์ฒ˜์Œ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ firbase-tools ๋Š” 6.0.1 ๋ฒ„์ „์ด์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ 6.1.0 ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ–ˆ์ง€๋งŒ ์˜ค๋ฅ˜๋Š” ๋™์ผํ–ˆ์Šต๋‹ˆ๋‹ค.

const fbcli = require("firebase-tools");
const opts = {"project": "stage"}; //this is an active alias for my firebase setup
return fbcli.setup
    .web(opts)
    .then(firebaseConfig => { 
        // some config setup stuff for webpack
    }.catch(error => {
        //This gets called rigt away, see error object below
        console.error(error);
    })

์žก์€ ์˜ค๋ฅ˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

{
  "name": "FirebaseError",
  "message": "HTTP Error: 400, Request contains an invalid argument.",
  "children": [],
  "status": 500,
  "exit": 1,
  "stack": "Error\n    at new FirebaseError (/Users/myrepo/node_modules/firebase-tools/src/error.js:11:16)\n    at module.exports (/Users/myrepo/node_modules/firebase-tools/src/responseToError.js:46:10)\n    at Request._callback (/Users/myrepo/node_modules/firebase-tools/src/api.js:50:25)\n    at Request.self.callback (/Users/myrepo/node_modules/request/request.js:185:22)\n    at emitTwo (events.js:126:13)\n    at Request.emit (events.js:214:7)\n    at Request.<anonymous> (/Users/myrepo/node_modules/request/request.js:1161:10)\n    at emitOne (events.js:116:13)\n    at Request.emit (events.js:211:7)\n    at IncomingMessage.<anonymous> (/Users/myrepo/node_modules/request/request.js:1083:12)",
  "context": {
    "body": {
      "error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT"
      }
    },
    "response": {
      "statusCode": 400,
      "body": {
        "error": {
          "code": 400,
          "message": "Request contains an invalid argument.",
          "status": "INVALID_ARGUMENT"
        }
      },
      "headers": {
        "vary": "X-Origin, Referer, Origin,Accept-Encoding",
        "content-type": "application/json; charset=UTF-8",
        "date": "Thu, 15 Nov 2018 18:33:41 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=\"44,43,39,35\"",
        "accept-ranges": "none",
        "connection": "close"
      },
      "request": {
        "uri": {
          "protocol": "https:",
          "slashes": true,
          "auth": null,
          "host": "mobilesdk-pa.googleapis.com",
          "port": 443,
          "hostname": "mobilesdk-pa.googleapis.com",
          "hash": null,
          "search": null,
          "query": null,
          "pathname": "/v1/projects/465836249868/clients/_:getWebAppConfig",
          "path": "/v1/projects/465836249868/clients/_:getWebAppConfig",
          "href": "https://mobilesdk-pa.googleapis.com/v1/projects/465836249868/clients/_:getWebAppConfig"
        },
        "method": "GET"
      }
    }
  }
}

1:16pm MT ํ˜„์žฌ ํŽธ์ง‘, ๋” ์ด์ƒ ์ด ์˜ค๋ฅ˜๊ฐ€ ํ‘œ์‹œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ด ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚จ ๋ฐฑ์—”๋“œ ๋นŒ๋“œ๋ฅผ ๋กค๋ฐฑํ–ˆ์Šต๋‹ˆ๋‹ค. ์ง€๊ธˆ ์ด๊ฒƒ์„ ์‹œ๋„ํ•˜๊ณ  ์—ฌ์ „ํžˆ ๊ณ ์žฅ ๋‚ฌ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

๋‚˜๋ฅผ ์œ„ํ•ด ์ผํ–ˆ๋‹ค

+1 ์ง€๊ธˆ ์ž‘๋™ ์ค‘์ž…๋‹ˆ๋‹ค. ๊ฐ์‚ฌ

+1๋„ ์ €์—๊ฒŒ ํšจ๊ณผ๊ฐ€ ์žˆ์Œ์„ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.

๋น„์ฆˆ๋‹ˆ์Šค์—์„œ +1

@ryanpbrewster ๋„ค, ๋‹ค์‹œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ์‚ฌ ํ•ด์š”! ๋„ˆํฌ๋“ค์€ ๊ทธ๊ฒƒ์„ ์œ„ํ•ด ์ผ์ข…์˜ e2 ํ…Œ์ŠคํŒ…์„ ํ•ด์•ผ ํ•œ๋‹ค.

ps: ์žฌ๋ถ€ํŒ… ์—†์ด ์ž‘๋™ํ–ˆ์ง€๋งŒ firebase serve ์ „์— ์ผ๋ถ€ ์ค‘๋‹จ๋œ ๋…ธ๋“œ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋ฐœ๊ฒฌํ•˜๊ณ  ์ข…๋ฃŒ

์žฌ๋ถ€ํŒ… ํ›„์—๋„ ์—ฌ์ „ํžˆ ์ด์ „ ๋ฐฐํฌ ์‹œ๋„์—์„œ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฐฉ๊ธˆ ๋งจ ์œ„๋กœ ์ด๋™ํ•˜์—ฌ ์ˆ˜๋™์œผ๋กœ ์ข…๋ฃŒํ–ˆ์œผ๋ฉฐ ์ด์ œ Firebase ๋„๊ตฌ๊ฐ€ ์ œ๋Œ€๋กœ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.

+1 ๋ชจ๋“  ์„ค์ •! ๋งŽ์ด ์“ฐ์„ธ์š”.

๊ธฐ๋‹ค๋ ค ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์ž˜๋ชป๋œ ์ธ์ˆ˜ ์˜ค๋ฅ˜๊ฐ€ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

'firebase ๋ฐฐํฌ'์—์„œ ์ง€๊ธˆ 5์‹œ๊ฐ„ ๋™์•ˆ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋Šฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

exports.makeUppercase = functions.database.ref('/userfollowers/{pushId}/followers')
    .onWrite((change, context) => {
      // Only edit data when it is first created.
      if (change.before.exists()) {
        return null;
      }
      // Exit when the data is deleted.
      if (!change.after.exists()) {
        return null;
      }
      // Grab the current value of what was written to the Realtime Database.
      const original = change.after.val();
      console.log('Uppercasing', context.params.pushId, original);
      const uppercase = original.toUpperCase();
      // You must return a Promise when performing asynchronous tasks inside a Functions such as
      // writing to the Firebase Realtime Database.
      // Setting an "uppercase" sibling in the Realtime Database returns a Promise.
      return change.after.ref.parent.child('uppercase').set(uppercase);
    });

๋ฌธ์„œ์—์„œ ๋ฐ”๋กœ ๋‚˜์˜จ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

ํ„ฐ๋ฏธ๋„์€ ๋‹ค์Œ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

โš   functions: failed to create function makeUppercase
HTTP Error: 400, The request has errors

ํด๋ผ์šฐ๋“œ ๊ธฐ๋Šฅ ๋กœ๊ทธ๋Š” ๋‹ค์Œ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"INVALID_ARGUMENT"},"authenticationInfo":{"principalEmail":"[email protected]"},"requestMetadata":{"callerIp":"86.120.235.246","callerSuppliedUserAgent":"FirebaseCLI/3.19.0,gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2019-05-14T08:34:18.563Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.CreateFunction","authorizationInfo":[{"resource":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase","permission":"cloudfunctions.functions.create","granted":true,"resourceAttributes":{}},{"permission":"cloudfunctions.functions.create","granted":true,"resourceAttributes":{}}],"resourceName":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase","request":{"location":"projects/parkour-9136c/locations/us-central1","@type":"type.googleapis.com/google.cloud.functions.v1.CreateFunctionRequest","function":{"labels":{"deployment-tool":"cli-firebase"},"entryPoint":"makeUppercase","eventTrigger":{"eventType":"providers/google.firebase.database/eventTypes/ref.write","resource":"projects/_/instances/parkour-9136c/refs/userfollowers/{pushId}/followers","service":"firebaseio.com"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-f5adb7fe-7321-4f3c-8fe0-2b2307d26138/5b099ea8-161b-44a7-a3bd-18ce75c64859.zip?GoogleAccessId=service-807137615499@gcf-admin-robot.iam.gserviceaccount.com&Expires=1557824657&Signature=PJKzJsZtHWO1kIkmrSojpdgvb0jRzV91eNC9rZc4j%2FMcoHjILGm36FKCt6qQ2fxeAUu1%2FbrxpagdI7fHmUUUrDdTmnTNISr7FiN61sifUI%2B%2FGnUwo8SguzvrA7kADFqu8nD05FAo7BvG7biUrHmLgISlwo5dTKqcTSmExnaICA1tHYxjz%2Fk0RbmdGkcQ5HdeCKBnW0R7wQPsxswQyvR4cAU4WD2m3PPM9lncVr7pB%2Fh77FboGLi3sq%2FGHyEwUtjfUmyN9d%2FYUpKs48TMsGPknAGIvaFFUWQR23YCDUcrPipq1nW2W1JUdf5nGylYmVEeyF3jLrm%2BsOIcXiZ6LCRhpg%3D%3D","name":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase"}}}

ํ•ด๊ฒฐ์ฑ…์ด ๋ฌด์—‡ ์ด๋‹ˆ?
๊ฐ์‚ฌ

@nicoara ๋Š” ํ•„์ˆ˜ ์ •๋ณด๋กœ ์ƒˆ ๋ฌธ์ œ๋ฅผ ์—ด์–ด์ฃผ์„ธ์š”. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

'firebase ๋ฐฐํฌ'์—์„œ ์ง€๊ธˆ 5์‹œ๊ฐ„ ๋™์•ˆ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋Šฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

exports.makeUppercase = functions.database.ref('/userfollowers/{pushId}/followers')
    .onWrite((change, context) => {
      // Only edit data when it is first created.
      if (change.before.exists()) {
        return null;
      }
      // Exit when the data is deleted.
      if (!change.after.exists()) {
        return null;
      }
      // Grab the current value of what was written to the Realtime Database.
      const original = change.after.val();
      console.log('Uppercasing', context.params.pushId, original);
      const uppercase = original.toUpperCase();
      // You must return a Promise when performing asynchronous tasks inside a Functions such as
      // writing to the Firebase Realtime Database.
      // Setting an "uppercase" sibling in the Realtime Database returns a Promise.
      return change.after.ref.parent.child('uppercase').set(uppercase);
    });

๋ฌธ์„œ์—์„œ ๋ฐ”๋กœ ๋‚˜์˜จ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

ํ„ฐ๋ฏธ๋„์€ ๋‹ค์Œ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

โš   functions: failed to create function makeUppercase
HTTP Error: 400, The request has errors

ํด๋ผ์šฐ๋“œ ๊ธฐ๋Šฅ ๋กœ๊ทธ๋Š” ๋‹ค์Œ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"INVALID_ARGUMENT"},"authenticationInfo":{"principalEmail":"[email protected]"},"requestMetadata":{"callerIp":"86.120.235.246","callerSuppliedUserAgent":"FirebaseCLI/3.19.0,gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2019-05-14T08:34:18.563Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.CreateFunction","authorizationInfo":[{"resource":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase","permission":"cloudfunctions.functions.create","granted":true,"resourceAttributes":{}},{"permission":"cloudfunctions.functions.create","granted":true,"resourceAttributes":{}}],"resourceName":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase","request":{"location":"projects/parkour-9136c/locations/us-central1","@type":"type.googleapis.com/google.cloud.functions.v1.CreateFunctionRequest","function":{"labels":{"deployment-tool":"cli-firebase"},"entryPoint":"makeUppercase","eventTrigger":{"eventType":"providers/google.firebase.database/eventTypes/ref.write","resource":"projects/_/instances/parkour-9136c/refs/userfollowers/{pushId}/followers","service":"firebaseio.com"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-f5adb7fe-7321-4f3c-8fe0-2b2307d26138/5b099ea8-161b-44a7-a3bd-18ce75c64859.zip?GoogleAccessId=service-807137615499@gcf-admin-robot.iam.gserviceaccount.com&Expires=1557824657&Signature=PJKzJsZtHWO1kIkmrSojpdgvb0jRzV91eNC9rZc4j%2FMcoHjILGm36FKCt6qQ2fxeAUu1%2FbrxpagdI7fHmUUUrDdTmnTNISr7FiN61sifUI%2B%2FGnUwo8SguzvrA7kADFqu8nD05FAo7BvG7biUrHmLgISlwo5dTKqcTSmExnaICA1tHYxjz%2Fk0RbmdGkcQ5HdeCKBnW0R7wQPsxswQyvR4cAU4WD2m3PPM9lncVr7pB%2Fh77FboGLi3sq%2FGHyEwUtjfUmyN9d%2FYUpKs48TMsGPknAGIvaFFUWQR23YCDUcrPipq1nW2W1JUdf5nGylYmVEeyF3jLrm%2BsOIcXiZ6LCRhpg%3D%3D","name":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase"}}}

ํ•ด๊ฒฐ์ฑ…์ด ๋ฌด์—‡ ์ด๋‹ˆ?
๊ฐ์‚ฌ

'firebase ๋ฐฐํฌ'์—์„œ ์ง€๊ธˆ 5์‹œ๊ฐ„ ๋™์•ˆ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋Šฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

exports.makeUppercase = functions.database.ref('/userfollowers/{pushId}/followers')
    .onWrite((change, context) => {
      // Only edit data when it is first created.
      if (change.before.exists()) {
        return null;
      }
      // Exit when the data is deleted.
      if (!change.after.exists()) {
        return null;
      }
      // Grab the current value of what was written to the Realtime Database.
      const original = change.after.val();
      console.log('Uppercasing', context.params.pushId, original);
      const uppercase = original.toUpperCase();
      // You must return a Promise when performing asynchronous tasks inside a Functions such as
      // writing to the Firebase Realtime Database.
      // Setting an "uppercase" sibling in the Realtime Database returns a Promise.
      return change.after.ref.parent.child('uppercase').set(uppercase);
    });

๋ฌธ์„œ์—์„œ ๋ฐ”๋กœ ๋‚˜์˜จ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

ํ„ฐ๋ฏธ๋„์€ ๋‹ค์Œ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

โš   functions: failed to create function makeUppercase
HTTP Error: 400, The request has errors

ํด๋ผ์šฐ๋“œ ๊ธฐ๋Šฅ ๋กœ๊ทธ๋Š” ๋‹ค์Œ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"INVALID_ARGUMENT"},"authenticationInfo":{"principalEmail":"[email protected]"},"requestMetadata":{"callerIp":"86.120.235.246","callerSuppliedUserAgent":"FirebaseCLI/3.19.0,gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2019-05-14T08:34:18.563Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.CreateFunction","authorizationInfo":[{"resource":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase","permission":"cloudfunctions.functions.create","granted":true,"resourceAttributes":{}},{"permission":"cloudfunctions.functions.create","granted":true,"resourceAttributes":{}}],"resourceName":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase","request":{"location":"projects/parkour-9136c/locations/us-central1","@type":"type.googleapis.com/google.cloud.functions.v1.CreateFunctionRequest","function":{"labels":{"deployment-tool":"cli-firebase"},"entryPoint":"makeUppercase","eventTrigger":{"eventType":"providers/google.firebase.database/eventTypes/ref.write","resource":"projects/_/instances/parkour-9136c/refs/userfollowers/{pushId}/followers","service":"firebaseio.com"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-f5adb7fe-7321-4f3c-8fe0-2b2307d26138/5b099ea8-161b-44a7-a3bd-18ce75c64859.zip?GoogleAccessId=service-807137615499@gcf-admin-robot.iam.gserviceaccount.com&Expires=1557824657&Signature=PJKzJsZtHWO1kIkmrSojpdgvb0jRzV91eNC9rZc4j%2FMcoHjILGm36FKCt6qQ2fxeAUu1%2FbrxpagdI7fHmUUUrDdTmnTNISr7FiN61sifUI%2B%2FGnUwo8SguzvrA7kADFqu8nD05FAo7BvG7biUrHmLgISlwo5dTKqcTSmExnaICA1tHYxjz%2Fk0RbmdGkcQ5HdeCKBnW0R7wQPsxswQyvR4cAU4WD2m3PPM9lncVr7pB%2Fh77FboGLi3sq%2FGHyEwUtjfUmyN9d%2FYUpKs48TMsGPknAGIvaFFUWQR23YCDUcrPipq1nW2W1JUdf5nGylYmVEeyF3jLrm%2BsOIcXiZ6LCRhpg%3D%3D","name":"projects/parkour-9136c/locations/us-central1/functions/makeUppercase"}}}

ํ•ด๊ฒฐ์ฑ…์ด ๋ฌด์—‡ ์ด๋‹ˆ?
๊ฐ์‚ฌ

db ์ฐธ์กฐ ๊ฒฝ๋กœ ๋์— ๋ฌธ์„œ๋ฅผ ์ถ”๊ฐ€ํ•ด ๋ณด์‹ญ์‹œ์˜ค. ์˜ˆ: /userfollowers/{pushId}/followers/{follower}

@bkendall ์ƒˆ ์Šค๋ ˆ๋“œ๋ฅผ ์‹œ์ž‘ํ–ˆ์Šต๋‹ˆ๋‹ค: https://github.com/firebase/firebase-tools/issues/1317

'firebase deploy --debug'๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์ƒˆ ๋ฉ”์‹œ์ง€๋ฅผ ์ฐพ์•˜์Šต๋‹ˆ๋‹ค.

[2019-05-20T14:43:23.863Z] <<< HTTP RESPONSE 400 vary=X-Origin, Referer, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, date=Mon, 20 May 2019 14:43:23 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,44,43,39", accept-ranges=none, connection=close
[2019-05-20T14:43:23.863Z] <<< HTTP RESPONSE BODY code=400, message=The request has errors, status=INVALID_ARGUMENT, details=[@type=type.googleapis.com/google.rpc.BadRequest, fieldViolations=[field=runtime, description=Runtime field cannot be empty.]]
โš   functions: failed to create function makeUppercase
HTTP Error: 400, The request has errors

@soclbz ๋ณ€๊ฒฝ์€ ์ฐจ์ด๋ฅผ ๋งŒ๋“ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

๋™์ผํ•œ _"๋Ÿฐํƒ€์ž„ ํ•„๋“œ๋Š” ๋น„์›Œ ๋‘˜ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."_ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

[2019-06-06T18:51:31.127Z] <<< HTTP ์‘๋‹ต 400 ๋‹ค์–‘ํ•จ=X-Origin, Referer, Origin, Accept-Encoding, content-type=application/json; charset=UTF-8, ๋‚ ์งœ=Thu, 06 June 2019 18:51:30 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content- ์œ ํ˜•-
์˜ต์…˜=nosniff, alt-svc=quic=":443"; ma=2592000; v="46,44,43,39", ํ—ˆ์šฉ ๋ฒ”์œ„=์—†์Œ, ์—ฐ๊ฒฐ=๋‹ซ๊ธฐ
[2019-06-06T18:51:31.128Z] <<< HTTP RESPONSE BODY code=400, message=์š”์ฒญ์— ์˜ค๋ฅ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. status=INVALID_ARGUMENT, details=[@type=type.googleapis.com/google.rpc.BadRequest , fieldViolations=[field=runtime, description=๋Ÿฐํƒ€์ž„ ํ•„๋“œ๋Š” ๋น„์›Œ๋‘˜ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.]]

์ด๋Š” hello world ์˜ˆ์ œ ํ•จ์ˆ˜๋ฅผ ๋ฐฐํฌํ•˜๋ ค๊ณ  ํ•  ๋•Œ npx firebase init ์‚ฌ์šฉํ•˜์—ฌ ์ƒˆ๋กœ ์ƒ์„ฑ๋œ ํ”„๋กœ์ ํŠธ์—์„œ๋„ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

@stpch ๋Š” ์ด์ „ ๋ฒ„์ „์˜ CLI๋ฅผ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๊นŒ? #1317์„ ๋ด์ฃผ์„ธ์š”

@stpch ๋Š” ์ด์ „ ๋ฒ„์ „์˜ CLI๋ฅผ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๊นŒ? #1317์„ ๋ด์ฃผ์„ธ์š”

์ตœ์‹  ๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ œ ๋‚˜์œ, npx ๋ณด๋‹ค ์šฐ์„ ํ•˜๋Š” yarn ๋ฅผ ํ†ตํ•ด ์„ค์น˜๋œ ์ด์ „ firebase-tools ๋ฒ„์ „์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์ž‘๋™ ์ค‘์ž…๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰