{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • General
    • Edge/API Management
    • Developer Portal
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
0
Question by Samuel Sayler · Apr 27, 2017 at 02:46 PM · 305 Views node.jskvmexceptionsversionhelp

GetKeys KVM method is returning an exception.

So we're trying to create a Service Locator API and we want to store a list of our API's in our environment configuration.


Unfortunately, when we try to use the method as it is defined in the documentation in our node.js file, we get errors. Here is the line in question that is throwing and error:

var kvm = apigee.getKeyValueMap('taco', 'environment');

kvm.getKeys(function(err, keys_array)

{ res.send(err); }

);


Here we are sending the error, because sending keys_array returns null. The error is this message:


{ "message": "com.apigee.kernel.exceptions.spi.UncheckedException{ code = keyvaluemap.service.KeyValueMapOperationNotSupported, message = KeyValueMap Operation createKeyValueMapEntry is not supported for the organization ThisIsOurOrgName, associated contexts = []}" }

Are we using a version of Apigee that doesn't support this operation? Why is that? How do we get access to this method?

Any assistance would be greatly appreciated.

Comment
Add comment Show 3
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image santosh_ghalsasi   · Apr 27, 2017 at 03:55 PM 0
Link

Hi @Samuel Sayler,

can you please paste full code written in node.js.

Thanks,

Santosh

avatar image Samuel Sayler santosh_ghalsasi · Apr 27, 2017 at 05:28 PM 0
Link

Sure, here you go:

var express = require('express')

var apigee = require('apigee-access')

var app = express()

app.get('/', function (req, res)

{

var kvm = apigee.getKeyValueMap('taco', 'environment');

kvm.getKeys(function(err, keys_array)

{

res.send(err);

} );

})

app.listen(3000, function () { console.log('started up.') })

avatar image Samuel Sayler santosh_ghalsasi · Apr 27, 2017 at 05:29 PM 0
Link

I mentioned it in the above statement, but I know the code I posted is sending the error message, but the keys_array value is simply undefined

Close

1 Answer

· Add your answer
  • Sort: 
avatar image
0

Answer by Sabthar · Apr 28, 2017 at 03:01 AM

@Samuel Sayler : I can see the code snippet works fine. ie., i retrieved the KeyValueMap (named as TestKVM) from my environment(test). Please ensure the KVM Identifier created in correct environment(test / prod/ or customised one).

var express = require('express') 

var apigee = require('apigee-access') 
var app = express() 

app.get('/', function (req, res){ 

var kvm = apigee.getKeyValueMap('testKVM', 'environment');

kvm.getKeys(function(err, keys_array) {
     console.log("All KVM => " , keys_array);
     res.send (keys_array);
//res.send(err);
} );

}) app.listen(3000, function () { console.log('started up.') })

If this issue different then please provide bit more details. Hope it helps.


nodejslogs.jpg (27.8 kB)
nodejs-kvm.jpg (55.8 kB)
Comment
Add comment Show 3 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Samuel Sayler · May 01, 2017 at 05:29 PM 0
Link

Is it possible I'm on an incorrect version that does not support the stated method?

avatar image Dino ♦♦ Samuel Sayler   · May 01, 2017 at 08:03 PM 0
Link

Yes, it is possible. But first, check that the KVM exists, please? Sabthar asked you to verify that, but I didn't see you confirm that you have checked. The error message you are getting is:

createKeyValueMapEntry is not supported for the organization 

.... which is a little but odd, because it suggests that your call to "getKeys()" is resulting in a call to createKeyValueMapEntry(). It could be a broken error message though. Anyway to check that the KVM exists, please do this:

You must replace USERNAME and YOURENVIRONMENT with the appropriate values.

You should see a 200 OK, and some information about the KVM.

If that checks out, then can you please run this:

curl -i -u $USERNAME https://api.enterprise.apigee.com/v1/o/ThisIsOurOrgName

...and show us the results?

It is possible that your org is not "CPS Enabled". CPS is an internal name for a data storage subsystem we use in the Edge cloud. It's an internal name but you may see it mentioned in some of the Edge documentation. There are some organizations that don't use CPS and for those I *think* the getKeys() call will not succeed.

Anyway do the checks and let us know.

avatar image Samuel Sayler Dino ♦♦ · May 02, 2017 at 03:20 PM 0
Link

I'm getting a (60) SSL certificate problem: unable to get local issuer certificate.

The last thing you mentioned sounds like it may be the issue.

The last useful piece of information I may be able to offer is that I'm pretty sure the KVM is working, since the singular getKey method works and returns the proper value, it's only when I'm trying to get all of them as an array that it doesn't work.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 5 attachments (including images) can be used with a maximum of 5.0 MB each and 25.0 MB total.

Follow this Question

Answers Answers and Comments

56 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What version of ExpressJs should I be using? 1 Answer

API PROXY: ECONNREFUSED from Target Backend 1 Answer

"Unexpected Token" error running tutorial server 1 Answer

Environment variables for Node.js app 1 Answer

Errors while deploying standalone node.js app 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • General
  • Edge/API Management
  • Developer Portal
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges