GAE SDK for Python 2.5 - google-app-engine

I have an existing app that uses the deprecated Python 2.5 and the deprecated master/slave datastore. According to the docs, I must migrate the datastore to HRD before I can upgrade to Python 2.7. Before I can migrate my M/S datastore to HRD, I need to do some work on the app and test it using the dev server.
However, I upgraded to the most recent version of the SDK (1.8.6), and it does not support Python 2.5. Somebody else encountered this problem and learned that the latest SDK that supports Python 2.5 by default is Python SDK 1.7.5. From where can that be downloaded? Or, is there a way I can make the SDK 1.8.6 work with Python 2.5?

In the 1.8.6 SDK, there's an old_dev_appserver.py that works with Python 2.5. That'll help you along as you migrate.

Dave W. Smith gave me the answer but I didn't know how to implement it until I made a discovery that maybe most people already know, But in case it might be helpful to somebody, I will tell it here:
I do all my GAE/Python/Flex development work in Eclispe, except that I used the launcher for local testing and deploying. (I am command-line adverse.) I discovered that using the PyDev Eclipse plugin it is easy to set up a "run configuration" (under the PyDev "Run" menu) whereby you can set up command line parameters, etc. and run any python program from within Eclipse. I now use that facility for running dev_appserver.py (and when needed for my Python 2.5 app, old_app_devserver.py). I no longer have a need to use the launcher. I also set up a PyDev run configuation to deploy my app and performing various appcfg.py functions (vacuum indexes, etc.).

Related

GAE/J - Moving to Cloud SDK - DataNucleus V1 Support

GAE/J team decided to retire App.cfg and asked everyone to move to Cloud SDK (based Maven or Gradle).
We have been using GAE/J for eight years, and we are using DataNucleus V1.
The reason that we still use DataNucleus V1 is that you can not upgrade to V2 or v3 without losing your information since they are not backward compatible (one to many relationships are not working after upgrade).
From some reason, we can not make DataNucleus V1 work with GAE/J Cloud SDK. Do you know if GAE/J stopped supporting this version? (and only support V2/V3?)
Update
The Ant task enhance-classes is working well if I am using GAE tools jar from version 1.9.6.3, when pointing to the current GAE tools jar (version 1.9.8.0) it fails enhacing classes.
Apparently GAE cloud sdk appengine-java version 1.9.8.0 did not include the following libraries:
google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\lib\opt\tools->
datanucleus\v1(few jars files)
and
datanucleus\v2(few jars files)
The enhancer is looking for these jars in these directory structure which is missing.
Once you add these files and directories it is working well.
I also reported Google cloud team
https://issuetracker.google.com/issues/160624330
Update
After a few days that the issue I opened was confirmed as a "bug" and was assigned, someone decided that the bug is actually "Won't Fix (Intended Behavior)". If someone feels like me that this is a critical issue, please update your thoughts via the issue tracker link.

AppEngine/Go: Using a new version of Go with the SDK

The Go SDK currently ships with Go version is 1.6.2 but the most recent is 1.7.1 . I need some enhancements/bugfixes that were released since 1.6.2 . However, when I replace the goroot directory in the SDK directory that contains Go 1.6.2 with a symlink that points to 1.7.1, I get an error that has to do with not being able to find bin/goapp, which looks to be AppEngine-specific and not provided in the standard Go build.
Does anyone know a way to upgrade the Go available in the AppEngine SDK? Does this mean that the Go in production is also 1.6.2?
Unfortunately you're stuck with the Go version that comes bundled in the latest App Engine Go SDK.
Even if you "switch" it locally with Go 1.7.1 and somehow you manage to compile and run your app with Go 1.7.1 (by adding the missing files from the SDK's Go root), the production environment currently also uses Go 1.6.2, so your app and Go code will run into errors in the live environment when code that is missing from 1.6.2 is referenced. Most likely even the deployment would fail.
Also note that when you deploy your app to App Engine, only the source files are uploaded, and your app is compiled in the cloud. So you can't even "trick" it by compiling it locally and somehow "exclude" source files and upload only the binaries (binaries are not even uploaded).
You can't do anything else but wait for Go 1.7.1 (or a newer version) to make it to the SDK. Note that the Go version bundled in the SDK usually lags a few versions behind, because for it to become the "live" version, it usually needs modifications / altering for the sandboxed environment of App Engine (certain restrictions must be applied / implemented), and it needs further / additional testing / strengthening regarding security.
At this point you should be able to upgrade - App Engine has supported Go 1.8 since 2017 and recently announced early support for 1.9.
In general, though, you're pretty much stuck with the versions supported in production - there's no way to link in your own version of Go to the SDK, and I'd argue that it would be extremely ill-advised to do so even if you could.

Can I run Appengine apps without the goapp tool/builder?

I'm wondering if there is any way to run and test GAE Go apps using the standard go test || go build etc tools and if it's not possible what's the technical reason.
The Go App Engine SDK contains the standard Go packages and tools, but a modified version of them.
The GAE SDK also contains local versions of the GAE platform services API implementations which are not part of the SDK (not even the API). So you can't just use the standard Go SDK. When you build or test with the GAE SDK, the SDK takes care of a context mockup so your app will have everything (or most of the things) required to "feel" it is running in the GAE environment. The SDK also contains the sandbox restrictions that are in effect in the production environment (e.g. you can't write to local files).
Also note that some features of the GAE SDK also rely on a Python runtime (because the Go GAE SDK was created using the existing Python GAE SDK), not everything is rewritten in go.
So taking all these into consideration it would not be feasible to build/test using the standard Go SDK and it is not even possible.

GAE SDK 1.6.4 on Mac with django-nonrel: syncdb won't create the datastore file

first question from newbie. Haven't needed to post a question for months now -- so many great answers already posted. I am stuck on this one, though.
Developing on a Mac, Python 2.7, Django with the django-nonrel project, GAE datastore. Up to and including GAE SDK 1.6.3, all goodness. After upgrading to GAE SDK 1.6.4, noticed 3 strange things:
Dev server (python manage.py runserver) fails immediately with "Error: No module named webob." No other errors or output. I rooted around under /usr/local/google_appengine/lib/... and, indeed, no module named webob. There are two close matches -- webob_0_9 and webob_1_1_1. I made a symlink webob -> webob_1_1_1 to get past the error.
Startup messages from the dev server include an INFO: message that the SDK version is later than the advertised version. Google has 1.6.4 on their download site, so not seeing how my 1.6.4 is later than the latest.
Django's syncdb command (python manage.py syncdb) will no longer create the .gaedata/datastore file. It says it's creating tables, it prompts me for the superuser creds, it even says it installed a bunch of objects from my fixture file. It gives no errors, but when it completes, it has done none of these things -- the .gaedata/datastore file doesn't even exist.
Prior to 1.6.4, syncdb worked great, including loading fixture data. I tried starting a fresh project with only bare bones files in it and a simple model (one class having one field) to see if some complexity I had introduced might be the cause of the problem. Even in simple-land, syncdb wouldn't create the datastore.
My only solution was to fall back to GAE SDK 1.6.3 -- everything works once again. Anyone else seeing similar symptoms with SDK 1.6.4? Are there obvious diagnostic steps I should be taking?
Fixed in latest django-nonrel. Either sync to latest code, or manually integrate this pull request:
https://github.com/django-nonrel/djangoappengine/pull/24
Haven't seen this problem, don't know.
There's a workaround, but it's not merged into the master branch yet, you'll have to manually integrate the changes.
https://github.com/django-nonrel/djangoappengine/pull/25

How to download all datastore entities on Google App Engine?

I've read the GAE docs, and I can't seem to figure out how to download all my entity data.
What I'd love to do is download the whole thing as a big TSV file (or something I can easily munge into one), so I can import my various entities into a spreadsheet and fiddle with them.
But I'm stuck at the starting gate. I don't understand the first few bits of the docs: "This document applies to apps that use the master/slave datastore. If your app uses the High Replication datastore..." -- I'm not even sure which I have, or how I would tell.
Assuming I have the simpler master/slave, the docs continue: "...you can use the Python appcfg.py tool by installing the Java version of the remote_api handler..." but, again, I'm not quite sure what they mean or where I find this appcfg.py tool.
Sorry for such a n00b question, but is there some sort of walk-through? I just want to download my datastore!
Thanks!
Master/Slave is the default (for now), so that's almost certainly what you're using. You can confirm at https://appengine.google.com/ -> app-id -> Administration -> Application Settings -> Datastore Replication Options.
To download your data, first install Remote API for Java, then use appcfg.py to download data:
appcfg.py download_data --application=<app-id> --url=http://<appname>.appspot.com/[remote_api_path] --filename=<data-filename>
There is nothing you need to do other than just follwiong the google's own documentaion. There is no workaround or walkthrough. I am not sure about java. In python , only thing you need to do is enable remote_api in your app.yaml.
appcfg.py can be found inside the root directory of appengine SDK.

Resources