-
Notifications
You must be signed in to change notification settings - Fork 20
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
do-client download fails #32
Comments
@Voxel07 Thanks for the feedback, mind sharing the full do agent logs - or are those two lines of text the only ones appearing? The json file not being present is not a fatal error, the logging should just reflect that the file isn't there - but this shouldn't block your download. Having more logging would help. From the adu-agent logging, that specific error code bubbling from DO is maps to E_INVALIDARG, this usually signals something wrong with the filepath or the download url. The url looks okay, so I suspect perhaps DO may not have permissions to download to that directory. Is the DU agent running as DU user? Is DO running as DO user? |
I will post the whole log on Monday, but I think the rights might be the issue, because when I check with ls -l everything was root. @jimson-msft The whole log: 2021-04-23T11:45:16.9965108Z 787 787 info {Run} Started, DU;deliveryoptimization-agent/v0.4.0+20210422.071111.b40eeac (HEAD) |
@Voxel07, how strange - it looks like the caller of the download_url_to_path() api is supplying an empty url, and it looks like the download path is getting supplied with respective download url. Taking a look at logging line here: 2021-04-23T13:44:32.5969194Z 787 868 info {Download} de5d13bf-8cca-9d49-be24-10424938a42b, new download, url: , dest: http://iot-hub-update-instance-schneider--device-update-schneider.b.nlu.dl.adu.microsoft.com/northeurope/IoT-Hub-Update-Instance-Schneider--device-update-schneider/8761c4bc9566483a94ef012d0426f9b2/workingUpdate Notice the empty url, and the presumed download url getting supplied as the download file destination. Did you happen to modify the source for either client? |
@jimson-msft, I compared the files with meld and could not find a relevant change. So reverted all changes and no that made no difference. To be a 100% sure I downloaded the newest releases from git (changed from 0.6.0 to 0.7.0) and ran the whole setup again. And the log changed. Now the url and dest contain the correct paths. Out of Curiosity I installed the agent with my changes and the the missing url error is gone as well. I think I had changes in the background which were overwritten by the install-deps script. Unfortunately the E _INVALIDARG Error is still present. Permissionsmatthias@matthias-VirtualBox:/tmp$ sudo ls -la aduc-dl-210426095427/ matthias@matthias-VirtualBox:/tmp$ sudo -H -u adu bash -c 'mkdir aduc-dl-210426124154/test' NewLog
|
Thanks @Voxel07, In this case - the E_INVALIDARG may be the result of the DU and DO user/groups not being set up. The error specifically looks like DO does not have permissions to download to the destination path (the DU sandbox). DU agent runs as DU user and DO runs as DO user - in our binary distributions (debian packages) - the debian control scripts handle provisioning this. If you're building from source, its possible that the DU and DO user/group is not being setup correctly. I believe I've seen this issue a couple times on the DU github issues as well - so this is great feedback for our teams to make the the provisioning of the user/group more clear. Consider reviewing our control scripts (they're just shell scripts) to find the relevant code to setup the DO/DU users directly. The DU control script which handles post-install and setup of the user/group can be run from here: |
@jimson-msft I already looked into the src code to find out how it should be and wrote my own setup script. But I will take another look into this tomorrow.
And when looking at the process with "top" I can see that DU is running as du and DO as do. The only thing remaining thing is the do agent exe in /usr/local/bin
should this be
|
Here are the updated instructions on how to create 'adu' user and group that includes the DO agent. |
@ValOlson @jimson-msft Thank you very much for helping with this.
If my research is correct, then this is the folder for programs installed with a package manager. And when compiling software with cmake,... it should be placed in /user/local/lib. Pls correct me if I am wrong, because the build.sh with the --install option puts it into /usr/lib/adu.
|
@jimson-msft, @ValOlson can this issue be closed? |
When an update is deployed, the download starts and then fails with an exception.
When looking into the do log files at /var/cache/deliveryoptimization-agent/log the first line states:
What should this file contain ? The sdk-config.json is present and just contains the connection string.
Complete log:
matthias@matthias-VirtualBox:~/Desktop/azure/iot-hub-device-update$ sudo AducIotAgent --log-level 0
2021-04-21T14:20:23.0557Z [I] Agent (linux; 0.6.0-public-preview) starting. [main]
2021-04-21T14:20:23.0557Z [I] Git Info: main:55abcef [main]
2021-04-21T14:20:23.0557Z [I] Agent built with handlers: microsoft/swupdate. [main]
2021-04-21T14:20:23.0559Z [I] Initalizing PnP components. [ADUC_PnP_Components_Create]
2021-04-21T14:20:23.0560Z [I] ADUC agent started. Using IoT Hub Client SDK 1.6.0 [AzureDeviceUpdateCoreInterface_Create]
2021-04-21T14:20:23.0560Z [I] Calling ADUC_Register [ADUC_MethodCall_Register]
2021-04-21T14:20:23.0561Z [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]
2021-04-21T14:20:23.0564Z [I] Agent running. [main]
2021-04-21T14:20:23.4168Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
2021-04-21T14:20:23.8656Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-04-21T14:20:23.8657Z [D] OrchestratorUpdateCallback received property JSON string ({"action":255,"updateManifest":"","updateManifestSignature":""}), property version (7) [OrchestratorUpdateCallback]
2021-04-21T14:20:23.8662Z [I] Performing startup tasks. [ADUC_Workflow_HandleStartupWorkflowData]
2021-04-21T14:20:23.8663Z [I] Calling IsInstalledCallback to check if content is installed. [ADUC_MethodCall_IsInstalled]
2021-04-21T14:20:23.8664Z [I] IsInstalledCallback called [IsInstalledCallback]
2021-04-21T14:20:23.8664Z [I] IsInstalled called workflowId: , installed criteria: (null) [IsInstalled]
2021-04-21T14:20:23.8667Z [E] Failed to create content handler, updateType:(null) [IsInstalled]
2021-04-21T14:20:23.8668Z [W] IsInstalled call failed. ExtendedResultCode: -536870781 - setting state to Idle [ADUC_Workflow_HandleStartupWorkflowData]
2021-04-21T14:20:23.8668Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-04-21T14:20:23.8669Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-04-21T14:20:23.8670Z [I] UpdateAction: Idle. WorkflowId: 210421142023 [ADUC_MethodCall_Idle]
2021-04-21T14:20:23.8670Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-04-21T14:20:23.8670Z [I] Now idle. workflowId: 210421142023 [Idle]
2021-04-21T14:20:23.8674Z [I] Processing existing Device Twin data after agent started. [ADUC_PnPDeviceTwin_Callback]
2021-04-21T14:20:23.8674Z [D] Notifies components that all callback are subscribed. [ADUC_PnPDeviceTwin_Callback]
2021-04-21T14:20:23.8674Z [I] DeviceInformation component is ready - reporting properties [DeviceInfoInterface_Connected]
2021-04-21T14:20:23.8676Z [I] Property manufacturer changed to FuS [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8677Z [I] Property model changed to imx8mm [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8677Z [I] Property osName changed to Linux [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8679Z [I] Property swVersion changed to 5.4.0-72-generic [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8679Z [I] Property processorArchitecture changed to x86-64 [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8912Z [I] Property processorManufacturer changed to GenuineIntel [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8914Z [I] Property totalMemory changed to 4030200 [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:23.8915Z [I] Property totalStorage changed to 20509264 [RefreshDeviceInfoInterfaceData]
2021-04-21T14:20:38.3766Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-04-21T14:20:38.3772Z [D] OrchestratorUpdateCallback received property JSON string ({"action":0,"updateManifest":"{"manifestVersion":"2.0","updateId":{"provider":"Schneider","name":"newDeviceModel","version":"2.0.0"},"updateType":"microsoft/swupdate:1","installedCriteria":"test","files":{"00000":{"fileName":"workingUpdate","sizeInBytes":144549945,"hashes":{"sha256":"eNUL10t04ThmJ0l49987SZLuFvFzhYkIq/pxoQXgtdI="}}},"createdDateTime":"2021-04-19T10:11:10.4149069Z"}","updateManifestSignature":"eyJhbGciOiJSUzI1NiIsInNqd2siOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWtGRVZTNHlNREEzTURJdVVpSjkuZXlKcmRIa2lPaUpTVTBFaUxDSnVJam9pY2toV1FrVkdTMUl4ZG5Ob1p5dEJhRWxuTDFORVVVOHplRFJyYWpORFZWUTNaa2R1U21oQmJYVkVhSFpJWm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MuXRnupCZO0_8k2P9M_v7TqvVFAyUTWjMeZFs6j2Pvy9lq6qLyRp7EacYSYWwqwl-wxnYUJfpvaMHTWr13uDJH8d0y0FS","fileUrls":{"00000":"http://fsupdateinstanz--fsdeviceupdatetest.b.nlu.dl [OrchestratorUpdateCallback]
2021-04-21T14:20:38.3814Z [I] Processing 'Download' action [ADUC_Workflow_HandleUpdateAction]
2021-04-21T14:20:38.3815Z [I] UpdateAction: Prepare - calling PrepareCallback [ADUC_MethodCall_Prepare]
2021-04-21T14:20:38.3816Z [I] {210421142023} Received Metadata, UpdateType: microsoft/swupdate:1, UpdateTypeName: microsoft/swupdate, UpdateTypeVersion: 1, FileCount: 1 [Prepare]
2021-04-21T14:20:38.3817Z [I] microsoft_swupdate_CreateFunc called. [microsoft_swupdate_CreateFunc]
2021-04-21T14:20:38.3818Z [I] Prepare succeeded. [Prepare]
2021-04-21T14:20:38.3818Z [I] UpdateAction: Download [ADUC_MethodCall_Download]
2021-04-21T14:20:38.3819Z [I] Calling SandboxCreateCallback [ADUC_MethodCall_Download]
2021-04-21T14:20:38.3821Z [I] Setting sandbox /tmp/aduc-dl-210421142023 [SandboxCreate]
2021-04-21T14:20:38.3822Z [I] Using sandbox /tmp/aduc-dl-210421142023 [ADUC_MethodCall_Download]
2021-04-21T14:20:38.3822Z [I] Setting UpdateState to DownloadStarted [ADUC_SetUpdateStateHelper]
2021-04-21T14:20:38.3824Z [I] Calling DownloadCallback [ADUC_MethodCall_Download]
2021-04-21T14:20:38.3828Z [D] Downloading 1 files to /tmp/aduc-dl-210421142023 [Download]
2021-04-21T14:20:38.3829Z [I] Downloading File 'workingUpdate' from 'http://fsupdateinstanz--fsdeviceupdatetest.b.nlu.dl.adu.microsoft.com/northeurope/FsUpdateInstanz--fsdeviceupdatetest/3444d4177cd04eec99450741d6c37d9f/workingUpdate' to '/tmp/aduc-dl-210421142023/workingUpdate' [Download]
2021-04-21T14:20:38.6892Z [I] Caught DO exception, msg: unrecognized error, code: -2147024809 [Download]
2021-04-21T14:20:38.6893Z [I] ProgressCallback: workflowId: 210421142023; Id 00000; State: Error; Bytes: 0/0 [DownloadProgressCallback]
2021-04-21T14:20:38.6893Z [I] Download resultCode: 0, extendedCode: -804847529 [Download]
2021-04-21T14:20:38.6894Z [I] Action 'Download' complete. Result: 0, -804847529 [ADUC_Workflow_WorkCompletionCallback]
2021-04-21T14:20:38.6895Z [E] Download failed. error 0, -804847529 - Expecting service to send Cancel action [ADUC_Workflow_WorkCompletionCallback]
2021-04-21T14:20:38.6896Z [I] Setting UpdateState to Failed [ADUC_SetUpdateStateHelper]
2021-04-21T14:20:38.6896Z [I] Reporting state: 255, Failed (255); HTTP 500; result 0, -804847529 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-04-21T14:20:40.9971Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-04-21T14:20:40.9977Z [D] OrchestratorUpdateCallback received property JSON string ({"action":255,"updateManifest":"","updateManifestSignature":"","fileUrls":null}), property version (9) [OrchestratorUpdateCallback]
2021-04-21T14:20:40.9988Z [I] Cancel received with no operation in progress - returning to Idle state [ADUC_Workflow_HandleUpdateAction]
2021-04-21T14:20:40.9989Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-04-21T14:20:40.9990Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-04-21T14:20:40.9991Z [I] Calling SandboxDestroyCallback [ADUC_MethodCall_Idle]
2021-04-21T14:20:40.9994Z [I] Destroying sandbox /tmp/aduc-dl-210421142023. workflowId: 210421142023 [SandboxDestroy]
2021-04-21T14:20:40.9999Z [I] UpdateAction: Idle. WorkflowId: 210421142040 [ADUC_MethodCall_Idle]
2021-04-21T14:20:41.0000Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-04-21T14:20:41.0000Z [I] Now idle. workflowId: 210421142040 [Idle]
^C2021-04-21T14:26:05.8100Z [I] Agent exited with code 0 [main]
2021-04-21T14:26:05.8100Z [I] Agent is shutting down with signal 2. [ShutdownAgent]
2021-04-21T14:26:05.8100Z [I] ADUC agent stopping [AzureDeviceUpdateCoreInterface_Destroy]
2021-04-21T14:26:05.8101Z [I] Calling ADUC_Unregister [ADUC_MethodCall_Unregister]
Error: Time:Wed Apr 21 16:26:05 2021 File:/tmp/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:openssl_static_locks_uninstall Line:585 Locks already uninstalled
The text was updated successfully, but these errors were encountered: