Edit by @whipermr5: Write a custom gradle task that encompasses ./gradlew appengineDeploy appengineDeployCron appengineDeployIndex appengineDeployQueue and update the instructions in development.md.
When trying to log in as instructor in my app teammates-shradheya.appspot.com
I am getting the following error after I add an instructor and attempt to join as instructor using the unique link mentioned in the email sent and then logging in using the google account( Note: I have used a different Google account than the one i used to set up the GCP, it is the account on which I got the email of the instructor joining link)

I am not sure what could be the reason as to why I am not able to access the instructor page.
If you have multiple Google accounts, you should logout from all except the one you want to use for the instructor.
Note that you can go to https://console.cloud.google.com to check the logs.
I tried logging out and using only the necessary account but it still showed me the error webpage.
On looking up the logs, I found the following:
com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found. recommended index is: - kind: Instructor properties: - name: googleId - name: isArchived The suggested index for this query is: <datastore-index kind="Instructor" ancestor="false" source="manual"> <property name="googleId" direction="asc"/> <property name="isArchived" direction="asc"/> </datastore-index>
at teammates.storage.api.EntitiesDb.makeAttributes (EntitiesDb.java:300)
at teammates.storage.api.InstructorsDb.getInstructorsForGoogleId (InstructorsDb.java:186)
at teammates.logic.core.InstructorsLogic.getInstructorsForGoogleId (InstructorsLogic.java:134)
at teammates.logic.core.CoursesLogic.getCoursesSummaryWithoutStatsForInstructor (CoursesLogic.java:587)
at teammates.logic.api.Logic.getCourseSummariesWithoutStatsForInstructor (Logic.java:583)
at teammates.ui.controller.InstructorHomePageAction.loadPage (InstructorHomePageAction.java:52)
at teammates.ui.controller.InstructorHomePageAction.execute (InstructorHomePageAction.java:31)
...
This is the error which happened on multiple occurences of me trying out using different accounts. Not able to understand what could the issue be.
@tshradheya I suspect you did not deploy the datastore indexes. It seems our instructions might be a little lacking.
Can you give more instructions as to how to deploy datastore indexes?
It used to be the case that xml files describing the indexes are auto-created by the dev server. What I used to do was to run the full test suite against the dev server which auto-generates all indexes needed by functionalities covered by the test cases. After that, deploying to the staging server ensures that the index files are also replicated in the dev server. You can give that a try.
I might know what's going on, but I need to confirm something first. @tshradheya can you go to your app engine debug console (URL should be https://console.cloud.google.com/debug?project=teammates-shradheya), and tell me what are the files contained in the app-engine:/WEB-INF/appengine-generated folder?
The following are the files in /app-generated
The following is the data inside the index.yaml file
indexes:
- kind: "Instructor"
properties:
- name: "googleId"
direction: asc
- name: "isArchived"
direction: asc
- kind: "AdminEmail"
properties:
- name: "isInTrashBin"
direction: asc
- name: "sendDate"
direction: asc
- kind: "FeedbackSession"
properties:
- name: "isClosingEmailEnabled"
direction: asc
- name: "sentClosedEmail"
direction: asc
- name: "endTime"
direction: asc
- kind: "FeedbackSession"
properties:
- name: "isClosingEmailEnabled"
direction: asc
- name: "sentClosingEmail"
direction: asc
- name: "endTime"
direction: asc
- kind: "FeedbackSession"
properties:
- name: "sentOpenEmail"
direction: asc
- name: "startTime"
direction: asc
- kind: "FeedbackSession"
properties:
- name: "isPublishedEmailEnabled"
direction: asc
- name: "sentPublishedEmail"
direction: asc
- name: "feedbackSessionType"
direction: asc
@tshradheya thanks, turns out it is not what I thought. Can you tell me the contents of your app's indexes as found in https://console.cloud.google.com/datastore/indexes?project=teammates-shradheya?
As suggested, going on the following link shows me that my app has not composite indexes.

Is there something wrong in this?
Expected:

Did you try the workaround of deploying again after running the test suite?
I was able to reproduce the problem. Turns out that the new AppEngine gradle plugin doesn't automatically deploy indexes when one does ./gradlew appengineDeploy. To fix, one also has to run ./gradlew appengineDeployIndex.
This will begin the indexing process:

It should look like this once complete:

There should be no need to run the test suite as this was fixed in #7514.
The new AppEngine gradle plugin doesn't automatically deploy indexes when one does
./gradlew appengineDeploy
That was what I thought until I see that index.yaml exists. Looks like it's a different thing altogether?
I kind of expect this problem to occur sooner or later, good that it surfaces now. This should also mean that cron jobs and task queue configs are also not deployed? @whipermr5 mind doing a check?
@wkurniawan07 Yup, all three not deployed even though all three .yaml files are correctly generated and in place.
@whipermr5 great, this clears the doubts I have months back.
Anyway, on this topic, I'd suggest making a custom Gradle task that depends on all three. It won't really be fun for anyone to type ./gradlew appengineDeploy appengineDeployCron appengineDeployIndex appengineDeployQueue for every deployment, and who knows if we're going to utilize appengineDeployDos and appengineDeployDispatch in the future.
@wkurniawan07 Sounds good!
Now to find out the behaviour of deployments from the IDEs.
Just going to provide some context here.
Most helpful comment
@whipermr5 great, this clears the doubts I have months back.
Anyway, on this topic, I'd suggest making a custom Gradle task that depends on all three. It won't really be fun for anyone to type
./gradlew appengineDeploy appengineDeployCron appengineDeployIndex appengineDeployQueuefor every deployment, and who knows if we're going to utilizeappengineDeployDosandappengineDeployDispatchin the future.