-
Notifications
You must be signed in to change notification settings - Fork 41
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
AducIotAgent cannot find custom step handler #626
Comments
@MoritzSKB , thank you for reporting this issue. Could you check/share the owner and permission of the installed extension (/var/lib/adu/extensions/sources/libkb_tf_1.so) please? |
@Nox-MSFT I checked the permissions and even with them being set to the same as the other handler .so files, the error persists. |
@MoritzSKB are you able to debug it? I'm wondering if this is a dependency issue. How did you build your extension? Is there any dependency that need to be installed on the device? (according to this error: "cannot open shared object file: No such file or directory.") |
@Nox-MSFT I am not too familiar with the project, so I can only go off the logs I sent here before. |
@MoritzSKB , could you elaborate on this please? " I did not change any of the scripts/files besides adding my handler as an option to the list of other step_handlers." |
@Nox-MSFT Sure. So in order to build my handler as similarly as the already existing ones, instead of compiling it on my own I used the existing infrastructure of this GitHub project. I changed the main CMakeLists.txt file, by updating the "ADUC_STEP_HANDLER_NAME_TO_DIRECOTRY_MAP" and "ADUC_STEP_HANDLERS" variables to also include my own handler, plus the build script in order to allow for my custom handler to be specified as well. And then I ran the default build program, as I stated initially, which lead to all handlers, including mine, being built. |
As a little follow up: I also tried one of the default handlers, built myself, without altering anything in its source code. There I get the same issue as well. So once again I am asking if I am building the project correctly or if I am missing something. |
Expected Behaviour
The custom handler should be found and run normally
Current Behaviour
When running a device update using the custom agent, it almost immediately flips to the failed state. Checking the logs, this is caused by the .so of my custom handler not being found.
Steps to Reproduce
Assuming custom handler structure is the same as other step handlers and found in the same directory:
./scripts/build.sh -t Release --step-handlers kb/tf
AducIotAgent --extension-type updateContentHandler --register-extension /var/lib/adu/extensions/sources/libkb_tf_1.so --extension-id 'kb/tf:1'
Device Information
Logs
Relevant snippet of /var/log/adu/du-agent.20240515-134117.log:
(newlines added for readablity)
Content of /var/log/adu/steps-handler.20240515-141006.log:
Additional Information
I am trying to implement a custom step handler for the AducIotAgent, following this guide, however I cannot seem to get it to work.
When I try to push an update using the Azure Portal, I get an error (found in the steps-handler log file). This error is generated because the function
ADUCPAL_dlopen
, run here, fails to open the handler. This function, found insrc/libaducpal/src/dlfcn.c
seems to use an external function (LoadLibrary()
) defined inwindows.h
to load the library.So I cannot check in further detail where this error arises, and the error message is not clear about what is causing the problem. I have checked multiple times, and the filepath is correct. The hash of the file is also correct, otherwise the program would have responded with a different error. So the agent can verify that the hash of my custom handler is correct, but right afterwards it tells me that 'no such file exists'? I find this contradictory. Did I build the custom handler wrong? Or did I not set some parameters correctly? How do I fix this issue?
I already spoke to Microsoft Support using a support request in the Azure Portal. I was told to open an issue here, with a reference to that support ticket. It's ID is 2404110050002607
The text was updated successfully, but these errors were encountered: