How to debug failing installation of own app

I developed a very simple app for my “WD MyCloud EX2 Ultra” (which runs on My Cloud OS 5) according to this documentation. The app does not contain a binary, but all the seven script files (preinst.sh, install.sh, …) are there. I was able to build the app file using mksapkg-64b.

When I upload this app file on the WebUI of my MyCloud NAS using the link “Install an app manually”, I can select the app from my local filesystem, and after this a dialog with text “Updating …” appears and stays there forever.

After this the app does not appear in the list of “Installed Apps”, and no folder for this app in /mnt/HD/HD_a2/Nas_Prog appears.

When opening " Settings | Utilities | System Diagnostics | View Logs" I also see no error/warn message concerning the upload of a new app.

I also copied the app file on a share of the NAS and used command line programm /usr/sbin/upload_apkg for an upload:

upload_apkg -d -p MyCloudEX2Ultra_myappname_0.3.bin\(01022021\)

The output of this command is as follows:

[upload_apkg.c:316] before_state=0,current_state=100
[upload_apkg.c:288] sed -i 's/<install_status>0/<install_status>100/g' /tmp/apkg_state.xml
[upload_apkg.c:1274] Install apkg end

After this the app also does not appear in the list of installed apps.

Are there further options to find out what is going wrong? Is there a log file that should contain an error message in this case?

The SDK with mksapkg I downloaded is for “My Cloud OS3 NAS Apps Package SDK v2.0”, so it is for the wrong version.

I downloaded it from here (login required):

However, there is no download for an SDK for “MyCloud OS5” on this page. Where can I download the SDK with mksapkg for “My Cloud OS5”?

I am one step further with using upload_apkg.

I tried the following command:

upload_apkg -d -t 2 -p boottimes_0.3.bin

Option -t 2 is for “application”, option -d is to turn on debug output.

When I call this command in the directory where the file boottimes_0.3.bin is located, then I get the following output:

[upload_apkg.c:316] before_state=0,current_state=100
[upload_apkg.c:1061] Install apps
[upload_apkg.c:525] [/mnt/HD/HD_a2/Nas_Prog][/mnt/HD/HD_a2/Nas_Prog/_install]
[upload_apkg.c:724] open file /usr/local/apps_upload/boottimes_0.3.bin fail
[upload_apkg.c:248] log : analyticlog -l INFO -s upload_apkg -m analytic_info string:appName:"NA" string:status:"instFail" string:error:"uploadAppFail"
[upload_apkg.c:316] before_state=100,current_state=101
[upload_apkg.c:1274] Install apkg end

The message in line 4 tells us that it is tried to open file file /usr/local/apps_upload/boottimes_0.3.bin. Therefore I copied boottimes_0.3.bin into folder /usr/local/apps_upload/. When I now call the same command again, then I get the following error message:

[upload_apkg.c:316] before_state=0,current_state=100
[upload_apkg.c:1061] Install apps
[upload_apkg.c:525] [/mnt/HD/HD_a2/Nas_Prog][/mnt/HD/HD_a2/Nas_Prog/_install]
[upload_apkg.c:429] open file /usr/local/apps_upload/boottimes_0.3.bin
[upload_apkg.c:559] #con_header->ah_length=559903
[upload_apkg.c:561] ah_app_id=1
[upload_apkg.c:746] ah_module_name=boottimes
[upload_apkg.c:749] show_name=NA
Segmentation fault

The “Segmentation fault” in the last lines tells us that upload_apkg has crashed; the cause for this might be that I use the wrong version of mksapkg as mentioned in my previous posting in this thread:

So can anyone please tell me where I can download the app SDK for “MyCloud OS 5”?

dswv42: Thanks a lot for your help. I downloaded file “My Cloud OS5 Third Party Apps GPL Codes” (about 1 GB), opened the file and got Apps/MyCloudOS5_mksapkg (ca. 30 KB). With this I was able to create an installable file for my app.

However, I had expected that the upload UI of the MyCloud device would show a useful error message when an app file in the wrong format was uploaded.

1 Like