Not able to deploy oauth_advanced sample from github

Not applicable

I am working on a oAuth 2.0 – 3 legged use case. I was looking at the sample provided over github, it seems invoke.sh are missing in oauth-advanced folder or sub-folders. Also deploy.sh is missing some of the sub-folders. https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/oauth-advanced

Also while uploading this bundle to apigee is failing by using New Proxy->upload bundle option. Error:

Server Error. Bundle is invalid. Unable to read/find APIProxy contents

Also I tried uploading through bash commands as mentioned in github->Readme.md.. I am trying to deploy it to my organization (ajitcts), but after code execution, non of the sample is getting reflected in my organization’s proxy list.

http://apigee.com/docs/api-services/content/oauth-v2-policy-authorization-code-grant-type

I followed the steps as mentioned in :

http://apigee.com/docs/api-services/content/using-sample-api-proxies

http://apigee.com/docs/api-services/samples/using-samples

Solved Solved
0 9 647
1 ACCEPTED SOLUTION

Hi Ajit,

I believe I see where you're having trouble. The oauth-advanced sample doesn't follow the deployment pattern of the other samples, as described in api-platform-samples/README. Rather, for oauth-advanced, you must carefully follow the instructions specifically for that sample: api-platform-samples/oauth-advanced/README.

This sample has four separate apps that you must deploy and configure separately. All four are required to be deployed for this advanced example to work. The README walks you through the steps that you must follow.

I just cloned api-platform-samples, and successfully deployed each of the four apps in that project to my Edge cloud account. Please try again, following the oauth-advanced/README carefully, and let us know if you have success.

For example, you'll do these steps:

1. git clone https://github.com/apigee/api-platform-samples.git
2. cd api-platform-samples/sample-proxies/oauth-advanced
3. vi ../../setup/setenv..sh [edit this file with your account information]


-now we deploy the first app-

4. cd login-app
5. ./deploy.sh [enter your Edge password]

You will see something like this:


Deploying login-app to:
 Env: test 
 Org: docs 
 Url: https://github.com/apigee/api-platform-samples.git 
 For: wwitman@apigee.com
"login-app" Revision 2
  deployed
  environment = test
  base path = /
  URI = https://github.com/apigee/api-platform-samples.git
  URI = https://github.com/apigee/api-platform-samples.git

Follow this pattern for each of the four apps: login-app, oauth2, user-mgmt-v1, and webserver-app. Then, follow the README for details on how to run the oauth example.

View solution in original post

9 REPLIES 9

Invalid bundle error indicates that the API proxy directories are not in accordance with the expected format. It could be because of sub-folders missing, as you indicated. Can you try to clone on a fresh directory and try deploy.sh?

Sudheendra, I cloned samples many times... oauth-advanced folder doesn't have any deploy.sh or invoke.sh file. In some of sub-folders I can see deploy.sh file only. I tried this for login-app... getting below error:

$ /e/ApigeeSamples/api-platform-samples-master/sample-proxies/oaut h-advanced/login-app

$ deploy.sh

./deploy.sh: line 5: ../../setup/setenv.sh: No such file or directory

Enter your password for the Apigee Enterprise organization ajitcts, followed by [ENTER]:

************

Deploying login-app to:

Env: test

Org: ajitcts

Url: https://api.enterprise.apigee.com

For: ajit-12*****@*****.com

Error: Error: com.apigee.zookeeper.ZooKeeperException{ code = zookeeper.ErrorCre atingDirectory, message = Error creating directory for path : /organizations/aji tcts/environments/test/apiproxies/login-app/revisions/1/statuses/3cb53ac7-7474-4 f9a-aa37-86ca9796fdb1, associated contexts = []}

Plz suggest.

Now I am able to upload the samples using option given in: https://github.com/WWitman/api-platform-samples/tree/master/sample-proxies/oauth-advanced

But for login-app I am always getting error as mentioned in my last reply i.e. zookeeper path error. I am getting same error for oauth2 (over api management UI), while I am accessing app url.

Also in user-mgmt-v1 proxy, I am getting below error:

The revision is deployed and traffic can flow, but flow may be impaired. Call timed out

ZooKeeper issue needs an investigation. Can you please raise a support ticket though the Edge Support Portal

I am not able to raise the support request, login not working.

Hi Ajit,

I believe I see where you're having trouble. The oauth-advanced sample doesn't follow the deployment pattern of the other samples, as described in api-platform-samples/README. Rather, for oauth-advanced, you must carefully follow the instructions specifically for that sample: api-platform-samples/oauth-advanced/README.

This sample has four separate apps that you must deploy and configure separately. All four are required to be deployed for this advanced example to work. The README walks you through the steps that you must follow.

I just cloned api-platform-samples, and successfully deployed each of the four apps in that project to my Edge cloud account. Please try again, following the oauth-advanced/README carefully, and let us know if you have success.

For example, you'll do these steps:

1. git clone https://github.com/apigee/api-platform-samples.git
2. cd api-platform-samples/sample-proxies/oauth-advanced
3. vi ../../setup/setenv..sh [edit this file with your account information]


-now we deploy the first app-

4. cd login-app
5. ./deploy.sh [enter your Edge password]

You will see something like this:


Deploying login-app to:
 Env: test 
 Org: docs 
 Url: https://github.com/apigee/api-platform-samples.git 
 For: wwitman@apigee.com
"login-app" Revision 2
  deployed
  environment = test
  base path = /
  URI = https://github.com/apigee/api-platform-samples.git
  URI = https://github.com/apigee/api-platform-samples.git

Follow this pattern for each of the four apps: login-app, oauth2, user-mgmt-v1, and webserver-app. Then, follow the README for details on how to run the oauth example.

Thanks, it also worked for me. I am getting 2 errors as I mentioned above in Sudheendra reply. These error, I can ignore or it will have any impact on flow ?

Hi Ajit -- Unfortunately, I don't know the cause of the error or what its effect would be. Can you deploy any other sample API proxies? Or does the error only appear with certain ones? If you're not able to log in on the support page, you can try this link: https://pages.apigee.com/request-support-general.html.