Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

cloud run functions doesnt even print

hi, i tried default functions and upon deployment it doesnt print in the logs, the function ran succefully with green v but nothing is printed, what am i missing?

0 2 251
2 REPLIES 2

Hi @roni1997,

Welcome to the Google Cloud community!

I understand that you recently deployed a Cloud Run Function, and that you recently noticed that the function itself wasn't detectable through logs.

From the issue description, there are a few areas surrounding this issue that are still in need of clarification. For initial diagnosis and troubleshooting tips though, you can explore the following:

  • Test the function: Consider doing a few more tests with your function through writing runtime logs (like console.log() or console.error() statements) and viewing runtime logs. If there are issues viewing function logs through the console, you can use GCloud CLI to further test if the function runs well. Take note of the different ways when triggering a function. If it's event-based, make sure that the condition has been met before that function gets triggered, or a direct call via HTTP has been successful.
  • Utilize Logging Dashboard: Consider typing in filter logs these things: “cloud_run_revision” and “cloud_functions”. This will let you verify if the function has been created and then executed successfully.
  • Verify if the code of that function finishes its work: If the function executes asynchronously, you need to see to it that it’s not hanging and that the tasks in the function have been executed properly. This can cause issues for that function in printing its desired output in the logs properly. You may view the troubleshooting advice from this documentation or from this similar forum.

Hope this helps!

It sounds like the issue might be due to how logs are being handled in your Cloud Run function. Ensure that you’re using console.log() (for Node.js) or the equivalent logging method for your programming language to print statements. Also, check your logging level in Cloud Run; sometimes filtering settings might hide specific log entries. If logging still doesn’t appear, try deploying the function again, as there may have been a temporary issue. Let me know if this helps or if you need further assistance!