-
Notifications
You must be signed in to change notification settings - Fork 95
Developer Troubleshooting Guide
Use this troubleshooting guide to help to identify and resolve commonly encountered issues for Azure IoT Preconfigured Solutions development tasks.
If you are unable to find the solution to an issue here, please check out our Developer Reference Guide or file an issue.
- What to do when a deployment fails
- How do I know if the app is running?
- View aggregated logs for deployed services
- View logs for a deployed service
- How do I know if telemetry is flowing?
- Pull the logs to a local machine for a container
- Resolve errors for resource provider registration
- Cosmos DB Consistency Errors
When starting a new deployment from the pcs-cli, you may see output showing one of the deployed resources fails. More information is available from portal.azure.com under Resource Groups > Your Resource Group > Deployments > Your Deployment > Operation Details.
Check that you don't need to update some setting with your subscription (like too many IoT Hubs), delete the resource group with the failure, and try again.
We are working on a solution to redeploy a single failed resource, stay tuned.
Visit the URL for your deployment, https://{deployment-name}.azurewebsites.net/. You should see simulated telemetry flowing in the chart. Is you aren't seeing any telemetry, you can check the status of the application on the VM.
- SSH into the VM
- use
docker ps -a
Example output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b84eeb26c07a azureiotpcs/remote-monitoring-nginx:latest "/bin/bash /app/ru..." 12 minutes ago Up 12 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app_reverseproxy_1
c66af1abbafb azureiotpcs/pcs-remote-monitoring-webui:latest "/bin/sh /app/run.sh" 12 minutes ago Up 12 minutes 80/tcp, 443/tcp app_webui_1
8cb29cd3902d azureiotpcs/telemetry-agent-dotnet:latest "/bin/bash /app/ru..." 13 minutes ago Up 13 minutes app_telemetryagent_1
d96b506acf7a azureiotpcs/pcs-config-dotnet:latest "/bin/bash /app/ru..." 13 minutes ago Up 13 minutes app_config_1
6c6802aacd91 azureiotpcs/device-simulation-dotnet:latest "/bin/bash /app/ru..." 13 minutes ago Up 13 minutes app_devicesimulation_1
47ec9f594920 azureiotpcs/telemetry-dotnet:latest "/bin/bash /app/ru..." 13 minutes ago Up 13 minutes app_telemetry_1
3531b19916be azureiotpcs/pcs-storage-adapter-dotnet:latest "/bin/bash /app/ru..." 13 minutes ago Up 13 minutes app_storageadapter_1
d84d888d55e3 azureiotpcs/pcs-auth-dotnet "/bin/bash /app/ru..." 13 minutes ago Up 13 minutes app_auth_1
67dbea599512 azureiotpcs/iothub-manager-dotnet "/bin/bash /app/ru..." 14 minutes ago Up 14 minutes app_iothubmanager_1
- SSH into the VM
- navigate to the app folder from the home directory:
cd /app
- run the logs script from the terminal (root access required)
sudo ./logs.sh
- SSH into the VM
- List all containers with
docker ps -a
- Get the logs for a running container
docker logs {Container ID}
ordocker logs --tail 100 {Container ID}
(lists last 100 lines of log file)
- Open a bash terminal.
- SSH into the VM using the instructions above in "SSH into a VM".
- Find your container name or id with
docker ps
. - Write the logs for a container to disk:
docker logs <containerid> >& simlog.log
- Ensure the log data is present:
sudo nano container.log
- Open a second bash terminal on your local machine.
- Copy the file local:
scp <username>@<vm ip>:container.log c:/temp/container.log
If telemetry is flowing, you should see the telemetry on the dashboard page. If you aren't seeing any telemetry, you can try the following steps.
- Check the logs for the telemetry service, and the telemetry agent service on the VM, see View logs for a deployed service
- Disable auth and send sample requests via Postman.
If deployment fails because a resource is not available in a selected region, follow the instruction.
If you see the following error:
DocumentDbKeyValueContainer.CreateDatabaseIfNotExistsAsync
ConsistencyLevel Strong specified in the request is invalid when service is configured with consistency level Session. Ensure the request consistency level is not stronger than the service consistency level.
This is caused by the RequestOptions not matching the same consistency as the deployed resource. Update the default consistency to match.