Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Segmentation violation when running EdgeX sample Device Service #1468

Closed
carlosd-29 opened this issue Jun 12, 2023 · 3 comments
Closed

Segmentation violation when running EdgeX sample Device Service #1468

carlosd-29 opened this issue Jun 12, 2023 · 3 comments
Labels
question Further information is requested

Comments

@carlosd-29
Copy link

carlosd-29 commented Jun 12, 2023

Question

Affected Services [REQUIRED]

The issue is located in: Device Service

Is this a regression?

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

Description and Minimal Reproduction [REQUIRED]

I am trying to build a custom device service and I've noticed a couple of issues. One is that both device and profile configurations are using the same file (random-generator-device.yaml). Another is that the configuration.yaml is missing some components. For example RequestTimeout was missing and producing:

level=INFO ts=2023-06-12T19:55:18.442002546Z app=device-simple source=config.go:640 msg="Loading configuration file from res/configuration.yaml"
level=INFO ts=2023-06-12T19:55:18.442294135Z app=device-simple source=config.go:226 msg="Private configuration loaded from file with 0 overrides applied"
level=ERROR ts=2023-06-12T19:55:18.444259518Z app=device-simple source=httpserver.go:101 msg="unable to parse RequestTimeout value of  to a duration: time: invalid duration \"\""
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xbfdb86]

goroutine 1 [running]:
github.com/edgexfoundry/device-sdk-go/v3/pkg/startup.Bootstrap({0xde1162, 0xd}, {0xefef78, 0x5}, {0xf0f930?, 0xc0003f1f80})
        github.com/edgexfoundry/device-sdk-go/v3@v3.0.0/pkg/startup/bootstrap.go:27 +0x2e6
main.main()
        github.com/edgexfoundry/device-simple/cmd/device-simple/main.go:23 +0x4e

I added that parameter and now I'm getting:

level=INFO ts=2023-06-12T20:04:03.456084501Z app=device-simple source=config.go:640 msg="Loading configuration file from res/configuration.yaml"
level=INFO ts=2023-06-12T20:04:03.456219897Z app=device-simple source=config.go:226 msg="Private configuration loaded from file with 0 overrides applied"
level=INFO ts=2023-06-12T20:04:03.457639516Z app=device-simple source=httpserver.go:133 msg="Web server starting (10.34.125.34:59999)"
level=ERROR ts=2023-06-12T20:04:03.457679445Z app=device-simple source=messaging.go:45 msg="MessageBus configuration not set or missing from service's GetBootstrap() implementation"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xbfdb86]

goroutine 1 [running]:
github.com/edgexfoundry/device-sdk-go/v3/pkg/startup.Bootstrap({0xde1162, 0xd}, {0xefef78, 0x5}, {0xf0f930?, 0xc0003f1f80})
        github.com/edgexfoundry/device-sdk-go/v3@v3.0.0/pkg/startup/bootstrap.go:27 +0x2e6
main.main()
        github.com/edgexfoundry/device-simple/cmd/device-simple/main.go:23 +0x4e

🔥 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 12, 2023
@lenny-goodell
Copy link
Member

@lenny-goodell lenny-goodell added question Further information is requested and removed bug Something isn't working labels Jun 12, 2023
@lenny-goodell
Copy link
Member

lenny-goodell commented Jun 12, 2023

One is that both device and profile configurations are using the same file (random-generator-device.yaml)

@carlosd-29 , yes, the edgexfoundry/edgex-docs#1131 issue has already been submitted for that . See my comments in the issue to where the device file should be linked.

@lenny-goodell
Copy link
Member

@carlosd-29 , I have also created a docs issue for the section you are using to add the required flags
edgexfoundry/edgex-docs#1132

@edgexfoundry edgexfoundry locked and limited conversation to collaborators Jun 13, 2023
@lenny-goodell lenny-goodell converted this issue into discussion #1469 Jun 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants