Closed brian-sysmirror closed 3 years ago
I can't reproduce this - I've just tried exactly your code and your deployment command line, and it was fine.
Did you have a look at the logs as suggested in the output? If you could include those logs here it would help us to diagnose what's wrong. (If you could include your project file as well, that would help.)
If you run locally with dotnet run
does the function start okay?
Closing due to lack of further information. If this is still causing problems, please add another comment with more information and I'll reopen it.
Steps
Here's the output of the command.
Deploying function (may take a while - up to 2 minutes)...- For Cloud Build Stackdriver Logs, visit: {removed} Deploying function (may take a while - up to 2 minutes)...failed. ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.
Function class: