Find GAE Datastore entities by application ID - google-app-engine

I transferred a bunch of entities from one application to another. For most of them, the "application" part of the entity key got successfully converted from s~old-app to s~new-app. However, there are some bad apples that didn't get converted, causing new-app to throw errors like BadRequestError: app s~old-app cannot access app s~new-app's data.
How can I find these items and fix them?

Related

Auto creation of entities in blobuploadsession datastore when using upload to url functionality in blob datastore

I'm wondering if deletion of these entities in blobuploadsession would affect my app functionality or performance in any which way. The reason for deletion is when a new form is created and there were no files that were uploaded to, then it results in unnecessary entities being created.
(edit: additional info from comment)
I use blobstore (part of NDB) to store images asynchronously via upload URL functionality. When I run the app on localhost, there is an auto-creation of a datastore called "BlobUploadSession". This is the entity where all the URLs for the images to be uploaded are stored as entities. When I upload a photo to the URL, it goes into the "BlobInfo" datastore. Now, I don't have a need of the URLs since the photo has already been uploaded. So, I'm wondering if I can delete the BlobUploadSession entities? Btw, BlobUploadSession and BlobInfo are default datastores automatically created.
The __BlobUploadSession__ and __BlobInfo__ entities are created by and only internally used by the development server while emulating the blobstore functionality.
There are others, similarly named __SomeEntityName__ entities for emulating other pieces of functionality, for example a pile of them are created when you're requesting datastore stats (such function doesn't exist per-se in production).
These entities aren't created on GAE, so no need to worry about them in production.
See also related How to remove built-in kinds' names in google datastore using kind queries

Developers Console, datastore query: No Entity Found due to space in entity name

Recently, it seems like Google made a change to the cloud datastore viewer, such that now, I can't click on any entities that contain a space ' ' in their name, to edit them. For example, when I click on an entity 'code User' it pops up an error like this:
No Entity Found We could not find an entity with namespace: ""
(Default Namespace), kind: "User", and identifier
"name=aziLYeJdTTF2Ojdvu-PbT5g"
However, I could still edit entities with no space, such as 'code_User'.
Looking at the URL:
https://console.developers.google.com/project/landshark-zenkoi-code/datastore/editentity/?key=%2Fcode%20User%20name%3AaziLYeJdTTF2Ojdvu-PbT5g
I deduce that spaces in our entity names, e.g. "code User" don't work with the updated google datastore viewer, because they use space to separate kind and entity IDs in the URL now. I've tried enclosing the kind name with %3F ("), but that doesn't help.
Fortunately, the workaround is to use the old website at https://appengine.google.com/. Editing of cloud datastore entities containing spaces still work here. Hopefully this won't get decommissioned anytime soon.
Will there be a bug fix to allow us to, once again, use the new datastore query page with entities that have spaces in their name?

Retaining original app name after a high replication datastore migration

I seem to have 2 separate applications on GAE, the original one with the fictitious name xyz and an hrd one with the name xyz-hrd. I only want one with the name xyz but I want it to use the high resolution datastore. I am trying to use the instructions here.
I am near the end of the HRD migration stage on xyz and have clicked on "Activate Read-only". In step 11 the instructions say the following.
You will be notified when the migration tool is ready to alias the application (by email if you chose that, or by a message when your refresh the browser window). Click Finish Migration to complete the migration. At this point, the new HRD application begins serving incoming requests.
When I launch xyz at appspot.com, there are no changes.
When I launch xyz-hrd at appspot.com, there are changes, but only new data items.
Do I click on "Finish Migration" or not, and when I do, how will I get all the changes and all of the data items under the application name xyz? I am very nervous about this because the instructions say there is not way to revert after clicking on "Finish Migration".
By the way, in my "dashboard" I can select from among my applications which lists both xyz and xyz-hrd. When I select xyz I (still) see 2 warnings, but no warnings are present when I select xyz-hrd. Below are the 2 warnings.
A version of this application is using the Python 2.5 runtime, which is deprecated!
This application is using the Master/Slave datastore which is deprecated!
There is no way to reclaim the old app url for the new one. I know, its lame.
To avoid that in the future, map the appspot to a google apps domain so it has a fixed url.
For now, at most you can upload a new version to the old app which redirects to the new one.
Before migration you are supposed to stop using the old one by making it readonly. Otherwise changes there wont migrate.

Deleted Datastore entries reappear

I'd like to re-open Deleted Datastore entries reappear as a registered user. Can the old question be deleted?
I'll try to be more specific this time. I'm experiencing the following problem:
Initially I put N entities of the same kind into the Datastore like that:
datastore_entity = MyModel(model_property=property_value)
datastore_entity.put()
Afterwards I delete them. I have used the Datastore Admin interface as well as a self-defined handler for the mapreduce library in order to do so. The deleted entities do not appear neither in the Datastore viewer nor in the Datastore Admin view.
When I put even just one new single entity of this kind into the Datastore, the old Datastore entities reappear in the Datastore Admin view while the new entity does not (judging by the number of entities). On the contrary, the Datastore viewer correctly reflects the Datastore state. A query also returns only the newly created entity.
There are no tasks at the time the new entity is being put into the Datastore.
I'm also not encountering this problem on my local machine where I'm using the --clean_datastore option when starting the server.
The Datastore Admin and Datastore Statistics are not "live". The Datastore viewer offers a live view.
Check "Entity statistics last updated..." and you will notice the difference.
If the old entities are not visible in the Datastore viewer - no need to worry. Eventually the statistics will be updated.

Deleted Datastore entries reappear [duplicate]

I'd like to re-open Deleted Datastore entries reappear as a registered user. Can the old question be deleted?
I'll try to be more specific this time. I'm experiencing the following problem:
Initially I put N entities of the same kind into the Datastore like that:
datastore_entity = MyModel(model_property=property_value)
datastore_entity.put()
Afterwards I delete them. I have used the Datastore Admin interface as well as a self-defined handler for the mapreduce library in order to do so. The deleted entities do not appear neither in the Datastore viewer nor in the Datastore Admin view.
When I put even just one new single entity of this kind into the Datastore, the old Datastore entities reappear in the Datastore Admin view while the new entity does not (judging by the number of entities). On the contrary, the Datastore viewer correctly reflects the Datastore state. A query also returns only the newly created entity.
There are no tasks at the time the new entity is being put into the Datastore.
I'm also not encountering this problem on my local machine where I'm using the --clean_datastore option when starting the server.
The Datastore Admin and Datastore Statistics are not "live". The Datastore viewer offers a live view.
Check "Entity statistics last updated..." and you will notice the difference.
If the old entities are not visible in the Datastore viewer - no need to worry. Eventually the statistics will be updated.

Resources