functions-framework-java icon indicating copy to clipboard operation
functions-framework-java copied to clipboard

deploy with maven plugin hangs forever the first time

Open eschultink opened this issue 3 years ago • 0 comments

Console log looks as follows:

[INFO] ------------------------< co.worklytics:project >-------------------------
[INFO] Building project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- function-maven-plugin:0.9.7:deploy (default-cli) @ project ---
Executing Cloud SDK command: gcloud functions deploy project-google-chat --trigger-http --entry-point=co.worklytics.project.Route --service-account=project-google-chat-dwd@project-dev-erik.iam.gserviceaccount.com --env-vars-file=./configs/google-chat.yaml --runtime=java11 --project=project-dev-erik

This is invoked by IntelliJ "Run Configuration".

When I go to terminal and run gcloud functions deploy project-google-chat --trigger-http --entry-point=co.worklytics.project.Route --service-account=project-google-chat-dwd@project-dev-erik.iam.gserviceaccount.com --env-vars-file=./configs/google-chat.yaml --runtime=java11 --project=project-dev-erik

then I get the prompt

Allow unauthenticated invocations of new function [project-google-chat]?
 (y/N)? 

I answer 'N' to that, and everything continues as expected. If I now try the IntelliJ run configuration again, it all works.

I'd blame IntelliJ for not picking up the prompt, yet I tried against having added allowUnauthenticated explicitly to my pom.xml, and the same behavior happens:

                <groupId>com.google.cloud.functions</groupId>
                <artifactId>function-maven-plugin</artifactId>
                <version>0.9.7</version>
                <configuration>
                    <functionTarget>co.worklytics.project.Route</functionTarget>
                    <envVarsFile>./configs/${sourceApi}.yaml</envVarsFile>
                    <projectId>${gcpProjectId}</projectId>
                    <name>project-${sourceApi}</name>
                    <serviceAccount>${serviceAccount}</serviceAccount>
                    <allowUnauthenticated>false</allowUnauthenticated>
                </configuration>

eschultink avatar Oct 01 '21 21:10 eschultink