afm-util fails to install HTML app

Description

afm-util install  low-can-demo.wgt

fails with following journal entries

Jul 24 19:51:56 m3ulcb afm-system-daemon[3465]:  ERROR: can't get info on content index.html: No such file or directory [/usr/src/debug/af-main/dab+gitAUTOINC+d06b
Jul 24 19:51:55 m3ulcb afm-system-daemon[3465]:  NOTICE: – INSTALLING widget /home/root/low-can-demo.wgt to /var/local/lib/afm/applications – [/usr/src/debug/af-

root@m3ulcb:~# cat /var/local/lib/afm/applications/low-can-demo/0.9/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" id="low-can-demo" version="0.9">
    <name>low-can-demo</name>
    <icon src="icon.png"/>
    <content src="htdocs/index.html" type="text/html"/>
    <description>HTML5 Low level CAN service UI for demo</description>
    <author>Forlot Romain &lt;romain.forlot@iot.bzh&gt;</author>
    <license>APL2.0</license>
    <feature name="urn:AGL:widget:required-api">
        <param name="#target" value="main" />
        <param name="low-can" value="auto" />
    </feature>
    <feature name="urn:AGL:widget:provided-unit">
        <param name="#target" value="stat" />
        <param name="description" value="CPU stat binding used in HTML5 UI" />
        <param name="content.src" value="lib/afb-stat.so" />
        <param name="content.type" value="application/vnd.agl.service" />
    </feature>
    <feature name="urn:AGL:widget:provided-api">
        <param name="#target" value="main" />
        <param name="stat" value="ws" />
    </feature>
</widget>

Environment

AGL 4.0  

Activity

Show:

Jose Bollo 
August 10, 2017 at 8:16 AM
(edited)

in wait of 10545 that waits for 10537

Integrated in DAB but in wait for master of the review 10603

Jose Bollo 
August 7, 2017 at 4:15 PM

The issue is real and the solution might be not obvious. At the moment, I'll provide a short patch that will solve the problem by trying to look in the subdirectory htdocs whether the file exist or not.

For the long term solution, I must write a more stronger algorithm that will include language aware path search as specified in widget specifications and that also know whther the permission -no-htdocs is set or not.

Fixed

Details

Assignee

Reporter

Fix versions

Labels

Contract ID

Components

Affects versions

Priority

Created August 7, 2017 at 4:01 PM
Updated September 18, 2017 at 3:18 PM
Resolved September 6, 2017 at 8:22 AM