Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

KVM organization scope while reading empty

I have an organization scope KVM by the name KVM-GetJwkURI
curl -X GET "https://apigee.googleapis.com/v1/organizations/${GOOGLE_CLOUD_PROJECT}/keyvaluemaps" -H "Authorization: Bearer $(gcloud auth print-access-token)"
lists (KVM is existing in organization scope )
[
  "KVM-GetJwkURI"
]
 
I am using this organization scope KVM in a shared flow
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations continueOnError="false" enabled="true" name="KVM-GetJwkURI">
  <MapName ref="OrganizationMapName"/>
  <DisplayName>KVM-GetJwkURI</DisplayName>
  <Properties/>
  <ExpiryTimeInSecs>300</ExpiryTimeInSecs>
  <Get assignTo="JwkURI">
    <Key>
      <Parameter>jwk_uri</Parameter>
    </Key>
  </Get>
  <Scope>organization</Scope>
</KeyValueMapOperations>
 
When running the proxy which is using this shared flow throwing an error and the reason of the fault is
 
{"fault":{"faultstring":"The map name resolved by flow variable OrganizationMapName is empty","detail":{"errorcode":"steps.keyvaluemapoperations.EmptyResolvedMapName"}}}
 
 
Error.pngorganizationmapnameempty.png
The KVM is existing as mentioned above and there are entries in KVM also but not able to understand why OrganizationMapName is coming empty.
Any help or pointers are appreciated.
 
Thanks,
Surekha
Solved Solved
0 1 140
1 ACCEPTED SOLUTION

The KVM is existing as mentioned above and there are entries in KVM also but not able to understand why OrganizationMapName is coming empty.


I think you are not clear. "The KVM is existing" - there IS a KVM that exists.  It is named "KVM-GetJwkURI".  You have not specified that KVM in your policy configuration. 

By using this configuration:

 

<KeyValueMapOperations continueOnError="false" enabled="true" name="KVM-GetJwkURI">
  <MapName ref="OrganizationMapName"/>
  ...

 

...you are telling Apigee to "de-reference" (read) the variable OrganizationMapName to get the name of the map. So you need a context variable with that name, to hold the name of the KVM you wish to read.  The error message you see is telling you that there is no value in that variable. 

By the way, It seems that you have a policy named KVM-GetJwkURI and you also have a KVM with the same name. That will be confusing, and you should probably change that, but it is not an error. Usually I name my KVMs something like "settings" or "key-settings" or something meaningful like that.

To correct the problem you are observing you can do one of these two things:

  1. modify your PROXY so that it correctly sets, via an AssignMessage or JavaScript policy or similar, the value of the variable OrganizationMapName to "KVM-GetJwkURI", or whatever you choose as a proper name for your organization-scoped KVM.
  2. Modify your POLICY so that it "hard codes" the name of the map you wish to read. Like this:

    <KeyValueMapOperations continueOnError="false" enabled="true" name="KVM-GetJwkURI">
      <MapName>KVM-GetJwkURI</MapName> <!-- or whatever you choose to name the KVM -->
      ...
    

 

View solution in original post

1 REPLY 1

The KVM is existing as mentioned above and there are entries in KVM also but not able to understand why OrganizationMapName is coming empty.


I think you are not clear. "The KVM is existing" - there IS a KVM that exists.  It is named "KVM-GetJwkURI".  You have not specified that KVM in your policy configuration. 

By using this configuration:

 

<KeyValueMapOperations continueOnError="false" enabled="true" name="KVM-GetJwkURI">
  <MapName ref="OrganizationMapName"/>
  ...

 

...you are telling Apigee to "de-reference" (read) the variable OrganizationMapName to get the name of the map. So you need a context variable with that name, to hold the name of the KVM you wish to read.  The error message you see is telling you that there is no value in that variable. 

By the way, It seems that you have a policy named KVM-GetJwkURI and you also have a KVM with the same name. That will be confusing, and you should probably change that, but it is not an error. Usually I name my KVMs something like "settings" or "key-settings" or something meaningful like that.

To correct the problem you are observing you can do one of these two things:

  1. modify your PROXY so that it correctly sets, via an AssignMessage or JavaScript policy or similar, the value of the variable OrganizationMapName to "KVM-GetJwkURI", or whatever you choose as a proper name for your organization-scoped KVM.
  2. Modify your POLICY so that it "hard codes" the name of the map you wish to read. Like this:

    <KeyValueMapOperations continueOnError="false" enabled="true" name="KVM-GetJwkURI">
      <MapName>KVM-GetJwkURI</MapName> <!-- or whatever you choose to name the KVM -->
      ...