Azure / azure-iot-pcs-remote-monitoring-dotnet

Azure IoT .NET solution for Remote Monitoring
MIT License
162 stars 95 forks source link

Error: Invalid character at position.1 #113

Closed YeyoCoder closed 6 years ago

YeyoCoder commented 6 years ago

Type of issue

Description

After following the intructions of https://github.com/Azure/azure-iot-pcs-remote-monitoring-dotnet/wiki/Manual-steps-to-create-azure-resources-for-local-setup I am not able to execute the solution locally. The Error: Invalid character at position.1 appears and I don´t know why.

Screenshot

image

Steps to reproduce

https://github.com/Azure/azure-iot-pcs-remote-monitoring-dotnet/wiki/Manual-steps-to-create-azure-resources-for-local-setup The only thing that I change was the IoTHub Pricing and scale tier to Free

Expected behavior

To run as if I deploy using the web interface at https://www.azureiotsolutions.com.

Current behavior

All docker containers looks good except the asamanager_1.

asamanager_1        | [WARN][2018-07-12 15:55:32.976][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][ConfigData:ProcessOptionalPlaceholders] Environment variables not found, {"varsNotFound":", PCS_LOG_LEVEL"}
asamanager_1        | [WARN][2018-07-12 15:55:33.023][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][ConfigData:ProcessOptionalPlaceholders] Environment variables not found, {"varsNotFound":", PCS_AUTH_ISSUER"}
asamanager_1        | [WARN][2018-07-12 15:55:33.024][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][ConfigData:ProcessOptionalPlaceholders] Environment variables not found, {"varsNotFound":", PCS_AUTH_AUDIENCE"}
asamanager_1        | [WARN][2018-07-12 15:55:33.459][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][ConfigData:ProcessOptionalPlaceholders] Environment variables not found, {"varsNotFound":", PCS_LOG_LEVEL"}
asamanager_1        | [WARN][2018-07-12 15:55:33.463][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][ConfigData:ProcessOptionalPlaceholders] Environment variables not found, {"varsNotFound":", PCS_AUTH_ISSUER"}
asamanager_1        | [WARN][2018-07-12 15:55:33.463][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][ConfigData:ProcessOptionalPlaceholders] Environment variables not found, {"varsNotFound":", PCS_AUTH_AUDIENCE"}
asamanager_1        | [WARN][2018-07-12 15:55:33.550][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][Startup:PrintBootstrapInfo] Service started, {"ProcessId":"WebService.875e6ec5-92a9-482c-881e-97fcd67da88a","LogLevel":"Warn"}
asamanager_1        | [WARN][2018-07-12 15:55:34.002][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][AuthMiddleware:.ctor] ### AUTHENTICATION IS DISABLED! ###
asamanager_1        | [WARN][2018-07-12 15:55:34.002][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][AuthMiddleware:.ctor] ### AUTHENTICATION IS DISABLED! ###
asamanager_1        | [WARN][2018-07-12 15:55:34.002][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][AuthMiddleware:.ctor] ### AUTHENTICATION IS DISABLED! ###
asamanager_1        | [WARN][2018-07-12 15:55:34.003][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][AuthMiddleware:.ctor] ### Service to service authentication is not available in public preview ###
asamanager_1        | [WARN][2018-07-12 15:55:34.003][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][AuthMiddleware:.ctor] ### Service to service authentication is not available in public preview ###
asamanager_1        | [WARN][2018-07-12 15:55:34.003][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][AuthMiddleware:.ctor] ### Service to service authentication is not available in public preview ###
asamanager_1        | [ERROR][2018-07-12 15:55:34.486][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][Agent:SetupEventHub] Received error setting up event hub. Will not receive updates from devices, {"e":{"ExceptionFullName":"System.FormatException","ExceptionMessage":"No valid combination of account information found.","StackTrace":"   at Microsoft.WindowsAzure.Storage.CloudStorageAccount.<>c.<Parse>b__97_0(String err)\n   at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseImpl(String connectionString, CloudStorageAccount& accountInformation, Action`1 error)\n   at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString)\n   at Microsoft.Azure.EventHubs.Processor.AzureStorageCheckpointLeaseManager.Initialize(EventProcessorHost host)\n   at Microsoft.Azure.EventHubs.Processor.EventProcessorHost.<RegisterEventProcessorFactoryAsync>d__46.MoveNext()\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.<SetupEventHub>d__14.MoveNext() in /home/azureiotpcs/myagent/_work/2/s/asa-manager-dotnet/DeviceGroupsAgent/Agent.cs:line 128","Source":"Microsoft.WindowsAzure.Storage","Data":{},"InnerException":null}}
asamanager_1        | Hosting environment: Production
asamanager_1        | Content root path: /app/webservice/
asamanager_1        | Now listening on: http://[::]:9024
asamanager_1        | Application started. Press Ctrl+C to shut down.
asamanager_1        | [ERROR][2018-07-12 15:55:35.537][WebService.875e6ec5-92a9-482c-881e-97fcd67da88a][BlobStorageHelper:WriteBlobFromFileAsync] Unable to upload reference data to blob, {"e":{"ExceptionFullName":"System.FormatException","ExceptionMessage":"No valid combination of account information found.","StackTrace":"   at Microsoft.WindowsAzure.Storage.CloudStorageAccount.<>c.<Parse>b__97_0(String err)\n   at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseImpl(String connectionString, CloudStorageAccount& accountInformation, Action`1 error)\n   at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString)\n   at Microsoft.Azure.IoTSolutions.AsaManager.Services.Storage.BlobStorageHelper.<InitializeBlobStorage>d__6.MoveNext() in /home/azureiotpcs/myagent/_work/2/s/asa-manager-dotnet/Services/Storage/BlobStorageHelper.cs:line 42\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.Services.Storage.BlobStorageHelper.<WriteBlobFromFileAsync>d__7.MoveNext() in /home/azureiotpcs/myagent/_work/2/s/asa-manager-dotnet/Services/Storage/BlobStorageHelper.cs:line 60","Source":"Microsoft.WindowsAzure.Storage","Data":{},"InnerException":null}}
local_iothubmanager_1 exited with code 134

Known workarounds

...

Possible solution

Make the local deploy using the CLI of PCS.

Context and Environment

dluc commented 6 years ago

@hegate @ppathan I think the instructions are missing some recent information related to ASA.

YeyoCoder commented 6 years ago

I deployed locally following the guide Deploy the Remote Monitoring solution accelerator locally but the problem continue:

Then I deploy from azureiotsolutions.com and it work!

Why I can´t deploy it locally following the instructions of Deploy the Remote Monitoring solution accelerator locally as deployed with azureiotsolutions.com?

Any one have deployed this monitoring solution locally following the steps of Deploy the Remote Monitoring solution accelerator locally?

Can this be deploy using the Free tier of the IoTHub and the Cosmos DB Emulator?

ppathan commented 6 years ago

After deploying locally Can you go to portal.azure.com and the resource group and turn on the Azure stream analytics job to see if it fixes the problem?

ppathan commented 6 years ago

@asdonald Can you work with Dominic to make sure that our documentation is up-to-date after ASA for local deployment. Thanks!

YeyoCoder commented 6 years ago

@ppathan The Azure Stream Analytic jobs was running. I deploy the Azure services using the CLI.
All the resources needed were created and ran by the CLI command pcs -s local (IoT Hub, Storage Account, Event Hubs, CosmosDB, Stream Analytics jobs). This doesn't fix the problem!

andrejpk commented 6 years ago

A workaround you can use, edit the scripts/local/docker-compose.yaml like I did in my pull request commit: https://github.com/andrejpk/azure-iot-pcs-remote-monitoring-dotnet/commit/5519eb35b9c8eaf8ef7468968b0b18c06781569d

My dashboard is running now locally: image

andrejpk commented 6 years ago

The fix for this has been merged, suggesting we close this now. @YeyoCoder please confirm.