GAE: No longer able to update my Gaelyk project due to appcfg losing support - google-app-engine

Recently tried to update my Gaelyk project (yes, it's old, but it works well and I still use it), but Google App Engine will no longer accept the update. The error message returned is "Deployments using appcfg are no longer supported. See https://cloud.google.com/appengine/docs/deprecations". The thing is, I never used appcfg to deploy my application; I used Gaelyk and Gradle. But obviously Gaelyk must have used appcfg under the covers.
I did download the replacement Google Cloud SDK, but this new tool is not similar at all to how Gaelyk and Gradle worked. Is there anything I can do to get Gaelyk to work anymore? Or is Gaelyk just dead and I need to rewrite my application (like in Node.js or something instead of Groovy).

This will be hard, however I will try to help you as possible. I think you may try to migrate it somehow to app.yaml configuration of GAE.
I am not sure what plugins are used in the project. From Gaelyk temple project I can see that it's using appengine-geb which, according to the documentation, behind the scenes, is using gradle-appengine-plugin (there is wrong link on this doc, but proper is bellow).
On the github of gradle-appengine-plugin I have found following.
There is a note:
NOTE: All App Engine users are encouraged to transition to the new
gradle plugin for their projects.
And in FAQ part there is following information:
How do I deploy with gcloud?
If you're using gcloud to deploy your application, the newest version of app deploy > doesn't support war
directories, you will need to provide it with an app.yaml OR you can
use the appengineStage task to create a directory that is deployable
in /build/staged-app
$ ./gradlew appengineStage
$ gcloud app deploy build/staged-app/app.yaml --project [app id]
--version [some version]
NOTES:
You must explicitly define all config files your want to upload
(cron.yaml, etc)
This does not work with EAR formatted projects.
I think the best option will be to migrate to new appenine plugin or if not possible try to implement is with gcloud app deploy command crating the config files manually (at least app.yaml). And for this migration I can provide you this document.
I hope you will manage somehow...

I can confirm that Serge's answer on the Gaelyk Groups site works; the same procedure that he figured out also worked for me. To summarize:
Run gradlew appengineRun as run previously with Gaelyk.
Copy all jar files inside the build\exploded-app\WEB-INF\lib folder into a \src\main\webapp\web-inf\lib folder (for me the new lib folder did not exist previously).
To deploy, use the new required gcloud tool, and instead of running gradlew appengineUpdate (which fails now), instead run
gcloud app deploy appengine-web.xml where that XML file can be found in your webapp/WEB-INF directory. I navigated to that directory to run the gcloud command, but you can use a relative path there if your working directory is elsewhere. (There are a number of optional flags associated with the gcloud app deploy command, but I didn't need any of them.)
Serge needed to use these instructions to convert datastore-indexes.xml to index.yaml and run gcloud app deploy index.yaml, however, I didn't need to do this because I had no datastores.

Related

Intellij Keeps Telling Me "App Engine SDK path is not correct.'

Trying to deploy my first Google Cloud Java app using Intellij. I've followed and read so many threads and have gotten absolutely nowhere on what is seemingly one of the simplest steps of getting this set up. I have installed gcloud CLI and followed the instructions here. After installing, I run the commands 'gcloud components update' and 'gcloud components install app-engine-java'. I see the folder located in both 'C:\Users<username>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine' and 'C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine'. I installed as multi user after hours of trying to get the single user install working, so now I have both. When in Intellij I am creating a new Google App Engine project under Java EE, it asks to specify a Google app engine SDK. There are no options so I choose to select the path. I have tried both above paths and it only tells me 'App Engine SDK path is not correct'. What am I doing wrong?? The steps seem ridiculously simple and it just doesn't work.
You stopped at the general google app engine folder
You need to specify the full path to the java-sdk folder, see the image in this question.

gcloud deploy does not upload new files

I just stumbled on the following issue in App Engine Standard with a Python 2.7 enviroment
So I deployed to my test environment yesterday and today I had the idea of updating one of my applications. I do my normal "gcloud deploy ... " and it says updating 3 files ... While I actually changed a bunch of files. Basically my deploy command says the files are not changed.
After some searching around I found that files are being uploaded to a staging area and checked with a hash. Is it safe to actually clear this staging area, or does the gcloud command have some secret force option to actually force the files to be renewed.
The gcloud command has not given any errors what so ever, nor was it aborted at some point of deployment or something. So I have no errors, but my files aren't uploaded at all. I also tried modifying alot of files, and nothing changed
I never use the promote option for these rare cases that a deploy might fail
So anyone encountered this before, or has a solution to this issue ?
I also was encountering this and the only solution I could find was to deploy to a new bucket. To do this:
go to https://console.cloud.google.com/storage/browser and create a new bucket
redeploy using gcloud app deploy --bucket gs://your-new-bucket. (Change your-new-bucket to the actual bucket name)
This uploaded all the files again and created a new version in App Engine.
You can Go to https://console.cloud.google.com/storage/browser and delete your application bucket, on the next deploy it will be recreated. Additionally you can use the parameter --verbosity=info to check which files are being uploaded.

GoogleAppEngine wordpress complains (Could not create directory) on update and plugin install

I have a problem updating wordpress or installing wordpress plugin in my local version of google app engine. I get the following message.
Downloading install package from
https://downloads.wordpress.org/plugin/event-espresso-decaf.4.8.38.decaf.zip…
Unpacking the package…
Could not create directory.
With the same code base I am able install plugin using MAMP (Macintosh, Apache, MySQL, and PHP). However fails with google Pyton script (dev_appserver.py).
I tried changing the permission of the file system by giving privilege to all user for write. Tried executing as sudo dev_appserver.py .. Followed the advice in other post, No luck.
Whats the problem here?, With MAMP all looks good in my local, but the same code break as I deploy to GAE (​appcfg.py -A APP-ID update app.yaml). Whats the problem here
Cannot write to file on Google App Engine Dev server with PHP?
Staring SDK 1.9.18, dev_appserver disables local file writing by default to better simulate the production environment. You can enable file writing by adding "google_app_engine.disable_readonly_filesystem=1" to your php.ini file.
I also wrote a blog post about running WordPress on App Engine flexible environment at:
https://wp.gaeflex.ninja/2016/03/25/using-wordpress-multisite/
Please give it a try too.

Which version of Eclipse works with PHP Google App Engine?

I've search in vain for about a month now and I can't get my PHP application pushed to Google App Engine, for the PHP platform. I've got the Java version set up nicely on my computer. I followed the instructions for GAE PHP here: https://developers.google.com/appengine/docs/php/gettingstarted/introduction
..but it's really confusing because it essentially tells me to install Eclipse made for PHP which is Luna, but the only versions of Eclipse that GAE supports is Kepler, Juno and Indigo (https://developers.google.com/eclipse/docs/getting_started), so I'm super confused.
I don't think you can install two different GAE plugins on a standard version of Eclipse (which is what I use for the Java GAE plugin).
I also tried (in vain, but it was worth a shot) to upload my app using my Java plugin/setup and obviously this was a terrible idea because all it does is just print the php script/code to the browser.
Any thoughts, brothas/sistas?
I have figured out how to push php files to GAE. There are essentially 3 ways.
Use appcfg.py. Run following command:
--appcfg.py update helloworld/, where helloworld is replaced by the name of the folder containing your project files. Make sure the path is relative to appcfg.py directory or an absolute path.
--Enter your Google username and password at the prompts.
**2. Use the App Engine Launcher, probably found in C:\Program Files (x86)\Google\google_appengine\launcher. Executable is called GoogleAppEngineLauncher.exe. Simply select the project in Launcher and click Deploy.
**3. Use Git. Create a local repository on your machine. Add a repo to your Github account, and follow these instructions: https://developers.google.com/appengine/docs/push-to-deploy#creating_a_cloud_project
**4. Use PhPStorm. Download PHPStorm for free for 30 days, or buy a student version/whatever version you quality for here: . Then follow these instructions: http://confluence.jetbrains.com/display/PhpStorm/Getting+Started+with+PhpStorm+as+Google+App+Engine+PHP+IDE. The only thing I haven't figured out is #5 - where to find the php-cgi.exe file. I can't provide a path for a file I don't have.
** denotes super easy and I have used successfully.
The Google Plugin for Eclipse is only for Java applications. For PHP applications, you'll want to use the Python/PHP SDK and either the command-line tools or the Launcher UI app for running the development server. You can still use Eclipse for editing your PHP source files.
RE #5 - "I can't provide a path for a file I don't have".
That was also my problem.
They are fond of pointing out that the SDK directory should contain dev_appserver.py and ‘google’ and ‘php’ packages but you don't find those in a simple search cause they are invisible. You have to muck through the installation directory.

Pycharm Run server error no app.yaml file at '.' for google app engine project

I'm pretty new with Pycharm and since this morning i have tried different configuration to use the Run command with an existing Google app engine project but without success.
I have a pretty clear error :)
google.appengine.tools.devappserver2.errors.AppConfigNotFoundError: no app.yaml file at '.'
Nothing wrong with that because the existing project use a custom file call app_dev.yaml. So it's normal that Pycharm is unable to load the server.
How can i change this behaviour and tell Pycharm to use app_dev.yaml instead of app.yaml?
Is it possible?
Thanks
I input an app.yaml on root directory and reloading my project, this working for me.
While the PY-9714 issue was, indeed, closed without a resolution, the automatic '.' added to the Run configuration has been reconsidered in PY-10675 in light of GAE support for multiple modules/services inside the same application and/or request routing using a dispatch.yaml file.
So in the more recent PyCharm versions it's possible to specify one or more .yaml files as options in the Run configuration. See for an example Pycharm multiple modules Run server
For those still running an older Pycharm version without the fix, a solution using a wrapper script is described in Run App Engine development server with modules in PyCharm

Resources