简体   繁体   中英

Cloud Run - "./mvnw: permission denied" error on deployment

I'm following the quickstart guide for deploying a Spring Boot service to Cloud Run. When I run gcloud run deploy , it fails with this error:

[builder] Failure: (ID: dc066188) executing command "./mvnw clean package --batch-mode -DskipTests -Dhttp.keepAlive=false -f=pom.xml --quiet": fork/exec./mvnw: permission denied

I'm new to Cloud so I don't really know what I'm looking for. Searching has turned up a couple leads but the instructions don't quite map to my project:

  • Various suggestions to run chmod=+x mvnw , but I'm on Windows and not sure where to put this. I'm trying with both the CLI and the VS Code extension.
  • The instructions have a blurb about owner permissions being required, but I'm not sure whether this configuration is correct:

服务帐号权限

Anybody have any suggestions? Thanks!

The error that you have mentioned is definitely indicating an access issue with the maven package installation step during the build.As also according to comments you seem to be able to build it successfully with Cloud shell, which does point that the initial installation had breakage due to dependencies not being configured properly.To prevent this issue make sure the maven and gradle wrappers have the proper line endings, check code samples on the link here .
Checkout this helpful thread for sample java maven buildpack samples.
Try out as below and see if it works and make verification to your buildpack accordingly
gcloud run deploy sample-java-mvn --source
And as you are working with Windows and buildpack implementations, there seems to be a problem with the wrapper which is using Windows' line endings instead of unix style.
You can try to fix this using a find and replace on the mvnwrapper before we invoke it in the maven buildpack

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM