Code Monkey home page Code Monkey logo

Comments (13)

unxavi avatar unxavi commented on August 16, 2024 2

@KSiejka i am not trying to downgrade anything, before #7341 start to hit error this morning, the same codebase was deploying.

This is the same codebase that is using a v2 function and it was deploying some hours ago and no changes has occur on the dependencies (which are latests) and not change on the code, but thanks for your comment anyways

from firebase-tools.

unxavi avatar unxavi commented on August 16, 2024 1

@KSiejka without debug I am hitting this:

Error: Cannot set CPU on the functions my-Function-onCreate because they are GCF gen 1

from firebase-tools.

becjit avatar becjit commented on August 16, 2024 1

from firebase-tools.

google-oss-bot avatar google-oss-bot commented on August 16, 2024

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

from firebase-tools.

KSiejka avatar KSiejka commented on August 16, 2024

Can you run firebase deploy --debug and check the error logs? It works fine on my end, and all of my function's names use camelCase.

from firebase-tools.

KSiejka avatar KSiejka commented on August 16, 2024

@KSiejka without debug I am hitting this:

Error: Cannot set CPU on the functions my-Function-onCreate because they are GCF gen 1

According to this comment you are trying to downgrade function from v2 to v1. If that's not the case, make sure your firebase-tools are upgraded to the newest version and try importing the v2 functions library to force it to be V2.

from firebase-tools.

jesus-mg-ios avatar jesus-mg-ios commented on August 16, 2024

Same here, Is there any ETA fix on this?

from firebase-tools.

becjit avatar becjit commented on August 16, 2024

I downgraded firebase-tools to 11.x and it started working

from firebase-tools.

unxavi avatar unxavi commented on August 16, 2024

this is working for me now with the latests firebase-tools

from firebase-tools.

aalej avatar aalej commented on August 16, 2024

Hey folks, I’m currently trying to reproduce this issue. Similar to @KSiejka, I’m able to deploy functions without any issues. For those still encountering this, could you please provide code snippets of the functions you’re trying to deploy?

From what I can gather based on the report, functions names with uppercase letters like below should raise issues during deployments:

const { onRequest } = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");
const { onDocumentCreated } = require("firebase-functions/v2/firestore");

exports.helloWorld = onRequest((request, response) => {
   logger.info("Hello logs!", { structuredData: true });
   response.send("Hello from Firebase!");
});

exports.myFunctionOnCreate = onDocumentCreated("users/{userId}", (event) => {
   const snapshot = event.data;
   if (!snapshot) {
       console.log("No data associated with the event");
       return;
   }
   const data = snapshot.data();
   const name = data.name;
   logger.info("Username:", name);
});

Please let me know if I’m missing anything here. I’m using firebase-tools v13.11.2 for deploying functions.

from firebase-tools.

unxavi avatar unxavi commented on August 16, 2024

Right now for me is working back again and I have my functions with uppercase letters, for example: "user-Profile-onCreate"

from firebase-tools.

becjit avatar becjit commented on August 16, 2024

Hey folks, I’m currently trying to reproduce this issue. Similar to @KSiejka, I’m able to deploy functions without any issues. For those still encountering this, could you please provide code snippets of the functions you’re trying to deploy?

From what I can gather based on the report, functions names with uppercase letters like below should raise issues during deployments:

const { onRequest } = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");
const { onDocumentCreated } = require("firebase-functions/v2/firestore");

exports.helloWorld = onRequest((request, response) => {
   logger.info("Hello logs!", { structuredData: true });
   response.send("Hello from Firebase!");
});

exports.myFunctionOnCreate = onDocumentCreated("users/{userId}", (event) => {
   const snapshot = event.data;
   if (!snapshot) {
       console.log("No data associated with the event");
       return;
   }
   const data = snapshot.data();
   const name = data.name;
   logger.info("Username:", name);
});

Please let me know if I’m missing anything here. I’m using firebase-tools v13.11.2 for deploying functions.

This was causing issue

from firebase-tools.

aalej avatar aalej commented on August 16, 2024

I’m still unable to reproduce the issue. Any chance you could try running firebase deploy --debug while using firebase-tools v13.11.2 to see if the issue would still persist? If the issue still occurs, could you share the contents of the firebase-debug.log file? Please remove any personal identifiable information(PII) before sharing.

Also, I can’t seem to find the exact error message you shared. The closest error message I could find was from

export function functionIdsAreValid(functions: { id: string; platform: string }[]): void {
// TODO: cannot end with a _ or -
const functionName = /^[a-zA-Z][a-zA-Z0-9_-]{0,62}$/;
const invalidIds = functions.filter((fn) => !functionName.test(fn.id));
if (invalidIds.length !== 0) {
const msg =
`${invalidIds.map((f) => f.id).join(", ")} function name(s) can only contain letters, ` +
`numbers, hyphens, and not exceed 62 characters in length`;
throw new FirebaseError(msg);
}
}

But this would raise an error similar to

Error: <INVALID_FUNCTION_NAME> function name(s) can only contain letters, numbers, hyphens, and not exceed 62 characters in length

Could you check if you’re using an older version of firebase-tools? The naming restriction was lifted in v11.29.0.

from firebase-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.