Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Cloud Function: Default STARTUP TCP probe failed 1 time consecutively for container "worker" on port 8080. The instance was not started

I am trying to deploy a Google Cloud Function with .NET 6 Framework, and I keep getting this error when I try to deploy. I have tried deploying manually with a zip file, and by using the gcloud tool. I do not have any build errors, I have triple checked my entry point and deploy command and everything is matching up. I have double checked the framework version, and that matches up. I am developing the function in visual studio and deploying from powershell. It was working at first, and then just stopped deploying altogether.

Here is my gcloud command, which I am executing from directly within my FunctionsCollection directory in my VS solution:

gcloud functions deploy streakNotification --gen2 --runtime=dotnet6 --region=us-central1 --trigger-location=nam5 --source=. --entry-point=CloudFunctions.FunctionsCollection.StreakNotification --trigger-event-filters=type=google.cloud.firestore.document.v1.written --trigger-event-filters=database='(default)' ` --trigger-event-filters-path-pattern=document='users/{user}'

These are the logs after I try to deploy. I can't find a log that points to any specific issue, in both the log analytics and the Google Cloud Run window for this function. They all just say this:

ERROR: [0mfailed to launch: determine start command: when there is no default process a command is required

Default STARTUP TCP probe failed 1 time consecutively for container "worker" on port 8080. The instance was not started.

Ready condition status changed to False for Service streaknotification with message: Revision 'streaknotification-00001-xot' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

Here is the namespace for the function I am trying to set as my entry/starting point:

namespace CloudFunctions.FunctionsCollection
{
    [FunctionsStartup(typeof(Startup))]
    public class StreakNotification : ICloudEventFunction<DocumentEventData>
    {
        private readonly ILogger _logger;
        private readonly FirestoreDb _firestoreDb;
        private const string _PrevStreakProperty = "prev_streak";
        private const string _StreakProperty = "streak";
        private const string _UsersCollection = "users";
        public StreakNotification(ILogger<StreakNotification> logger, FirestoreDb firestoreDb)
        {
            _logger = logger;
            _firestoreDb = firestoreDb;
        }

        /// <summary>
        /// Listens to documents in the "users" collection to track streak values. When they increment by 5,
        /// this cloud function triggers a notification to be sent to the user the following morning.
        /// </summary>
        /// <param name="cloudEvent"></param>
        /// <param name="data"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task HandleAsync(CloudEvent cloudEvent, DocumentEventData data, CancellationToken cancellationToken)
        {

If someone could help point me in the right direction it would be much appreciated.

like image 512
Zayum Avatar asked Dec 30 '25 09:12

Zayum


1 Answers

Switch to HTTP Probe (Recommended):

A TCP probe only checks if the container is listening on the port. An HTTP probe makes an actual request to your function's endpoint, providing a more accurate health check. You can configure this in the Firebase console or using the firebase deploy --only --trigger-http functions

like image 163
Jocef Avatar answered Jan 01 '26 00:01

Jocef



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!