Avoiding index.yaml changes when using dev_appserver

112 views
Skip to first unread message

dir Ls

unread,
May 14, 2019, 2:54:00 AM5/14/19
to Google App Engine
I have a problem where the index.yaml file keeps changing on my local which triggers a restart of the server. It seems like there is no way to tell the cloud datastore emulator to not update the index file. I manually update store_index_configuration_on_disk to false in cloud_emulator_manager.py but is there a better way?

George (Cloud Platform Support)

unread,
May 14, 2019, 10:24:31 AM5/14/19
to Google App Engine
This is expected functionality: the development web server (dev_appserver.py) automatically adds items to this file when the application tries to execute a query that needs an index that does not have an appropriate entry in the configuration file. You may find related detail in the "Creating indexes using the development server" sub-chapter of the "Configuring Datastore Indexes" documentation page. Setting the store_index_configuration_on_disk parameter seems to be an effective way to stop the server from updating the index.yaml configuration file. How would you like to see this option set? What would come more handy? 

dir Ls

unread,
May 14, 2019, 12:19:09 PM5/14/19
to Google App Engine
I think there are multiple issues.

1) I got all the indexes created, moved it above the "# AUTOGENERATED" and can confirm these indexes in the console. So, even when there are no net new indexes getting added, the file keeps getting updated.
2) Regarding how to set, there is already a "--require_indexes" which if set should be erroring out when a new index is required. So, if this is set, then it shouldn't update the index file, isn't it?

Aref Amiri (Cloud Platform Support)

unread,
May 16, 2019, 5:42:51 PM5/16/19
to Google App Engine
All index definition above AUTOGENERATED line are under manual control and would not be updated by the development webserver, and the changes will apply to only indexes below the line. Moreover, as George suggested, setting store_index_configuration_on_disk parameter to false can also stop the webserver from updating the index.yaml file.

As for "--require_indexes", by default it is set to "no" and it basically disables the automatic generation of entries in the index.yaml and it will only raise an exception,when running a query and the index is not defined.

If you are experiencing an issue and the functionalities are not working as expected, I'd suggest to create a Public Issue Tracker, and provide additional information as well as steps to reproduce, and we shall investigate it further.
Reply all
Reply to author
Forward
0 new messages