Firebase-tools: configuración: web INVALID_ARGUMENT código de estado 400

Creado en 15 nov. 2018  ·  41Comentarios  ·  Fuente: firebase/firebase-tools

Información de versión: 6.1.0
Información de la plataforma: OSX

pasos para reproducir

cd dir
firebase init (solo alojamiento)
seleccionar proyecto existente
firebase serve --only hosting --debug

Ejecuta el sitio localmente.

[2018-11-15T17: 12: 15.331Z] <<< RESPUESTA HTTP 400 varía = X-Origin, Referer, Origin, Accept-Encoding, content-type = application / json; conjunto de caracteres = UTF-8, fecha = jueves, 15 de noviembre de 2018 17:12:15 GMT, servidor = ESF, control de caché = privado, protección x-xss = 1; mode = block, x-frame-options = SAMEORIGIN, x-content-type-options = nosniff, alt-svc = quic = ": 443"; ma = 2592000; v = "44,43,39,35", aceptar rangos = ninguno, conexión = cerrar
[2018-11-15T17: 12: 15.331Z] <<< HTTP RESPONSE BODY code = 400, message = Request contains an inválido argumento., Status = INVALID_ARGUMENT

Error: HTTP Error: 400, la solicitud contiene un argumento no válido.
[2018-11-15T17: 12: 15.532Z] Contexto de error: {
"cuerpo": {
"error": {
"código": 400,
"message": "La solicitud contiene un argumento no válido.",
"estado": "INVALID_ARGUMENT"
}
},
"respuesta": {
"statusCode": 400,
"cuerpo": {
"error": {
"código": 400,
"message": "La solicitud contiene un argumento no válido.",
"estado": "INVALID_ARGUMENT"
}
},
"encabezados": {
"variar": "X-Origin, Referer, Origin, Accept-Encoding",
"tipo de contenido": "aplicación / json; juego de caracteres = UTF-8",
"date": "Jue, 15 de noviembre de 2018 17:12:15 GMT",
"servidor": "ESF",
"cache-control": "privado",
"x-xss-protection": "1; modo = bloquear",
"x-frame-options": "SAMEORIGIN",
"x-content-type-options": "nosniff",
"alt-svc": "quic = \": 443 \ "; ma = 2592000; v = \" 44,43,39,35 \ "",
"aceptar-rangos": "ninguno",
"conexión": "cerrar"
},
"solicitud": {
"uri": {
"protocolo": "https:",
"barras": verdadero,
"auth": nulo,
"host": "mobilesdk-pa.googleapis.com",
"puerto": 443,
"nombre de host": "mobilesdk-pa.googleapis.com",
"hash": nulo,
"búsqueda": nulo,
"consulta": nulo,
"nombre de ruta": "/ v1 / projects / 540833485883 / clients / _: getWebAppConfig",
"ruta": "/ v1 / projects / 540833485883 / clients / _: getWebAppConfig",
"href": " https://mobilesdk-pa.googleapis.com/v1/projects/540833485883/clients/_ : getWebAppConfig"
},
"método": "OBTENER"
}
}
}

p1

Comentario más útil

Gracias a todos por informarnos sobre esto. Estamos investigando activamente este problema en este momento.

(Número de seguimiento interno: 119615185)

Todos 41 comentarios

Aquí igual:

Información de la versión: 6.1.0 (también probado con 6.0.0, 5.0.0)
Información de la plataforma: OSX 10.14 macOS Mojave 18A391

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

Probado con proyecto existente y uno nuevo. Mismo error.

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

Estoy teniendo exactamente el mismo problema. Acabo de probar el mismo proyecto sin ningún cambio en otra máquina, e incluso en otro proyecto que funciona bien durante unos 3 meses, y el problema es el mismo. Implementando su normal, pero localhost (_firebase sirve --sólo funciones, hosting --debug_) simplemente deja de funcionar con este molesto error ...
No creo que el problema sea la aplicación (mía o tuya).
¡Todo estaba funcionando bien hace aproximadamente 2 horas!

+1 para mi

mismo problema. ayer todo funcionó bien

[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 mí, y también para un amigo, dejé de trabajar esta mañana cuando ayer funcionaba bien. No veo nada al respecto en https://status.firebase.google.com , ¿hay alguien de Firebase que pueda comentar?

+1 para mí: todo dejó de funcionar de repente. Intenté actualizar a 6.1.0 desde 6.0.1 y ahora firebase serve también me da este mensaje:

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

Ejecuto ese comando con éxito y cuando intento ejecutar firebase serve nuevamente obtengo:

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

Buscando el comando que acabo de ejecutar, encontré esta página: https://firebase.google.com/docs/firestore/security/test-rules-emulator

Intenté ejecutar firebase --open-sesame emulators pensando que era un problema con 6.1.0 y obtuve este error:

Error: Did not recognize preview feature

+1 El mismo problema, comenzó esta mañana

+1. Puede verificar que el problema ocurre cuando se usa firebase serve sin parámetros en un proyecto existente, con firebase-tools versiones v6.0.1 y v6.1.0. Además, el comando firebase serve sale sin cerrar correctamente el proceso de nodo que abre los puertos de servicio, lo que requiere una eliminación manual de ese proceso.

Solo quería agregar que yo también tengo este problema. El servicio de base de fuego estaba funcionando bien ayer. Esto está tanto en firebase 6.0.1 como en 6.1.0

Tengo exactamente el mismo problema.

¡Mismo!

mismo. No puedo desplegar ahora

Yo también:

image

Gracias a todos por informarnos sobre esto. Estamos investigando activamente este problema en este momento.

(Número de seguimiento interno: 119615185)

@Neilpoulin, ¿no puedes implementar? ¿Qué versión de la CLI está usando y qué error está obteniendo?

Lo siento, no está directamente relacionado con el comando de despliegue de la base de fuego. mi construcción
El proceso incluye un paso que toma estas configuraciones, y dado que falla,
no se puede implementar.
El jueves 15 de noviembre de 2018 a las 12:10 p.m. Michael Bleigh [email protected]
escribió:

@Neilpoulin https://github.com/Neilpoulin no puedes implementar? Qué
versión de la CLI que está utilizando y qué error está obteniendo?

-
Recibes esto porque te mencionaron.

Responda a este correo electrónico directamente, véalo en GitHub
https://github.com/firebase/firebase-tools/issues/1015#issuecomment-439155616 ,
o silenciar el hilo
https://github.com/notifications/unsubscribe-auth/AAw-atNnP6wSmeHQke6z4EKIsx1D6r7Yks5uvbw_gaJpZM4Ygu-y
.

Si esto ayuda a alguien, puede hacer que sus funciones se ejecuten forzando el puerto mientras tanto. Esto no ayudará a la implementación ni al alojamiento. Ejemplo:
sudo firebase serve --only functions --port = 9000

Mismo problema ... nuestro desarrollo está detenido debido a este problema. Tenemos una aplicación angular alojada con las funciones de base de fuego que sirven al contenido. Supongo que esto tiene que ver con los servicios de base de fuego, pero su panel de estado se muestra en verde. Todo funcionó bien hasta ayer.

Está funcionando ahora, pero con advertencias ...

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

Ya no recibo el error 400 del argumento ilegal, sino otro en su lugar ahora y todavía no se está ejecutando:

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

Ya no recibo el error 400 del argumento ilegal, sino otro en su lugar ahora y todavía no se está ejecutando:

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

Reinicia tu Mac ...

Pruebe firebase serve --only hosting o firebase serve --only functions para solucionar este problema. Buscando una solución para eso ahora.

Yo también tuve el problema; Acabo de reiniciar mi computadora y funciona de nuevo.

@Neilpoulin, ¿no puedes implementar? ¿Qué versión de la CLI está usando y qué error está obteniendo?

@mbleigh Quería darte más detalles ahora que estoy de vuelta en mi computadora:

Específicamente, estoy ejecutando firebase-tools en node. El comando que falla es este:

Cuando encontré este error por primera vez, firbase-tools estaba en la versión 6.0.1 . Luego lo actualicé a 6.1.0 pero el error fue el mismo.

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

donde el error detectado se parece a:

{
  "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 la 1:16 pm MT, ya no veo este error

Hemos revertido una compilación de backend que estaba causando este problema. ¿Puedes probar esto ahora y ver si todavía está roto?

Trabajó para mi

+1 trabajando ahora. Gracias

+1 confirmó que funciona para mí también.

+1 en negocios

@ryanpbrewster sí, está funcionando de nuevo. ¡gracias! ustedes deberían tener algún tipo de prueba e2e para eso

ps: funcionó sin ningún reinicio, pero encontré algunos procesos de nodos colgantes y los maté antes de firebase serve

incluso después de reiniciar, todavía tenía procesos en ejecución de intentos de implementación anteriores. Simplemente subí a la parte superior y los maté manualmente y ahora las herramientas de base de fuego funcionan bien para mí.

+1 todo listo! Muchas gracias.

Gracias a todos por su paciencia. Se ha resuelto el error de argumento no válido.

tratando de resolver el problema durante 5 horas ahora, en 'firebase deploy'.

la función es:

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á directamente fuera de la documentación.

la terminal muestra:

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

Los registros de funciones en la nube muestran:
{"@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"}}}

¿cuál es la solución?
Gracias

@nicoara , abre una nueva edición con la información requerida. Gracias.

tratando de resolver el problema durante 5 horas ahora, en 'firebase deploy'.

la función es:

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á directamente fuera de la documentación.

la terminal muestra:

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

Los registros de funciones en la nube muestran:
{"@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"}}}

¿cuál es la solución?
Gracias

tratando de resolver el problema durante 5 horas ahora, en 'firebase deploy'.

la función es:

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á directamente fuera de la documentación.

la terminal muestra:

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

Los registros de funciones en la nube muestran:
{"@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"}}}

¿cuál es la solución?
Gracias

intente agregar el documento al final de la ruta de referencia de la base de datos. p. ej., / userfollowers / {pushId} / Followers / {follower}

@bkendall comencé un nuevo hilo: https://github.com/firebase/firebase-tools/issues/1317

Ejecuté 'firebase deploy --debug' y encontré un nuevo mensaje.

[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 el cambio no marca la diferencia.

Gracias

Obteniendo el mismo error _ "El campo de tiempo de ejecución no puede estar vacío" _ error:

[2019-06-06T18: 51: 31.127Z] <<< RESPUESTA HTTP 400 varía = X-Origin, Referer, Origin, Accept-Encoding, content-type = application / json; charset = UTF-8, date = Thu, 06 Jun 2019 18:51:30 GMT, server = ESF, cache-control = private, x-xss-protection = 0, x-frame-options = SAMEORIGIN, x-content- escribe-
opciones = nosniff, alt-svc = quic = ": 443"; ma = 2592000; v = "46,44,43,39", aceptar rangos = ninguno, conexión = cerrar
[2019-06-06T18: 51: 31.128Z] <<< HTTP RESPONSE BODY code = 400, message = La solicitud tiene errores, estado = INVALID_ARGUMENT, detalles = [@ type = type.googleapis.com / google.rpc.BadRequest , fieldViolations = [campo = tiempo de ejecución, descripción = El campo de tiempo de ejecución no puede estar vacío.]]

Esto también sucede para los proyectos recién creados que usan npx firebase init al intentar implementar la función de ejemplo hello world.

@stpch , ¿tiene una versión antigua de la CLI? Por favor, mire el n. ° 1317

@stpch , ¿tiene una versión antigua de la CLI? Por favor, mire el n. ° 1317

Estoy usando las últimas versiones:

Mi mal, había una vieja versión firebase-tools instalada a través de yarn que tenía prioridad sobre npx . Está funcionando ahora con la última versión.

¿Fue útil esta página
0 / 5 - 0 calificaciones