Firebase-tools: configuração: web INVALID_ARGUMENT código de status 400

Criado em 15 nov. 2018  ·  41Comentários  ·  Fonte: firebase/firebase-tools

Informações da versão: 6.1.0
Informações da plataforma: OSX

Passos para reproduzir

cd dir
firebase init (somente hospedagem)
selecione o projeto existente
firebase serve --only hosting --debug

Ele administra o site localmente.

[2018-11-15T17: 12: 15.331Z] <<< HTTP RESPONSE 400 Varia = X-Origin, Referer, Origin, Accept-Encoding, content-type = application / json; charset = UTF-8, data = Thu, 15 Nov 2018 17:12:15 GMT, server = ESF, cache-control = private, x-xss-protection = 1; modo = bloco, x-frame-options = SAMEORIGIN, x-content-type-options = nosniff, alt-svc = quic = ": 443"; ma = 2592000; v = "44,43,39,35", faixas de aceitação = nenhum, conexão = fechar
[2018-11-15T17: 12: 15.331Z] <<< HTTP RESPONSE BODY code = 400, message = Request contém um argumento inválido., Status = INVALID_ARGUMENT

Erro: Erro HTTP: 400, a solicitação contém um argumento inválido.
[2018-11-15T17: 12: 15.532Z] Contexto do erro: {
"corpo": {
"erro": {
"código": 400,
"message": "O pedido contém um argumento inválido.",
"status": "INVALID_ARGUMENT"
}
},
"resposta": {
"statusCode": 400,
"corpo": {
"erro": {
"código": 400,
"message": "O pedido contém um argumento inválido.",
"status": "INVALID_ARGUMENT"
}
},
"cabeçalhos": {
"variar": "X-Origin, Referer, Origin, Accept-Encoding",
"content-type": "application / json; charset = UTF-8",
"data": "Qui, 15 de novembro de 2018 17:12:15 GMT",
"servidor": "ESF",
"cache-control": "privado",
"x-xss-protection": "1; modo = bloquear",
"opções x-frame": "SAMEORIGIN",
"x-content-type-options": "nosniff",
"alt-svc": "quic = \": 443 \ "; ma = 2592000; v = \" 44,43,39,35 \ "",
"aceites": "nenhum",
"conexão": "fechar"
},
"solicitar": {
"uri": {
"protocolo": "https:",
"barras": verdadeiro,
"auth": nulo,
"host": "mobilesdk-pa.googleapis.com",
"porta": 443,
"hostname": "mobilesdk-pa.googleapis.com",
"hash": null,
"search": null,
"consulta": nulo,
"pathname": "/ v1 / projects / 540833485883 / clients / _: getWebAppConfig",
"caminho": "/ v1 / projects / 540833485883 / clients / _: getWebAppConfig",
"href": " https://mobilesdk-pa.googleapis.com/v1/projects/540833485883/clients/_ : getWebAppConfig"
},
"método": "GET"
}
}
}

p1

Comentários muito úteis

Obrigado a todos por nos chamar a atenção para isso. Estamos investigando ativamente esse problema agora.

(Número de rastreamento interno: 119615185)

Todos 41 comentários

Mesmo aqui:

Informações da versão: 6.1.0 (também testado com 6.0.0, 5.0.0)
Informações da plataforma: OSX 10.14 macOS Mojave 18A391

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

Testado com projeto existente e um novo. Mesmo erro.

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"
    }
  }
}

Estou tendo exatamente o mesmo problema. Acabei de testar o mesmo projeto sem nenhuma alteração em outra máquina, e até mesmo em outro projeto que está funcionando bem há cerca de 3 meses, e o problema é o mesmo. A implantação é normal, mas localhost (_firebase serve - apenas funções, hospedagem --debug_) apenas pare de trabalhar com este erro de anoing ...
Não creio que o problema seja o aplicativo (meu ou seu).
Tudo estava funcionando bem há cerca de 2 horas!

1 para mim

o mesmo problema. ontem tudo funcionou bem

[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 para mim, e para um amigo também, parei de funcionar esta manhã quando estava funcionando bem ontem. Não vejo nada sobre isso em https://status.firebase.google.com . Alguém do Firebase pode comentar?

1 para mim - tudo parou de funcionar de repente. Tentei atualizar para 6.1.0 da 6.0.1 e agora firebase serve também me mostra esta mensagem:

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

Eu executo esse comando com sucesso e quando tento executar firebase serve novamente, recebo:

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

Procurando o comando que acabei de executar, encontrei esta página: https://firebase.google.com/docs/firestore/security/test-rules-emulator

Tentei executar firebase --open-sesame emulators pensando que era um problema com 6.1.0 e recebi este erro:

Error: Did not recognize preview feature

+1 mesmo problema, começou esta manhã

+1. Pode verificar o problema ocorre ao usar firebase serve sem parâmetros em um projeto existente, com firebase-tools versões v6.0.1 e v6.1.0. Além disso, o comando firebase serve sai sem fechar corretamente o processo do nó que abre as portas de serviço, exigindo uma eliminação manual desse processo.

Só queria acrescentar que também estou com esse problema. O firebase serve estava funcionando bem ontem. Isso está no firebase 6.0.1 e 6.1.0

Eu tenho exatamente o mesmo problema.

Mesmo!

mesmo. Não consigo implantar agora

Eu também:

image

Obrigado a todos por nos chamar a atenção para isso. Estamos investigando ativamente esse problema agora.

(Número de rastreamento interno: 119615185)

@Neilpoulin você não consegue implantar? Qual versão da CLI você está usando e que erro está obtendo?

Desculpe, não está diretamente relacionado ao comando de implantação de base de incêndio. minha construção
processo inclui uma etapa que pega essas configurações e, uma vez que falha, eu
não pode implantar.
Na quinta-feira, 15 de novembro de 2018 às 12h10 Michael Bleigh [email protected]
escreveu:

@Neilpoulin https://github.com/Neilpoulin você não consegue implantar? O que
versão da CLI que você está usando e que erro está obtendo?

-
Você está recebendo isso porque foi mencionado.

Responda a este e-mail diretamente, visualize-o no GitHub
https://github.com/firebase/firebase-tools/issues/1015#issuecomment-439155616 ,
ou silenciar o tópico
https://github.com/notifications/unsubscribe-auth/AAw-atNnP6wSmeHQke6z4EKIsx1D6r7Yks5uvbw_gaJpZM4Ygu-y
.

Se isso ajudar alguém, você pode colocar suas funções em execução forçando a porta nesse meio tempo. Isso não ajudará na implantação ou hospedagem. Exemplo:
sudo firebase serve --only functions --port = 9000

Mesmo problema ... nosso desenvolvimento está parado por causa deste problema. Temos um aplicativo angular hospedado com as funções do firebase que veiculam o conteúdo. Eu acho que isso é algo a ver com os serviços do firebase, mas seu painel de status está mostrando tudo verde. Estava tudo funcionando bem até ontem.

Está funcionando agora, mas com avisos ...

⚠  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:
...

Não estou mais recebendo o erro ilegal do argumento 400, mas outro em seu lugar agora e ainda não está em execução:

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

Não estou mais recebendo o erro ilegal do argumento 400, mas outro em seu lugar agora e ainda não está em execução:

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

Reinicie o seu Mac ...

Experimente firebase serve --only hosting ou firebase serve --only functions para contornar este problema. Procurando uma solução para isso agora.

Eu também tive o problema; acabei de reiniciar meu computador e ele funciona novamente.

@Neilpoulin você não consegue implantar? Qual versão da CLI você está usando e que erro está obtendo?

@mbleigh Queria dar mais detalhes agora que estou de volta ao meu computador:

Especificamente, estou executando firebase-tools no nó. O comando que falha é este:

Quando encontrei este erro pela primeira vez, firbase-tools estava na versão 6.0.1 . Em seguida, atualizei para 6.1.0 mas o erro foi o mesmo.

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);
    })

onde o erro detectado se parece com:

{
  "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"
      }
    }
  }
}

EDITAR a partir de 13h16 MT, não estou mais vendo este erro

Revertemos uma compilação de back-end que estava causando esse problema. Você pode tentar isso agora e ver se ainda está quebrado?

Funcionou para mim

1 trabalhando agora. obrigado

1 confirmou que está trabalhando para mim também.

+1 de volta aos negócios

@ryanpbrewster sim, está funcionando novamente. obrigada! vocês deveriam ter algum tipo de teste e2e para isso

ps: funcionou sem reinicializações, mas encontrei alguns processos de nó pendurados e os eliminei antes de firebase serve

mesmo após a reinicialização, eu ainda tinha processos em execução de tentativas de implantação anteriores. Eu apenas entrei no topo e os eliminei manualmente e agora as ferramentas do Firebase estão funcionando bem para mim.

+1 tudo pronto! Tks muito.

Obrigado a todos por sua paciência. O erro de argumento inválido foi resolvido.

tentando resolver o problema há 5 horas agora, em 'firebase deploy'.

função é:

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);
    });

que está diretamente fora da documentação.

o terminal mostra:

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

logs de funções de nuvem mostram:
{"@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"}}}

Qual é a solução?
obrigado

@nicoara abra um novo problema com as informações necessárias. Obrigada.

tentando resolver o problema há 5 horas agora, em 'firebase deploy'.

função é:

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);
    });

que está diretamente fora da documentação.

o terminal mostra:

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

logs de funções de nuvem mostram:
{"@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"}}}

Qual é a solução?
obrigado

tentando resolver o problema há 5 horas agora, em 'firebase deploy'.

função é:

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);
    });

que está diretamente fora da documentação.

o terminal mostra:

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

logs de funções de nuvem mostram:
{"@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"}}}

Qual é a solução?
obrigado

tente adicionar documento no final do caminho de referência do banco de dados. por exemplo, / userfollowers / {pushId} / Followers / {follower}

@bkendall Comecei um novo tópico: https://github.com/firebase/firebase-tools/issues/1317

Executei 'firebase deploy --debug' e encontrei uma nova mensagem.

[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 a mudança não faz diferença.

Obrigada

Obtendo o mesmo _ "O campo do tempo de execução não pode estar vazio" _ erro:

[2019-06-06T18: 51: 31.127Z] <<< HTTP RESPONSE 400 Varia = X-Origin, Referer, Origin, Accept-Encoding, content-type = application / json; charset = UTF-8, data = Thu, 06 Jun 2019 18:51:30 GMT, server = ESF, cache-control = private, x-xss-protection = 0, x-frame-options = SAMEORIGIN, x-content- modelo-
options = nosniff, alt-svc = quic = ": 443"; ma = 2592000; v = "46,44,43,39", faixas de aceitação = nenhum, conexão = fechar
[2019-06-06T18: 51: 31.128Z] <<< 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 = O campo Runtime não pode estar vazio.]]

Isso também acontece para projetos recém-criados usando npx firebase init ao tentar implementar a função de exemplo hello world.

@stpch você está usando uma versão antiga da CLI? Por favor, olhe para # 1317

@stpch você está usando uma versão antiga da CLI? Por favor, olhe para # 1317

Estou usando as versões mais recentes:

Que pena, havia uma versão antiga de firebase-tools instalada através de yarn que tinha precedência sobre npx . Agora está funcionando com a versão mais recente.

Esta página foi útil?
0 / 5 - 0 avaliações