Cannot search for Private/Archived repos when Elasticsearch is enabled on Gitlab-ee
Yesterday I rolled out a completely fresh Elasticsearch cluster, created the empty indices via rake, created the indices via rake and enabled every Elasticsearch option in Gitlab-EEs admin settings (including the beta indexer to which I installed the necessary package).
Shortly after I had complaints that my users could not find repos that they had previously searched for with no problems. After testing I realized that any repository that was set to Private or Archived would not show up in the search. If I unprivated the repo it would show up. If I disabled Elasticsearch it would show up also. These users are members (in fact sometimes owners) of the private groups. The search on the top right will work, but the search on $gitserver.com/search does not.
I've had these problems since 8.x (don't remember which version, I've had this disabled for awhile) and Elasticsearch 2.1 but yesterday I upgraded Gitlab to 9.4.5 and made a new ES server with 5.1 and had the same issue. I've also tested this with and without the beta indexer enabled.