Virtual host missing environment group

You're viewing Apigee and Apigee hybrid documentation.
There is no equivalent Apigee Edge documentation for this topic.

Symptom

An ApigeeIssue with Reason AIS_VIRTUALHOST_MISSING_ENVGROUP is shown when viewing resources in the apigee namespace.

Error messages

After running kubectl -n apigee get apigeeissues, the following error is displayed:

NAME                     SEVERITY   REASON                             DOCUMENTATION                                                                                  AGE
vhost-missing-eg-my-eg   ERROR      AIS_VIRTUALHOST_MISSING_ENVGROUP   https://cloud.google.com/apigee/docs/api-platform/troubleshoot/playbooks/vh-missing-env-group   5h18m

Cause: Virtualhost missing environment group

One of the virtualhosts defined in overrides.yaml is missing its corresponding EnvironmentGroup.

Diagnosis

Run the following command:

kubectl -n apigee describe apigeeissue ISSUE_NAME

Where ISSUE_NAME is the name of the issue. For example, vhost-missing-eg-my-eg.

Something similar to the following is returned:

Name:         vhost-missing-eg-my-eg
Namespace:    apigee
Labels:       ais-reason=AIS_VIRTUALHOST_MISSING_ENVGROUP
Annotations:  <none>
API Version:  apigee.cloud.google.com/v1alpha1
Kind:         ApigeeIssue
Metadata:
  Creation Timestamp:  2023-04-05T14:29:38Z
  Generation:          1
  Managed Fields:
    API Version:  apigee.cloud.google.com/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:spec:
        .:
        f:details:
        f:documentation:
        f:reason:
        f:severity:
    Manager:         apigeewatcher
    Operation:       Update
    Time:            2023-04-05T14:29:38Z
  Resource Version:  28195
  UID:               f7b62eb3-3f84-4a37-9ba8-9a0e1e9c3454
Spec:
  Details:        Expected EnvironmentGroup "my-eg" in ApigeeOrganization "my-org" for ApigeeRouteConfig "my-org-my-eg"
  Documentation:  https://cloud.google.com/apigee/docs/api-platform/troubleshoot/playbooks/vh-missing-env-group
  Reason:         AIS_VIRTUALHOST_MISSING_ENVGROUP
  Severity:       ERROR
Events:           <none>
Spec:
  Details:        Expected EnvironmentGroup "my-eg" in ApigeeOrganization "my-org" for ApigeeRouteConfig "my-org-my-eg"

The contents of Spec.Details explains the name of the EnvironmentGroup that is expected to exist.

Resolution

  1. Use the describe ApigeeIssue command to display the name of the EnvironmentGroup which is expected to exist:
    kubectl -n apigee describe apigeeissues ISSUE_NAME

    Where ISSUE_NAME is the name of the issue. For example, vhost-missing-eg-my-eg.

    In this example, the environment group my-eg is expected in the my-org Apigee organization.

  2. Use one of the following methods to correct the problem:
    1. Create the environment group:
      1. Create an environment group.
      2. Add an environment.
      3. Create a proxy.
      4. Deploy a proxy to that environment.
    2. Delete the environment group:
      1. Open overrides.yaml in a text editor.
      2. Delete my-eg from the virtualhost.
      3. Save the overrides.yaml file.
      4. Reapply the overrides.yaml file:
        apigeectl apply --settings virtualhosts

Must gather diagnostic information

If the problem persists even after following the above instructions, gather the following diagnostic information and then contact Apigee Support:

  1. The Google Cloud Project ID.
  2. The name of the Apigee hybrid organization.
  3. The Spec.Details field of the ApigeeIssue.