"Invalid Path in Zip Entry": Error Uploading API Proxy Bundle to Apigee using Pulumi in Python

72 views Asked by At

I'm facing the same issue I think. Let me describe mine.

I'm trying to upload an API proxy bundle to Apigee using the gcp.apigee.Sharedflow resource in Python with Pulumi. The bundle I am trying to upload is structured as follows and named my-proxy.zip:

-- apiproxy
    |-- my-proxy.xml
    |-- proxies
    |   `-- default.xml
    `-- targets
        `-- default.xml

However, when I attempt to deploy this bundle using Pulumi, I receive the following error message:

gcp:apigee:Sharedflow (my-proxy):
    error: 1 error occurred:
        * Error creating SharedFlow: googleapi: Error 400: bundle contains errors
    Details:
    [
      {
        "@type": "type.googleapis.com/edge.configstore.bundle.BadBundle",
        "violations": [
          {
            "description": "zip entry in bundle has invalid path",
            "filename": "apiproxy/proxies/default.xml"
          },
          {
            "description": "zip entry in bundle has invalid path",
            "filename": "apiproxy/targets/default.xml"
          },
          {
            "description": "zip entry in bundle has invalid path",
            "filename": "apiproxy/my-proxy.xml"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "11637400726346568001"
      }
    ]

Interestingly, when I upload the same zip file via the GCP console for creating API Proxies in Apigee, the proxy is created without any issues. This leads me to believe that the problem might be related to how Pulumi or the gcp.apigee.Sharedflow resource is handling the bundle.

Here's the relevant portion of my Pulumi code for context:

gcp.apigee.Sharedflow(
        "my-proxy",
        config_bundle="my-proxy.zip",
        org_id=org_name,
        opts=pulumi.ResourceOptions(
            depends_on=[bundle_resource]
        )
    )

I am looking for guidance on how to resolve this issue. Has anyone faced a similar problem, or can anyone suggest what might be causing these "invalid path" errors when using Pulumi to deploy to Apigee?

Thank you in advance for your help!

0

There are 0 answers