Closed neildes2 closed 4 months ago
You can't have two adapters with the same name. Did you try changing the name of the second adapter?
Maybe this just needs better error handling.
I changed the names to machine1 and machine2 and still got the error...
Looks like the issue is with duplicate adapter URLs in the AGENT device adapter listings. If the mqtt adapter connects to the broker, there is no issue. Its when it doesnt connect, it defaults to localhost 7878
I'll check this out. I have no idea how the host and port are getting reset when it doesn't connect.
Can you upload you cfg file?
When it cant connect, it tries to connect to localhost 7878. I think this was an AUTO repair feature of some sort. The problem is if I have a second adapter already set to localhost 7878, it generates an error and crashes.
Can you paste the lines from there cfg for all the adapters.
This Crashes...
Devices = Devices.xml AgentDeviceUUID = "3519a48b-814b-3425-a12d-ef250947ab3d" PreserveUUID = true Port = 5000 BufferSize = 17 MaxAssets = 1024 SchemaVersion = 2.2 ShdrVersion = 1 SuppressIPAddress = false DisableAgentDevice = false MonitorConfigFiles = false WorkerThreads = 2 JsonVersion = 1 ConversionRequired = true IgnoreTimestamps = true Pretty = true HeartBeat = 60000
Adapters {
machine1{ Device = machine Host = localhost Port = 7878
}
machine2 { Device = machine Url = mqtt://10.1.2.3/ MqttPort = 1885 MqttUserName = user1 MqttPassword = "password" Topics = "machinename/ingress/#" MqttClientId = machinename-1333
} }
logger_config {
logging_level = trace
}
Thanks. I'll try to reproduce
The issue was with URL parsing and I have a fix in the current 472 branch.
Agent v2.3.0.14
It appears that if an adapter fails to connect, it will try to connect to localhost 7878. A default. This causes an issue if there are two adapters configured and one of them fails to connect. You end up with duplicate adapter settings and the agent crashes.
I had a shdr adapter followed by an mqtt broker adapter. If the mqtt adapter fails, I ended up with TWO localhost 7878 adapters.
Adapters{ device{ Host = localhost Port = 7878 } device{ URL = mqtt://10.x.x.x:1883 . . . } }
Note that this only happens if the mqtt broker URL has a forward slash "/" at the end of it.