Coder Social home page Coder Social logo

Comments (27)

raamanihilent avatar raamanihilent commented on August 14, 2024 1

Thanks Let me inspect and get back.

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

Thanks for the update Parvez.
@sushilraje

I am listing a few more items, which i encountered during my debugging by starting the services separately in a command prompt by using the run.cmd inside docker directory.

  1. The container APIs are accessible from the browser. However they are not reached by the containers.
  2. Some of the expected collections and values are not present in the Cosmos DB.
    http://localhost:9022/v1/collections/device-twin-properties/values/cache
    http://localhost:9022/v1/collections/solution-settings/values/seedMutex
    http://127.0.0.1:9004/v1/rules
  3. If there is no seed data injection, please provide steps to call the REST APIs(headers/body)

Hope this helps.
Thanks

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent: I believe you need to run the pcs -s local command after pcs login but before docker-compose up. Please run it and let me know if it works.

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

@sushilraje
Thanks.
It did not help.
when i run the pcs -s local command, the command prompts to create Azure resources, which was already done by executing the start.cmd command from the documentation link provided earlier.

The following steps were followed and i could verify that the azure resources were created.
Run the start.cmd script. The script prompts you for the following information:
A solution name.
The Azure subscription to use.
The location of the Azure datacenter to use.

Will wait for your updates. Ty.

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent:
It seems that start.cmd didn't stamp the environment variables on your machine. I will try to repro this issue. But a quick fix would be to create following environment variables on your machine.
PCS_KEYVAULT_NAME
PCS_AAD_APPID
PCS_AAD_APPSECRET
Values for these variables would be
Go to your azure portal go to resource group (same as solution name)
keyvault-****
go to keyvault > secrets
aadAppId
aadAppSecret

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

@sushilraje
Thanks for the information.
It was set correctly by start.cmd command. I have verified this before creating the issue.
Here is my env snapshot.
image
Will wait for your updates.

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent Which docker compose yaml file are you using?
azure-iot-pcs-remote-monitoring-dotnet\services\scripts\local OR
azure-iot-pcs-remote-monitoring-dotnet\scripts\local

You should be using the one underneath the services folder.

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

yes I ran the script from
azure-iot-pcs-remote-monitoring-dotnet\services\scripts\local

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

Can you check foll,?
Does your docker-compose.yml file have foll structure,

especially the highlighted environment variables.

:
image: azureiotpcs/
-dotnet:testing
.........
environment:
- PCS_KEYVAULT_NAME
- PCS_AAD_APPID
- PCS_AAD_APPSECRET

Also, could you try deleting all the images from your local machine and try docker-compose up?

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

Yes and i deleted all the images, ran docker-compose up.
Did not work .
Will wait for your updates.

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

Can you docker inspect on any of the containers and ensure that the variables are correct values are passed through?

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

I tried it out locally, it did work for me.
Please do docker inspect and check if the required three variables
PCS_AAD_APPID,
PCS_AAD_APPSECRET,
KEYVAULT_NAME
are getting passed along correctly as environment variables to the container.
Also, what is the tag of your containers?

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent: Were you able to get any data around the issue?

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

@sushilraje Since you mentioned it worked for you locally, I am planning to redo the steps. Let me get back to you with my updates.

from azure-iot-pcs-remote-monitoring-dotnet.

raamanihilent avatar raamanihilent commented on August 14, 2024

@sushilraje
As mentioned i cleaned up my environment.
Followed the steps again and tried docker-compose up. The local proxy was failing with error -

ERROR: for reverseproxy Cannot start service reverseproxy: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused "rootfs_linux.go:58: mounting \"/host_mnt/c/MyStuff/remotemonitoring/azure-iot-pcs-remote-monitoring-dotnet/services/scripts/local/config/nginx.conf\" to rootfs \"/var/lib/docker/overlay2/f9531ebe0054b7d0436008af3945903e9f311f3052d029ab202d0ef3dba0cbd7/merged\" at \"/var/lib/docker/overlay2/f9531ebe0054b7d0436008af3945903e9f311f3052d029ab202d0ef3dba0cbd7/merged/app/config/nginx.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

I then stopped all my containers, started each container in a separate window and inspected them.
I could verify the following environment variables set via docker inspect
"PCS_KEYVAULT_NAME=",
"PCS_AAD_APPID=",
"PCS_AAD_APPSECRET=",

However these are my errors in console -
Config container

StorageAdapter returns 0 for request http://localhost:9022/v1/collections/device-twin-properties/values/cache, {"Uri":"http://localhost:9022/v1/collections/device-twin-properties/values/cache","StatusCode":0,"Content":"An error occurred while sending the request. - Couldn't connect to server"}

ASA

Received error updating device to device group mapping, {"e":{"ExceptionFullName":"Microsoft.Azure.IoTSolutions.AsaManager.Services.Exceptions.ExternalDependencyException","ExceptionMessage":"Unable to get list of device groups","StackTrace":" at Microsoft.Azure.IoTSolutions.AsaManager.DeviceGroupsAgent.DeviceGroupsClient.d__8.MoveNext() in /home/azureiotpcs/vsts-agent/_work/20/s/asa-manager/DeviceGroupsAgent/DeviceGroupsClient.cs:line 83\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at Microsoft.Azure.IoTSolutions.AsaManager.DeviceGroupsAgent.Agent.d__13.MoveNext() in /home/azureiotpcs/vsts-agent/_work/20/s/asa-manager/DeviceGroupsAgent/Agent.cs:line 85","Source":"Microsoft.Azure.IoTSolutions.AsaManager.DeviceGroupsAgent","Data":{},"InnerException":{"ExceptionFullName":"Microsoft.Azure.IoTSolutions.AsaManager.Services.Exceptions.ExternalDependencyException","ExceptionMessage":"Unable to load get device groups","StackTrace":" at Microsoft.Azure.IoTSolutions.AsaManager.Services.Http.HttpClient.d__9`1.MoveNext() in /home/azureiotpcs/vsts-agent/_work/20/s/asa-manager/Services/Http/HttpClient.cs:line 104\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at Microsoft.Azure.IoTSolutions.AsaManager.DeviceGroupsAgent.DeviceGroupsClient.d__8.MoveNext() in /home/azureiotpcs/vsts-agent/_work/20/s/asa-manager/DeviceGroupsAgent/DeviceGroupsClient.cs:line 78","Source":"Microsoft.Azure.IoTSolutions.AsaManager.Services","Data":{},"InnerException":null}}}

iot_hub_manager

[StorageAdapterClient:CheckStatusCode] StorageAdapter returns 0 for request http://localhost:9022/v1/collections/device-twin-properties/values/cache, {"Uri":"http://localhost:9022/v1/collections/device-twin-properties/values/cache","StatusCode":0,"Content":"An error occurred while sending the request. - Couldn't connect to server"}

Will wait for your updates.
Thanks

from azure-iot-pcs-remote-monitoring-dotnet.

ac2707 avatar ac2707 commented on August 14, 2024

deploy locally with Visual studio - cannot start the microservices as well - any leads on this ?

image

environment variables set correctly -
image

any more changes here ? please advise, thanks

from azure-iot-pcs-remote-monitoring-dotnet.

ac2707 avatar ac2707 commented on August 14, 2024

Also can you provide more details for the deploy with VS Code -
Deploy all other microservices on local machine
Open the azure-iot-pcs-remote-monitoring-dotnet module from your local copy in VS Code.
Copy the files launch.json and tasks.json from scripts\local\launch\idesettings\vscode. Create a new folder azure-iot-pcs-remote-monitoring-dotnet.vscode and paste the files there.
Open the Debug panel in VS Code and run the Run all microservices configuration. This configuration runs the device simulation microservice in Docker and runs the other microservices in the debugger.
don't see an option in debug panel for running all microservices... can you please provide detailed steps for this. Thanks

from azure-iot-pcs-remote-monitoring-dotnet.

ac2707 avatar ac2707 commented on August 14, 2024

The microservices don't start when doing a docker compose up either - screenshot below
Can you please add on more steps here to have it running. Thanks.

image

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent @ac2707 I am extremely sorry for the delayed response.

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent: We do need to mount a directory containing nginx.conf file on to the docker container.
If you are using Windows, you will need to give permissions to docker daemon.
Open your docker console > settings > Shared Drives > Select your drives > Apply
image
image

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@ac2707 sn

deploy locally with Visual studio - cannot start the microservices as well - any leads on this ?

image

environment variables set correctly -
image

any more changes here ? please advise, thanks

This is actually working. The logs are not Error level but warnings. Here microservices are trying to inherit env variables. As a first step, the services try to inherit files from local env, if not found then the services go to key-vault. Since you have given key-vault credentials, the services will get the variables/secrets from key-vault.

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

Also can you provide more details for the deploy with VS Code -
Deploy all other microservices on local machine
Open the azure-iot-pcs-remote-monitoring-dotnet module from your local copy in VS Code.
Copy the files launch.json and tasks.json from scripts\local\launch\idesettings\vscode. Create a new folder azure-iot-pcs-remote-monitoring-dotnet.vscode and paste the files there.
Open the Debug panel in VS Code and run the Run all microservices configuration. This configuration runs the device simulation microservice in Docker and runs the other microservices in the debugger.
don't see an option in debug panel for running all microservices... can you please provide detailed steps for this. Thanks

In your file launch.json from scripts\local\launch\idesettings\vscode, do you see "compound" section with name "Run all Microservices" as here?

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

The microservices don't start when doing a docker compose up either - screenshot below
Can you please add on more steps here to have it running. Thanks.

image

This is a different issue than just provisioning. Can you open up a new issue? In that please add foll. details

  1. o/p of docker ps
  2. o/p of docker ps -a
  3. Complete logs of
    1. UiConfig/Config
    2. Device Simulation
    3. Storage Adapter microservices,
      preferably as files

from azure-iot-pcs-remote-monitoring-dotnet.

sushilraje avatar sushilraje commented on August 14, 2024

@raamanihilent & @ac2707 Do let me know if you face any further issues.

from azure-iot-pcs-remote-monitoring-dotnet.

ac2707 avatar ac2707 commented on August 14, 2024

The microservices don't start when doing a docker compose up either - screenshot below
Can you please add on more steps here to have it running. Thanks.
image

This is a different issue than just provisioning. Can you open up a new issue? In that please add foll. details

  1. o/p of docker ps

  2. o/p of docker ps -a

  3. Complete logs of

    1. UiConfig/Config
    2. Device Simulation
    3. Storage Adapter microservices,
      preferably as files

Device simulation --
image

from azure-iot-pcs-remote-monitoring-dotnet.

ac2707 avatar ac2707 commented on August 14, 2024

@ac2707 sn

deploy locally with Visual studio - cannot start the microservices as well - any leads on this ?
image
environment variables set correctly -
image
any more changes here ? please advise, thanks

This is actually working. The logs are not Error level but warnings. Here microservices are trying to inherit env variables. As a first step, the services try to inherit files from local env, if not found then the services go to key-vault. Since you have given key-vault credentials, the services will get the variables/secrets from key-vault.

The command prompts and the web browser windows close, unable to run the microservices from Visual studio..
debug output log in Visual studio below -

image

from azure-iot-pcs-remote-monitoring-dotnet.

fahadashrafi avatar fahadashrafi commented on August 14, 2024

Any Solution Found for starting microservices ???

from azure-iot-pcs-remote-monitoring-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.