Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

error when creating service #44

Closed
kevwil opened this issue Apr 24, 2015 · 7 comments
Closed

error when creating service #44

kevwil opened this issue Apr 24, 2015 · 7 comments
Assignees

Comments

@kevwil
Copy link

kevwil commented Apr 24, 2015

I have an existing account and am trying to create a service. I get the same error every time. I have an account in Apigee Edge and should have no trouble getting the developerId associated with my account.

$ a127 service create
[?] Service Type? RemoteProxy
[?] Service name? myHelloWorld
Creating service myHelloWorld from kevwilpearson...
/usr/local/lib/node_modules/apigee-127/lib/commands/account/providers/apigee.js:438
        appRequest.developerId = dev.id;
                                    ^
TypeError: Cannot read property 'id' of undefined
    at /usr/local/lib/node_modules/apigee-127/lib/commands/account/providers/apigee.js:438:37
    at /usr/local/lib/node_modules/apigee-127/node_modules/volos-management-apigee/lib/apigeemgmt.js:103:5
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/apigee-127/node_modules/volos-management-apigee/lib/apigeemgmt.js:451:7)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
@theganyo
Copy link
Contributor

Sorry you're seeing an issue. Could you please enable the DEBUG env var to see if we get any more information?

DEBUG=* a127 service create

@kevwil
Copy link
Author

kevwil commented Apr 24, 2015

D'oh! Why didn't I think of that.

$ DEBUG=* a127 service create
  true account: kevwilpearson +0ms
[?] Service Type? RemoteProxy
[?] Service name? myHelloWorld
Creating service myHelloWorld from kevwilpearson...
  apigee GET https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld +6s
  apigee {"protocol":"https:","slashes":true,"auth":null,"host":"api.enterprise.apigee.com","port":null,"hostname":"api.enterprise.apigee.com","hash":null,"search":null,"query":null,"pathname":"/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld","path":"/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld","href":"https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld","headers":{"Authorization":"Basic a2V2aW4ud2lsbGlhbXNAcGVhcnNvbi5jb206Tm90YWJsZTE5RG9nZ3k=","Accept":"application/json"},"method":"GET"} +2ms
listdeployments: {"baseuri":"https://api.enterprise.apigee.com","organization":"pearsonbuild","environment":"dev","username":"kevin.williams@pearson.com","password":{},"debug":true,"verbose":true,"long":true,"asyncLimit":4}
Going to invoke "https://api.enterprise.apigee.com/v1/o/pearsonbuild/e/dev/deployments"
  true creating proxy developer: {"firstName":"Remote","lastName":"Proxy","email":"remote-proxy@apigee.com","userName":"remote-proxy"} +533ms
  apigee POST https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers +1ms
  apigee {"protocol":"https:","slashes":true,"auth":null,"host":"api.enterprise.apigee.com","port":null,"hostname":"api.enterprise.apigee.com","hash":null,"search":null,"query":null,"pathname":"/v1/o/pearsonbuild/developers","path":"/v1/o/pearsonbuild/developers","href":"https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers","headers":{"Authorization":"Basic a2V2aW4ud2lsbGlhbXNAcGVhcnNvbi5jb206Tm90YWJsZTE5RG9nZ3k=","Accept":"application/json","Content-Type":"application/json"},"method":"POST"} +0ms
/usr/local/lib/node_modules/apigee-127/lib/commands/account/providers/apigee.js:438
        appRequest.developerId = dev.id;
                                    ^
TypeError: Cannot read property 'id' of undefined
    at /usr/local/lib/node_modules/apigee-127/lib/commands/account/providers/apigee.js:438:37
    at /usr/local/lib/node_modules/apigee-127/node_modules/volos-management-apigee/lib/apigeemgmt.js:103:5
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/apigee-127/node_modules/volos-management-apigee/lib/apigeemgmt.js:451:7)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

@theganyo
Copy link
Contributor

It appears there may be 2 things going on here: 1) there is a bug in the code that is causing you to reach this point - I'll look into that. But more importantly for you: 2) I believe you are actually getting a 403 Forbidden error as you attempt to create the remote proxy. So, I think this is ultimately a permissions issue with your account. Could you check on that?

(BTW: Technically, the remote proxy is already there as someone else created it... but the system is currently designed to just make the attempt anyway as it's faster than doing the several checks that would be needed.)

@theganyo
Copy link
Contributor

@kevwil I just released a version of a127 that should fix the bug that was eating your error. Could you install the update (be sure that a127 -V responds with 0.15.1) and try again? You should receive a better error message now.

@theganyo theganyo self-assigned this Apr 24, 2015
@kevwil
Copy link
Author

kevwil commented Apr 24, 2015

Got it. Here's the new error:

$ DEBUG=* a127 service create
  true account: kevwilpearson +0ms
[?] Service Type? RemoteProxy
[?] Service name? myHelloWorld
Creating service myHelloWorld from kevwilpearson...
  apigee GET https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld +10s
  apigee {"protocol":"https:","slashes":true,"auth":null,"host":"api.enterprise.apigee.com","port":null,"hostname":"api.enterprise.apigee.com","hash":null,"search":null,"query":null,"pathname":"/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld","path":"/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld","href":"https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers/remote-proxy@apigee.com/apps/myhelloworld","headers":{"Authorization":"Basic a2V2aW4ud2lsbGlhbXNAcGVhcnNvbi5jb206Tm90YWJsZTE5RG9nZ3k=","Accept":"application/json"},"method":"GET"} +1ms
listdeployments: {"baseuri":"https://api.enterprise.apigee.com","organization":"pearsonbuild","environment":"dev","username":"kevin.williams@pearson.com","password":{},"debug":true,"verbose":true,"long":true,"asyncLimit":4}
Going to invoke "https://api.enterprise.apigee.com/v1/o/pearsonbuild/e/dev/deployments"
  true creating proxy developer: {"firstName":"Remote","lastName":"Proxy","email":"remote-proxy@apigee.com","userName":"remote-proxy"} +624ms
  apigee POST https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers +0ms
  apigee {"protocol":"https:","slashes":true,"auth":null,"host":"api.enterprise.apigee.com","port":null,"hostname":"api.enterprise.apigee.com","hash":null,"search":null,"query":null,"pathname":"/v1/o/pearsonbuild/developers","path":"/v1/o/pearsonbuild/developers","href":"https://api.enterprise.apigee.com/v1/o/pearsonbuild/developers","headers":{"Authorization":"Basic a2V2aW4ud2lsbGlhbXNAcGVhcnNvbi5jb206Tm90YWJsZTE5RG9nZ3k=","Accept":"application/json","Content-Type":"application/json"},"method":"POST"} +1ms
  true error creating developer +444ms { [Error] statusCode: 403 }
Error
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/apigee-127/node_modules/volos-management-apigee/lib/apigeemgmt.js:448:17)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

Which raises the question, why is it trying to create a developer when my account already exists?

@theganyo
Copy link
Contributor

Good. That's expected. As to why... see above. It's creating a "remote proxy" developer.

@kevwil
Copy link
Author

kevwil commented Apr 27, 2015

I believe I have permissions to create new API Proxies, but not new developers, and those are the correct permissions as far as my company is concerned. Is it not possible to create a service definition without creating this new developer account? That would really be a non-starter for us.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants