Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appengine:deploy fails when using alternate app.yaml file name #992

Open
mr-smithers-excellent opened this issue Sep 28, 2017 · 12 comments
Open

Comments

@mr-smithers-excellent
Copy link

I am attempting to change the name of the app.yaml file to create one config for each of our environments. When running mvn appengine:deploy -Dapp.deploy.deployables=src/main/appengine/dev.yaml I get the following error message:

[INFO] Detected App Engine flexible environment application.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.109 s
[INFO] Finished at: 2017-09-28T11:58:40-07:00
[INFO] Final Memory: 28M/331M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy (default-cli) on project platform-poc: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: app.yaml not found in the App Engine directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Running with -X, I see can that the plugin has received the param:

[DEBUG] Configuring mojo com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy from plugin realm ClassRealm[plugin>com.google.cloud.tools:appengine-maven-plugin:1.3.1, parent: sun.misc.Launcher$AppClassLoader@135fbaa4]
[DEBUG] Configuring mojo 'com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy' with basic configurator -->
[DEBUG]   (f) artifact = /Users/seanpsmith/Projects/aalto-group/platform-poc/target/platform-poc.jar
[DEBUG]   (f) deployables = [/Users/seanpsmith/Projects/aalto-group/platform-poc/src/main/appengine/dev.yaml]
[DEBUG]   (f) dockerDirectory = /Users/seanpsmith/Projects/aalto-group/platform-poc/src/main/docker
[DEBUG]   (f) dockerfilePrimaryDefaultLocation = /Users/seanpsmith/Projects/aalto-group/platform-poc/src/main/docker/Dockerfile
[DEBUG]   (f) dockerfileSecondaryDefaultLocation = /Users/seanpsmith/Projects/aalto-group/platform-poc/src/main/appengine/Dockerfile
[DEBUG]   (f) mavenProject = MavenProject: com.aaltogroup:platform-poc:0.0.1 @ /Users/seanpsmith/Projects/aalto-group/platform-poc/pom.xml
[DEBUG]   (f) pluginDescriptor = Component Descriptor: role: 'org.apache.maven.plugin.Mojo', implementation: 'com.google.cloud.tools.maven.DeployMojo', role hint: 'com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy'
@loosebazooka
Copy link
Contributor

It's convention to have everything work together in a reasonable way. It might be worth revisiting though.

@mr-smithers-excellent
Copy link
Author

@chanseokoh @loosebazooka thanks for the swift responses. Is the standard here to change the directory name appengine/dev/app.yaml instead of the file itself?

@chanseokoh
Copy link
Contributor

chanseokoh commented Sep 28, 2017

@mr-smithers-excellent that will/should work. You will have to copy other configuration files to the directory too, if any.

@loosebazooka
Copy link
Contributor

Yeah the design favors that approach...

@patflynn
Copy link
Contributor

I believe it's more than just our toolchain that's not honoring the documentation here. It does seem like there needs to be a concerted effort to plumb arbitrary filename support or to just update the docs to specify the name must be app.yaml.

@mr-smithers-excellent
Copy link
Author

Specifying the path of the app.yaml doesn't seem to be working either.

mvn appengine:deploy -Dapp.deploy.appEngineDirectory=src/main/appengine/dev produces the same error with app.yaml in directory src/main/appengine/dev - am I missing something here?

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.092 s
[INFO] Finished at: 2017-09-28T13:45:59-07:00
[INFO] Final Memory: 28M/331M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy (default-cli) on project platform-poc: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy failed: app.yaml not found in the App Engine directory. -> [Help 1]

@chanseokoh
Copy link
Contributor

chanseokoh commented Sep 28, 2017

For some dumb reason, you need to use -Dapp.stage.appEngineDirectory=, not -Dapp.deploy.appEngineDirectory=.

@loosebazooka -Dapp.deploy.deployables= doesn't work either when users try to use a different directory than src/main/appengine, which gives the impression that it's broken.

@loosebazooka
Copy link
Contributor

loosebazooka commented Sep 28, 2017

Yeah it's because appEngineDirectory is a configuration parameter of stage and deploy. But they're configured separate on the command line, which I think is my fault when I added in the appEngineDirectory parameter on deploy.

So you can actually configure

src/main/appengine/cron.yaml
src/main/appengine/dev/app.yaml
src/main/appengine/prod/app.yaml

and
appengineStage will pull data from whatever is configured in app.stage.appEngineDirectory
appengineDeploy will look for cron/indexes/whatever.yaml in app.deploy.appEngineDirectory

but this is confusing, and we should probably change the behavior.

@mr-smithers-excellent
Copy link
Author

@chanseokoh your approach works with the -Dapp.stage.appEngineDirectory naming, but I would agree that this use case was not handled in the best way. At a minimum, the docs at https://cloud.google.com/appengine/docs/standard/java/tools/maven-reference#appenginedeploy should be updated to reflect the app.stage.appEngineDirectory user property.

@chanseokoh
Copy link
Contributor

chanseokoh commented Jan 5, 2019

GoogleCloudPlatform/app-maven-plugin#316 marked as a dup of this. GoogleCloudPlatform/app-maven-plugin#316 seems to show more recent error output though.

@chanseokoh chanseokoh reopened this Jan 5, 2019
@Fofofosho
Copy link

Fofofosho commented Apr 30, 2019

For those running this into the error above, it is still relevant and the solution that was suggested in 2017 is still how you need to handle this.

I got the same error when trying to specify another app yaml file for my flex deploy that was named app.sand.yaml. You cannot give it another name, must name it app.yaml but you can put it behind a directory like src/main/appengine/sand/app.yaml. But for this to work you still can't use the app.deploy.appEngineDirectory you must use the stage user property like so:
-Dapp.stage.appEngineDirectory=src/main/appengine/sand

@emmileaf emmileaf removed the p3 label Jun 12, 2023
@JoeWang1127 JoeWang1127 transferred this issue from GoogleCloudPlatform/app-maven-plugin Jan 29, 2024
@zhumin8 zhumin8 added the p3 label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants