edgexfoundry / edgex-examples

Apache License 2.0
51 stars 52 forks source link

The example: 'camera management' got errors with pipeline status #180

Closed jiekechoo closed 1 year ago

jiekechoo commented 1 year ago

clone from main branch or v2.3.0, here is the error message in EVAM service:

_/pipelines/object_detection/person_vehicle_bike/9/pipelines/object_detection/person_vehiclebike/9 the url from 'camera management' app service, it's duplicate. how to fix it ?

WARNING:tornado.access:404 GET /pipelines/object_detection/person_vehicle_bike/9/pipelines/object_detection/person_vehicle_bike/9/status (172.20.0.1) 0.70ms
WARNING:tornado.access:404 GET /pipelines/object_detection/person_vehicle_bike/7/pipelines/object_detection/person_vehicle_bike/7/status (172.20.0.1) 0.74ms
WARNING:tornado.access:404 GET /pipelines/object_detection/person_vehicle_bike/8/pipelines/object_detection/person_vehicle_bike/8/status (172.20.0.1) 0.73ms
lenny-goodell commented 1 year ago

@ajcasagrande , @presatish, FYI

jiekechoo commented 1 year ago

in file: util.go, comment these code, it works.

func issueGetRequest(ctx context.Context, res interface{}, baseUrl string, requestPath string) (err error) {
    // u, err := url.Parse(baseUrl)
    // if err != nil {
    //  return err
    // }
    // requestPath = path.Join(u.Path, requestPath)
    return utils.GetRequest(ctx, &res, baseUrl, requestPath, nil)
}

func issueDeleteRequest(ctx context.Context, res interface{}, baseUrl string, requestPath string) (err error) {
    // u, err := url.Parse(baseUrl)
    // if err != nil {
    //  return err
    // }
    // requestPath = path.Join(u.Path, requestPath)
    return utils.DeleteRequest(ctx, &res, baseUrl, requestPath)
}

because the file: evam.go has combined the URL

func (info PipelineInfo) getPipelineUrl(evamBaseUrl string) (string, error) {
    uri, err := url.Parse(evamBaseUrl)
    if err != nil {
        return "", err
    }
    uri.Path = path.Join(uri.Path, "pipelines", info.Name, info.Version, info.Id)
    return uri.String(), nil
}
ajcasagrande commented 1 year ago

This is due to the following issue having been fixed, and the workaround code not being removed: https://github.com/edgexfoundry/go-mod-core-contracts/issues/719