1

Referring to the Documentation on Google Cloud Java, trying to access features using FeaturestoreOnlineServingServiceClient Service as per the document.

Relevant bits of code

try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
        FeaturestoreOnlineServingServiceClient.create()) {
      String gcpProject = this.featureStoreConfig.getProject();
      String featureStoreName = this.featureStoreConfig.getFeatureStoreName();
      String featureStoreLocation = this.featureStoreConfig.getLocation();
      EntityTypeName entityTypeName =
          EntityTypeName.of(gcpProject, featureStoreLocation, featureStoreName, entityType);

      System.out.println(entityTypeName);

      ReadFeatureValuesResponse response =
          featurestoreOnlineServingServiceClient.readFeatureValues(entityTypeName);

The code crashes on readFeatureValues

Relevant bits of Error

Failed to complete request: com.google.api.gax.rpc.UnimplementedException: io.grpc.StatusRuntimeException: UNIMPLEMENTED: HTTP status code 404
invalid content-type: text/html; charset=UTF-8
<html>
...
 <title>Error 404 (Not Found)!!1</title>
...
<p>The requested URL <code>/google.cloud.aiplatform.v1.FeaturestoreOnlineServingService/ReadFeatureValues</code> was not found on this server.  <ins>That’s all we know.</ins>

Any suggestions on what could be the error?

Sniper
  • 1,428
  • 1
  • 12
  • 28
  • Can you try using the latest version of [FeaturestoreOnlineServingServiceClient](https://cloud.google.com/java/docs/reference/google-cloud-aiplatform/latest/com.google.cloud.aiplatform.v1.FeaturestoreOnlineServingServiceClient) ? – Prajna Rai T Oct 09 '22 at 13:19
  • @PrajnaRaiT I am using the latest version. 3.4.0 – Sniper Oct 10 '22 at 05:08
  • Which service endpoint url you are using? These are the supported service [urls](https://cloud.google.com/vertex-ai/docs/reference/rest#service-endpoint). – Prajna Rai T Oct 14 '22 at 14:18
  • @urls I am trying to read feature values from Vertex AI feature store. Regarding the endpoint, not sure as the gcloud java lib possibly does that internally – Sniper Oct 15 '22 at 06:39
  • Can you provide the full error message that you are getting? – Prajna Rai T Oct 20 '22 at 14:50

2 Answers2

1

I got the same error and the problem is around the region. The region needs to be chosen when making the connection in addition to selecting it when making the entity. Try this if your vertex featurestore is not in us-central1


    String endpoint = String.format("%s-aiplatform.googleapis.com:443", this.featureStoreConfig.getLocation());
    FeaturestoreOnlineServingServiceSettings settings = FeaturestoreOnlineServingServiceSettings.newBuilder()
                        .setEndpoint(endpoint)
                        .build();
    FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
    FeaturestoreOnlineServingServiceClient.create(settings);
    
    String gcpProject = this.featureStoreConfig.getProject();
    String featureStoreName = this.featureStoreConfig.getFeatureStoreName();
    String featureStoreLocation = this.featureStoreConfig.getLocation();
    EntityTypeName entityTypeName = EntityTypeName.of(gcpProject, featureStoreLocation, featureStoreName, entityType);
    System.out.println(entityTypeName);
    ReadFeatureValuesResponse response = featurestoreOnlineServingServiceClient.readFeatureValues(entityTypeName);

anomalizer
  • 131
  • 1
  • 5
0

I would double check if the Feature Store is available in your region

dannierl
  • 1
  • 1
  • I have already created the Feature Store on GCP on us-central1 region. Let me check if I am using the correct region while trying to access it – Sniper Oct 15 '22 at 06:40