question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Fatal error generating Agent's connection string"

See original GitHub issue

IoT Edge edgeAgent fails with β€œFatal error generating Agent’s connection string” with this script https://docs.microsoft.com/en-us/azure/iot-edge/quickstart

System is Windows 10 Enterprise 1703 laptop

`` 
PS C:\WINDOWS\system32> Get-Service iotedge
Status   Name               DisplayName
------   ----               -----------
Running  iotedge            iotedge
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 0 seconds     mcr.microsoft.com/azureiotedge-agent:1.0
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 4 seconds     mcr.microsoft.com/azureiotedge-agent:1.0
PS C:\WINDOWS\system32> iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 5 seconds     mcr.microsoft.com/azureiotedge-agent:1.0
PS C:\WINDOWS\system32> docker logs -f edgeAgent
[2018-07-03 10:17:11 : Starting Edge Agent
[07/03/2018 10:17:11.824 AM] Edge Agent Main()
2018-07-03 10:17:12.103 +00:00 [INF] - Starting module management agent.
2018-07-03 10:17:12.290 +00:00 [INF] - Version - 1.0.0.14487025             
(52ef77db24126bf473265fc09c53d35290a2dd6b)
2018-07-03 10:17:12.291 +00:00 [INF] -
    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•
   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•
   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
   β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•

 β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β•    β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β•    
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•
 β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β•šβ•β• β•šβ•β•β•β•β•β•    β•šβ•β•       β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•

2018-07-03 10:17:12.447 +00:00 [INF] - Edge agent attempting to connect to IoT Hub via AMQP...
2018-07-03 10:17:13.119 +00:00 [INF] - Created persistent store at /tmp/edgeAgent
2018-07-03 10:17:18.442 +00:00 [WRN] - Empty edge agent config was received. Attempting to read     config from backup file
(backup.json) instead
2018-07-03 10:17:18.451 +00:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-07-03 10:17:28.476 +00:00 [WRN] - Empty edge agent config was received. Attempting to read config from backup file
(backup.json) instead
2018-07-03 10:17:28.476 +00:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-07-03 10:17:38.482 +00:00 [WRN] - Empty edge agent config was received. Attempting to read config from backup file
(backup.json) instead
2018-07-03 10:17:38.483 +00:00 [INF] - Edge agent config backup file does not exist - backup.json
2018-07-03 10:17:42.510 +00:00 [INF] - Edge agent attempting to connect to IoT Hub via AMQP over WebSocket...
2018-07-03 10:17:43.523 +00:00 [INF] - Edge agent connected to IoT Hub via AMQP over WebSocket.
2018-07-03 10:17:44.439 +00:00 [INF] - Plan execution started for deployment 17
2018-07-03 10:17:44.466 +00:00 [INF] - Executing command: "Update and start module edgeAgent"
PS C:\WINDOWS\system32> docker logs -f edgeAgent
Error: No such container: edgeAgent
PS C:\WINDOWS\system32> docker logs -f edgeAgent
2018-07-03 10:18:02.761 +00:00 [INF] - Starting module management agent.
2018-07-03 10:18:02.938 +00:00 [INF] - Version - 1.0.0-preview022.11567621     (12a8e1bb63e619b17ca685efd470ad3f412034f4)
2018-07-03 10:18:02.939 +00:00 [INF] -
    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•
   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•
   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
   β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•

 β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β•    β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β•
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•
 β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•   β–ˆβ–ˆβ•‘       β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β•šβ•β• β•šβ•β•β•β•β•β•    β•šβ•β•       β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•

2018-07-03 10:18:02.958 +00:00 [FTL] - Fatal error generating Agent's connection string.
System.FormatException: Malformed Token
   at Microsoft.Azure.Devices.Client.Extensions.CommonExtensionMethods.ToDictionary(String     valuePairString, Char kvpDelimiter, Char kvpSeparator)
at Microsoft.Azure.Devices.Client.IotHubConnectionStringBuilder.Parse(String iotHubConnectionString)
at     Microsoft.Azure.Devices.Client.IotHubConnectionStringBuilder.CreateWithIAuthenticationOverride(String iotHubConnectionString, IAuthenticationMethod authenticationMethod)
at Microsoft.Azure.Devices.Edge.Agent.Service.Program.<MainAsync>d__4.MoveNext()
PS C:\WINDOWS\system32>
``

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
druttkacommented, Jul 24, 2018

Good catch, thanks! The deployment was using the old microsoft/azureiotedge-agent:1.0-preview image.

I was using Set Modules from within the Portal, fresh hub, fresh device, and a fresh install of the runtime, so I overlooked what I expected to be correct defaults. I’m not 100% sure how the preview tag got in there, but things are working once I ensure we use the mcr.microsoft.com/azureiotedge-agent:1.0 image.

FWIW, my best guess at how I got the -preview tag is that I had an old entry from a bug bash in my hosts file, so might have hit a bad endpoint while using Set Modules.

0reactions
myagleycommented, Aug 6, 2018

Closing this issue as it looks to have been resolved. I’ve linked the blog article describing the migration procedure to the GA for future reference: https://azure.microsoft.com/en-us/blog/iot-edge-ga-migration/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Monitor Application Insights for Java
This article shows you how to configure Azure Monitor Application Insights for Java. Connection string and role name. Connection string and roleΒ ...
Read more >
Failed to connect to database using user [XXXX] and ... - Search
This error could occur when the connection string is wrongly provided while configuring source database connection (in InformaticaΒ ...
Read more >
Trying to connect to SQL Server using C# - Stack Overflow
I am trying to connect to SQL Server and get data. This is what I did, but it's not working: string connectionString; SqlConnection...
Read more >
Inability to connect to database should be treated as fatal ...
Problem /Motivation Drupal tries to perform actions with database even when the connection to the database has failed.
Read more >
Agent Deployment Fatal Error
Solved: We are new to ePolicy Orchestrator, and currently working on deploying to a basic set of PCs for testing and training. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found