Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent is suddenly closing itself #456

Closed
okanberhoglu opened this issue May 17, 2024 · 23 comments
Closed

Agent is suddenly closing itself #456

okanberhoglu opened this issue May 17, 2024 · 23 comments

Comments

@okanberhoglu
Copy link

Hello,
I am currently working with the cpp agent version 2.3.0.9 and with multiple adapters. When I started only the agent, it worked and tried to connect the adapter. However, When I started the adapter and agent together, the agent worked and after a few minutes closed itself without giving an error or anything.
Besides, when I started the adapter first and it runed for a while, I could not start the agent. It opens and closes itself suddenly.
What do you think about my situation and do you have any suggestions?

Thank you,

@wsobel
Copy link
Member

wsobel commented May 17, 2024 via email

@wsobel
Copy link
Member

wsobel commented May 17, 2024 via email

@okanberhoglu
Copy link
Author

Yes, this happened with different versions.
Agent Config File:

Devices = ./Devices.xml
SchemaVersion = 2.0
Port = 5000
MonitorConfigFile = true
Pretty = true
BufferSize = 17
LegacyTimeout = 2000

Files {
schemas {
Path = ./schemas
Location = /schemas/
}
}

Adapters {
controller {
Device = m-10
Port = 7878
Host = 127.0.0.1
}
controller {
Device = m-12
Port = 7879
Host = 127.0.0.1
}
controller {
Device = m-11
Port = 7880
Host = 127.0.0.1
}
}

logger_config {
logger_level = debug
}

Agents log:

2024-05-17T12:07:07.807020Z (0x000099d8) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig: Starting agent on port 5000
2024-05-17T12:07:07.817185Z (0x000099d8) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->Agent::initialize->Agent::loadXMLDeviceFile: MTConnect Schema Version of file: C:\Users\Okan\Desktop\DataCollection\Agent\Devices.xml = 2.0
2024-05-17T12:07:07.817185Z (0x000099d8) [error] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->Agent::initialize->Agent::loadXMLDeviceFile: Duplicate component id: m-10 for device m-10, skipping
2024-05-17T12:07:07.817185Z (0x000099d8) [error] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->Agent::initialize->Agent::loadXMLDeviceFile: Duplicate component id: m-12 for device m-12, skipping
2024-05-17T12:07:07.817185Z (0x000099d8) [error] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->Agent::initialize->Agent::loadXMLDeviceFile: Duplicate component id: m-11 for device m-11, skipping
2024-05-17T12:07:07.827202Z (0x000099d8) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for m-10: controller
2024-05-17T12:07:07.827202Z (0x000099d8) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for m-12: controller
2024-05-17T12:07:07.827202Z (0x000099d8) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for m-11: controller
2024-05-17T12:07:07.833274Z (0x0000a540) [info] Connector::connected: Connected with: 127.0.0.1:7879
2024-05-17T12:07:07.833274Z (0x0000a540) [info] Connector::connected: Connected with: 127.0.0.1:7880

@okanberhoglu okanberhoglu changed the title The agent suddenly stops Agent is suddenly closing itself May 17, 2024
@wsobel
Copy link
Member

wsobel commented May 17, 2024 via email

@okanberhoglu
Copy link
Author

The adapter is sending shdr data continuously in a infinite loop even if data is not change. Is that a problem for agent?

@wsobel
Copy link
Member

wsobel commented May 17, 2024 via email

@okanberhoglu
Copy link
Author

I am using the DotNetAdapterSDK Nuget package for sending data. I am using the packages' functions. Therefore I can not capture the output.

@okanberhoglu
Copy link
Author

I used a different cpp agent version and it gave this error:

2024-05-17T14:28:45.349360Z (0x000077c4) [info] Connector::connected: Connected with: 127.0.0.1:7878
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument
2024-05-17T14:28:47.892970Z (0x000077c4) [error] Connector::reader->Connector::parseSocketBuffer->Connector::processLine->ShdrAdapter::processData: Error in processData: invalid stod argument

@wsobel
Copy link
Member

wsobel commented May 17, 2024 via email

@wsobel
Copy link
Member

wsobel commented May 17, 2024 via email

@wsobel wsobel added the bug label May 18, 2024
@wsobel
Copy link
Member

wsobel commented May 18, 2024

I have gone through every usage of stod and nothing throws. I'm trying to reproduce. I really need the adapter output to know what is causing this problem. Without it, I cannot debug.

There is a ruby script called "dump_adapter.rb" in the tools directory. Run on the command line like this:

C:> ruby dump_adapter.rb 127.0.0.1 7878 adapter.log

replace 127.0.0.1 and 7878 with the adapter host and port in the cfg file.

@wsobel wsobel self-assigned this May 18, 2024
@wsobel
Copy link
Member

wsobel commented May 18, 2024

Another option is to set the logging level to trace:

logger_config {
  level = trace
}

@okanberhoglu
Copy link
Author

Thank you very much for your help. I found the data causing this problem and fixed it.

@wsobel
Copy link
Member

wsobel commented May 20, 2024

Can you please share what the data was. I'd like to fix it in the agent.

@wsobel wsobel reopened this May 20, 2024
@okanberhoglu
Copy link
Author

It was the G code data. The Adapter was sending G code line that contains numbers and letters. In my opinion, agent tries to convert this data string to double but it also contains letters so agent throws error and closes itself.

@wsobel
Copy link
Member

wsobel commented May 20, 2024 via email

@wsobel
Copy link
Member

wsobel commented May 22, 2024

@okanberhoglu

I would like to see if I can reproduce this issue, please give the info you found to resolve it.

@okanberhoglu
Copy link
Author

The data is like "G23G7I-9.1 G30G5X23".

@wsobel
Copy link
Member

wsobel commented May 23, 2024 via email

@okanberhoglu
Copy link
Author

okanberhoglu commented May 23, 2024

Yes, I am using Windows.
The DataItem xml is /<DataItem category="EVENT" id="line" type="MESSAGE"//>

@wsobel
Copy link
Member

wsobel commented May 23, 2024

Btw. The message is not the right type for this data item. It should be a BLOCK. Regardless, it is also supposed to take 3 values, the data item name, native code, and the value.

This should help narrow down the issue quite a lot. I'll try to reproduce with a message.

Thanks
W

@okanberhoglu
Copy link
Author

Thank you for the help.

@wsobel
Copy link
Member

wsobel commented Jul 15, 2024

I'll close this if it is no longer an issue. Please respond.

@wsobel wsobel closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants