Deployment error on Google App Engine - Uploading 0 files - google-app-engine

I recently relocated my Eclipse Java GAE project to a different location on my computer. (And both locations are under Dropbox. ) Since then, I've been having issues with deployment. When I make changes to files and save them, sometimes it doesn't recognize the changes and doesn't upload them (so when I deploy through Eclipse, it says uploading 0 files and the live deployment is not updated).
Sometimes it does work (after several clean's and restarts to Eclipse).
Any help on how to fix this would be greatly appreciated, thanks!

It seems solved now, some notes to consider
Ensure that you are not manually modifying (adding/removing) libraries under war/WEB-INF/lib folder. Add to that folder only when you are using the libraries. (I had some unused libraries there)
Ensure that war/bin/classes are cleaned after you clean the project
I reinstalled the plugin as well, just in case

Related

How to add a service worker to an existing, old, react project?

I'm working on an old react project, which I need to add functionality to, but when deploying the react build on the server, it fails, claiming it cannot find several css and js files, although I published all files within the build folder. I tried different things:
First, I kept the old service-worker.js in the production folder the IIS uses, but replaced everything else.
Then, I tried also deleting the service-worker.js, since I thought it was optional, and my npm run build didn't create a service-worker.js file.
Then, I tried copying the service-worker.js file that existed on production, and manually changing it to point to my css and js files in the /static/ folder of my build folder.
All of these solutions have yielded the same result. So I have a few questions:
Is the service worker necessary? If not, could this error relate to something entirely different other than the service worker?
If it is necessary, why could my npm run build command not create the service worker with the rest of the files in the build folder?
If I do need it, how can I manually add it to a project that already exists?
If the production folder already had a service worker, and my build is not building it, I can also assume maybe my react version is newer, but I find that odd, since the computer I use is one an older employee in my company used, and I didn't manually change anything about this project.

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.

Best practices to store "dist" folder on repo for deploy

We are developing a project built with yeoman angular generator. Now appears the need of "puppetize" it for deployment.
Obviusly the machine serving client part should be provided with a compiled (minimified, optimized) version of the angular project. But I have no idea if we should store it on our bitbucket repo -for example on the master branch when tagging a new release-
I couldn't find any post about this practice and I could use some help.
There are some facts about angular minified version:
It is uglificated and minificated, so code is unreadable and hard to change.
It demands compilation with tool like gruntjs, which takes some time to build each time.
It works on server, but when you choose to deploy non minificated, revisioned version, you can have other problems during adding new versions to same repo - scripts have same name and are cached in browser and possible other problems.
You decided to deploy compiled version to a client machine.
If you are using version control like git. you can add to repo a folder with compiled version, so your repository have sources and dist in same folder. Possibly you have also backend code, sometimes in backend code you can add compiled version to host on server. It's better to have all code and builds in one repo, so you can do this with one command.
In my case, i wrote scripts in java, to copy builded folder to another folder. We use also Visual Studio for backend, so i wrote script adding new filenames to .cs file, so it can be visible by continous integration tool.
Going to a final, create new branch in git from release master branch. It is useful to have copy of your partial work.
I don't know how often you have releases, but you can solve it by having branches in git.
So your branches can look like this:
master
release1
release2
...
Assuming you are doing development on master and copying new versions to releases.

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

How to use static files with gae-archetype-objectify-jsp

I am writing my first Google App Engine project, in Java, without GWT. I started off by using the gae-archetype-objectify-jsp archetype to get the skeleton structure of the project, and am using the eclipse plugin to develop and test locally.
Everything is going great (loving objectify in particular) except for one thing: my static files like images and style sheets go missing every time I run the project. I've been putting these under src/main/webapp/, but anything I create there automatically gets deleted on build.
Is there something else I am supposed to do with static files?
Cheers,
Dave
It goes in a subfolder under war/
For dealing with static files, you should really see this... https://developers.google.com/appengine/docs/java/gettingstarted/staticfiles
It's a little disconcerting that src files are being deleted on build. I don't think that should be happening. What do you have your "Default output folder" set to? (It's found in the Java Build Path --> Source (under eclipse) Shouldn't it be something like project_name/war/WEB-INF/classes. Of course it may be your maven system that is doing it and not Eclipse.

Resources