Skip to content
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

App-service example not working (SDK version incorrect) #1427

Closed
carlosd-29 opened this issue Jun 13, 2023 · 3 comments · Fixed by #1428
Closed

App-service example not working (SDK version incorrect) #1427

carlosd-29 opened this issue Jun 13, 2023 · 3 comments · Fixed by #1428
Labels
1-low priority denoting isolated changes bug Something isn't working
Milestone

Comments

@carlosd-29
Copy link

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: App-service-template

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description and Minimal Reproduction [REQUIRED]

Following the steps in the readme to create new application service and when I run make build I get:

go mod tidy
CGO_ENABLED=0 go build -ldflags "-X github.com/edgexfoundry/app-functions-sdk-go/v3/internal.SDKVersion=v3.0.0-dev.9 -X github.com/edgexfoundry/app-functions-sdk-go/v3/internal.ApplicationVersion=0.0.0" -trimpath -mod=readonly -o app-example
# github.com/edgexfoundry/app-functions-sdk-go/v3/internal/common
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:234:16: cannot use c.Clients (variable of type map[string]"github.com/edgexfoundry/go-mod-bootstrap/v3/config".ClientInfo) as *"github.com/edgexfoundry/go-mod-bootstrap/v3/config".ClientsCollection value in struct literal
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:235:16: cannot use c.transformToBootstrapServiceInfo() (value of type "github.com/edgexfoundry/go-mod-bootstrap/v3/config".ServiceInfo) as *"github.com/edgexfoundry/go-mod-bootstrap/v3/config".ServiceInfo value in struct literal
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:236:16: cannot use c.Registry (variable of type "github.com/edgexfoundry/go-mod-bootstrap/v3/config".RegistryInfo) as *"github.com/edgexfoundry/go-mod-bootstrap/v3/config".RegistryInfo value in struct literal
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:237:3: unknown field SecretStore in struct literal of type "github.com/edgexfoundry/go-mod-bootstrap/v3/config".BootstrapConfiguration
# github.com/edgexfoundry/app-functions-sdk-go/v3/internal/appfunction
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/appfunction/context.go:225:42: not enough arguments in call to client.Add
        have (context.Context, requests.AddEventRequest)
        want (context.Context, string, requests.AddEventRequest)
make: *** [Makefile:42: build] Error 1

And when I run make test:

go test -race -coverprofile=coverage.out ./...
# github.com/edgexfoundry/app-functions-sdk-go/v3/internal/common
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:234:16: cannot use c.Clients (variable of type map[string]"github.com/edgexfoundry/go-mod-bootstrap/v3/config".ClientInfo) as *"github.com/edgexfoundry/go-mod-bootstrap/v3/config".ClientsCollection value in struct literal
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:235:16: cannot use c.transformToBootstrapServiceInfo() (value of type "github.com/edgexfoundry/go-mod-bootstrap/v3/config".ServiceInfo) as *"github.com/edgexfoundry/go-mod-bootstrap/v3/config".ServiceInfo value in struct literal
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:236:16: cannot use c.Registry (variable of type "github.com/edgexfoundry/go-mod-bootstrap/v3/config".RegistryInfo) as *"github.com/edgexfoundry/go-mod-bootstrap/v3/config".RegistryInfo value in struct literal
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/common/config.go:237:3: unknown field SecretStore in struct literal of type "github.com/edgexfoundry/go-mod-bootstrap/v3/config".BootstrapConfiguration
# github.com/edgexfoundry/app-functions-sdk-go/v3/internal/appfunction
../go/pkg/mod/github.com/edgexfoundry/app-functions-sdk-go/v3@v3.0.0-dev.9/internal/appfunction/context.go:225:42: not enough arguments in call to client.Add
        have (context.Context, requests.AddEventRequest)
        want (context.Context, string, requests.AddEventRequest)
FAIL    app-example [build failed]
?       app-example/config      [no test files]
FAIL    app-example/functions [build failed]
FAIL
make: *** [Makefile:64: test] Error 1

🔥 Exception or Error





🌍 Your Environment

Deployment Environment:
Ubuntu 20.04
EdgeX Version [REQUIRED]:
3.0

Anything else relevant?

@carlosd-29 carlosd-29 added the bug Something isn't working label Jun 13, 2023
@lenny-goodell
Copy link
Member

@carlosd-29 , this is because the SDK version in the template's go.mod was never changed to be the release version (v3.0.0)
https://github.com/edgexfoundry/app-functions-sdk-go/blob/v3.0/app-service-template/go.mod#L12

Please make that change in your new app service and verify that resolves you issue.

@lenny-goodell lenny-goodell changed the title App-service example not working App-service example not working (SDK version incorrect) Jun 13, 2023
@lenny-goodell lenny-goodell moved this to In Review in Application Services Jun 13, 2023
@lenny-goodell lenny-goodell added this to the Napa milestone Jun 13, 2023
lenny-goodell pushed a commit to lenny-goodell/app-functions-sdk-go that referenced this issue Jun 13, 2023
fixes edgexfoundry#1427

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
lenny-goodell pushed a commit to lenny-goodell/app-functions-sdk-go that referenced this issue Jun 13, 2023
fixes edgexfoundry#1427

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
lenny-goodell pushed a commit to lenny-goodell/app-functions-sdk-go that referenced this issue Jun 13, 2023
fixes edgexfoundry#1427

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
@carlosd-29
Copy link
Author

Have made that change and it does build now, thanks.

@github-project-automation github-project-automation bot moved this from In Review to Done in Application Services Jun 13, 2023
@lenny-goodell
Copy link
Member

lenny-goodell commented Jun 13, 2023

@carlosd-29 , I have a PR to fix this on the main branch and added this to the know bugs section for Minnesota here: https://wiki.edgexfoundry.org/display/FA/Minnesota#Minnesota-KnownBugs

@lenny-goodell lenny-goodell moved this from Done to In Review in Application Services Jun 13, 2023
@lenny-goodell lenny-goodell added the 1-low priority denoting isolated changes label Jun 13, 2023
@lenny-goodell lenny-goodell moved this from In Review to Done in Application Services Jun 20, 2023
@lenny-goodell lenny-goodell moved this from Done to In Review in Application Services Jun 20, 2023
@lenny-goodell lenny-goodell moved this from In Review to Done in Application Services Jun 20, 2023
@lenny-goodell lenny-goodell moved this from Done to Previously Done in Application Services Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-low priority denoting isolated changes bug Something isn't working
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants