Azure / pcs-cli

A CLI for deploying Azure IoT PCS
MIT License
33 stars 37 forks source link

CLI RM standard deployment failed - SyntaxError #534

Closed skylinefly closed 3 years ago

skylinefly commented 4 years ago

Type of issue

Description

After psc -t remotemonitoring -s standard -r dotnet and appointing of necessary information the deployment process hungs with SyntaxError right after Application registration. It is always responds with "Unexpected token p in JSON at position 8642".

PS C:\Users\user\pcs-cli> pcs -t remotemonitoring -s standard
? Enter a solution name: name
? Select a subscription: subscription
? Select a location: North Europe
? Enter prefix for .azurewebsites.net: unicwebname
✓ Application registered: https://portal.azure.com/_changed_.onmicrosoft.com#blade/Microsoft_AAD_IAM/ApplicationBlade/objectId/d1ba0337-52cb-4a53-a016-dadf95334d2a/appId/c5fcac85-c339-4183-89d2-1bcf2f1ca291
SyntaxError: C:\Users\user\pcs-cli\publish\solutions\remotemonitoring\armtemplates\standard.json: Unexpected token p in JSON at position 8642
    at parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:1192:22)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at DeploymentManager.submit (C:\Users\user\pcs-cli-master\publish\deploymentmanager.js:75:30)
    at C:\Users\user\pcs-cli\publish\index.js:306:54
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Steps to reproduce

All done in Power Shell

  1. cd ~
  2. npm install -g iot-solutions
  3. git clone https://github.com/Azure/pcs-cli.git
  4. cd pcs-cli
  5. npm install
  6. npm start
  7. npm link / could be ommited /
  8. Sign in using pcs login and credentials for an Azure account
  9. run a deployment process by any of listed command: pcs -t remotemonitoring -s standard pcs -t remotemonitoring -s standard -r dotnet pcs -t remotemonitoring -s standard -r java
  10. described error appearing.

Expected behavior

Request for VM credentials and normal deployment process flow. RM solution deployment successfully finished

Current behavior <!-- The actual behavior observed --

Application name is registering in AAD - App registrations and process completely hungs up. Termination is possible by ^C.

Known workarounds

...

Possible solution

...

Context and Environment

skylinefly commented 4 years ago

Same error apear under Ubuntu 18.04 LTS with Nodejs v13.9.0 and npm 6.13.7

skylinefly commented 4 years ago

So, to fix the problem described you need to make some changes in file pcs-cli/publish/solutions/remotemonitoring/armtemplates/standard.json In 240 string there is "pcs" statment that is typo mistake. Just delete it and save the file. After that you will able to proceed with deployment as well. For Linux the file is located _/usr/local/lib/nodemodules/iot-solutions/publish/solutions/remotemonitoring/armtemplates/standard.json

skylinefly commented 4 years ago

Probably this should keep opened to fix the issue in repository.

baranyiszabolcs commented 4 years ago

HI after fixing the json file another bug occurs deails and how to reproduce see below