Cache resource causing deployment failure

Not applicable

Hi Developers,

I created two conditional flows in Proxy endpoint for populating a cache( for HTTP POST scope global, cache resource and key fregment is defined) and invalidating the cache in another conditional flow (for DELETE). When deploy this code in a different organization than from where I developed it. It gives following error message;

Invalid cache resource reference orderId in Step definition InvalidateCacheStatus. Context Revision:1;APIProxy:ABCProxy ;Organization:..............

Here is reference to piece of config in invalidate cache:

<KeyFragment ref="customerId"/> </CacheKey> <CacheResource>orderId</CacheResource> <Scope>Global</Scope>

Any idea what might be causing this?

Solved Solved
0 3 833
1 ACCEPTED SOLUTION

Not applicable

Hi @Mayank,

You need to cache resource to be available in the corresponding environment before you can deploy the API proxy to that env. You should see the same error if you deploy the API proxy to another envirnment even within in the same org if that env does not have your cache resource

<CacheResource>orderId</CacheResource> 

The 'CacheResource' is an optional attribute. If you do not specify that, the API proxy will use the default cache and you will not see these errors when you deploy it across other environments.

The same is true for Virtual hosts, Key/Value maps (at env. scope), keystores.. Any references in your API proxy should be there in the corresponding environment before you can deploy it there.

View solution in original post

3 REPLIES 3

@Mayank Acharya ,

I have seen this issue in Edge UI when you delete policies using the UI instead of XML code. Sometimes it fails to delete references in Conditional Flows / Pre Flow / Post Flow.

Please scan the flows in proxy & target endpoints and make sure references to deleted policies are removed. That should fix your issue. Keep us posted if any.

Not applicable

In this case I am just updating the policy for example I just change the cache resource or source field to point to new variable. I tried it again on a different service and it failed again.

Not applicable

Hi @Mayank,

You need to cache resource to be available in the corresponding environment before you can deploy the API proxy to that env. You should see the same error if you deploy the API proxy to another envirnment even within in the same org if that env does not have your cache resource

<CacheResource>orderId</CacheResource> 

The 'CacheResource' is an optional attribute. If you do not specify that, the API proxy will use the default cache and you will not see these errors when you deploy it across other environments.

The same is true for Virtual hosts, Key/Value maps (at env. scope), keystores.. Any references in your API proxy should be there in the corresponding environment before you can deploy it there.