I am setting up the env for coursera lab for Apigee specialization: https://www.coursera.org/learn/api-design-apigee-gcp/supplement/7F4BP/setting-up-an-environment-for-labs I have completed all the steps up to the node set up and I am getting the following error.
I executed the following commands and I get the following error. I have seen a previous post regarding this and it seem the solution was put in the new setup.zip but I am facing the issue again.
$ node setup
prompt: Please provide the Apigee Edge username: abc@example.com
prompt: Please provide the Apigee Edge password: ************
prompt: Please provide the Apigee Edge Organization name: testOrg
prompt: Please provide the Apigee Edge Environment name: test
prompt: Please provide the Firebase Host name: apigee-engg-training-2343432.firebaseio.com
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Andale Mono'; color: #fcf487; background-color: #292929; background-color: rgba(41, 41, 41, 0.6)}
span.s1 {font-variant-ligatures: no-common-ligatures}
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.277 s
[INFO] Finished at: 2019-05-06T13:49:36-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.apigee.edge.config:apigee-config-maven-plugin:1.2.1:targetservers (create-config-targetserver) on project edge-developer-training-backend: Apigee network call error 401 Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException](http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException)
(node:15600) UnhandledPromiseRejectionWarning: #<Object>
(node:15600) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
1 Like
Hi @Mihika Suhas Naik- I hope you are providing the right info of your Apigee org name, environment, Apigee username and password ?
@Sai Saran Vaidyanathan Yes, I am providing it correctly. I even created another eval account other than the one provided by my company. I seem to be getting the same error.
Can you share the entire trace along with your inputs ?
@Sai Saran Vaidyanathan sure. Here you go. I haven’t included my password for Apigee here. I am hitting the charater limit so I will split this in 2 comments.
$ node setup
prompt: Please provide the Apigee Edge username: mihika.naik@firstdata.com
prompt: Please provide the Apigee Edge password: *************
prompt: Please provide the Apigee Edge Organization name: mihikanaik-eval
prompt: Please provide the Apigee Edge Environment name: test
prompt: Please provide the Firebase Host name: apigee-developer-trainin-c628d.firebaseio.com
[INFO] Scanning for projects...
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< apigee:edge-developer-training-backend >---------------
[INFO] Building edge-developer-training-backend v1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] -----------------< apigee:edge-developer-training-idp >-----------------
[INFO] Building edge-developer-training-idp v1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ edge-developer-training-idp ---
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ edge-developer-training-backend ---
[INFO] Deleting /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-idp/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:copy-resources (default) @ edge-developer-training-idp ---
[INFO] Deleting /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-backend/target
[INFO]
[INFO] --- jshint-maven-plugin:1.6.0:lint (jslint) @ edge-developer-training-backend ---
[INFO] using jshint version 2.5.6
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- apigee-edge-maven-plugin:1.1.6:configure (configure-bundle) @ edge-developer-training-idp ---
[INFO] No config.json found. Skipping package configuration.
[INFO]
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}
=============Checking for node.js app================
[INFO]
=============Now zipping the App Bundle================
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ edge-developer-training-idp ---
[INFO] Installing /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-idp/pom.xml to /Users/f4mnah9/.m2/apigee/edge-developer-training-idp/v1/edge-developer-training-idp-v1.pom
[INFO]
[INFO] --- apigee-edge-maven-plugin:1.1.6:deploy (deploy-bundle) @ edge-developer-training-idp ---
[INFO]
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}
=============Initializing Maven Deployment================
[INFO] /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-backend/apiproxy/resources/jsc/ProductAvailability.js
[INFO] /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-backend/apiproxy/resources/jsc/FormatLikeBaaS.js
[INFO] /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-backend/apiproxy/resources/jsc/AddProductNameToURI.js
[INFO] /Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-backend/apiproxy/resources/jsc/UpdateTargetUrl.js
[INFO]
[INFO] --- maven-resources-plugin:2.6:copy-resources (default) @ edge-developer-training-backend ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 25 resources
[INFO]
[INFO] --- apigee-edge-maven-plugin:1.1.6:configure (configure-bundle) @ edge-developer-training-backend ---
[INFO]
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}
Request prepared for the server
**************************
GET [https://api.enterprise.apigee.com/v1/organizations/mihikanaik-eval/apis/edge-developer-training-idp/deployments](https://api.enterprise.apigee.com/v1/organizations/mihikanaik-eval/apis/edge-developer-training-idp/deployments)
accept: application/json
accept-encoding: gzip
authorization: Basic [Not shown in log]
[INFO] ============= Reading the config file located at ================
/Users/f4mnah9/Desktop/e1jt75tOEeidew5LPPdf-g_7c2628709b4e11e880dec10ca8455ada_setup/setup/edge-developer-training-backend/config.json
[INFO]
=============Checking for node.js app================
[INFO]
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545; min-height: 14.0px}
=============Now zipping the App Bundle================
[INFO]
[INFO] --- apigee-config-maven-plugin:1.2.1:caches (create-config-cache) @ edge-developer-training-backend ---
[INFO] ************************************************************************
[INFO] Apigee Cache
[INFO] ************************************************************************
[INFO] No cache config found.
[INFO]
[INFO] --- apigee-config-maven-plugin:1.2.1:targetservers (create-config-targetserver) @ edge-developer-training-backend ---
[INFO] ************************************************************************
[INFO] Apigee Target Servers
[INFO] ************************************************************************
[INFO] Retrieving existing environment Target Servers - test
[ERROR] 401 Unauthorized
[INFO]
=============Importing App================
[INFO][INFO]
Request prepared for the server
**************************
POST [https://api.enterprise.apigee.com/v1/organizations/mihikanaik-eval/apis?action=import&name=edge-developer-training-idp](https://api.enterprise.apigee.com/v1/organizations/mihikanaik-eval/apis?action=import&name=edge-developer-training-idp)
accept: application/json
accept-encoding: gzip
authorization: Basic [Not shown in log]
content-type: application/octet-stream
[Request body contains data, not shown]
Request prepared for the server
**************************
GET [https://api.enterprise.apigee.com/v1/organizations/mihikanaik-eval/environments/test/targetservers](https://api.enterprise.apigee.com/v1/organizations/mihikanaik-eval/environments/test/targetservers)
accept: application/json
accept-encoding: gzip
authorization: Basic [Not shown in log]
[ERROR] 401 Unauthorized
[ERROR]
* * * * * * * * * * *
This deployment could have failed for a variety of reasons.
* * * * * * * * * * *
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.301 s
[INFO] Finished at: 2019-05-13T17:20:00-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.1.6:deploy (deploy-bundle) on project edge-developer-training-idp: : MojoExecutionException: 401 Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException)
(node:24765) UnhandledPromiseRejectionWarning: #<Object>
(node:24765) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:24765) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[ERROR] 401 Unauthorized
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.834 s
[INFO] Finished at: 2019-05-13T17:20:01-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.apigee.edge.config:apigee-config-maven-plugin:1.2.1:targetservers (create-config-targetserver) on project edge-developer-training-backend: Apigee network call error 401 Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException](http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException)
(node:24765) UnhandledPromiseRejectionWarning: #<Object>
(node:24765) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Same issue here. When I use ËśApigee Edge Environment nameËś: eval the deployment fails
[WARNING] The requested profile “eval” could not be activated because it does not exist.
Found the issue:
- “Apigee Edge Environment name” must be “test” or “prod”
- “Apigee Edge Organization name” is exactly as shown on the top left (Example “yourusername-eval”)
Thanks to this answer I could realize what was going on.
In my case there was no need to change json and xml files.
Thanks Luz! that saves me a lot of time.