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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when device is missing CardName or SerialNumber (Minnesota) #263

Closed
presatish opened this issue Jun 22, 2023 · 4 comments 路 Fixed by #261
Closed

Panic when device is missing CardName or SerialNumber (Minnesota) #263

presatish opened this issue Jun 22, 2023 · 4 comments 路 Fixed by #261
Labels
bug Something isn't working
Projects
Milestone

Comments

@presatish
Copy link
Contributor

presatish commented Jun 22, 2023

馃悶 Bug Report

Affected Services [REQUIRED]

device-usb-camera

Is this a regression?

No

Description and Minimal Reproduction [REQUIRED]

  • Run 3.0 version of Edgex core services along with device-usb-camera service (with discovery disabled)
  • Add usb camera manually using REST endpoint and omit CardName and/or SerialNumber info while adding. E.g.
curl -X POST -H 'Content-Type: application/json'  http://localhost:59881/api/v2/device -d '[
    {
    "apiVersion" : "v2",
    "device": {
        "name": "usb-camera",
        "serviceName": "device-usb-camera",
        "profileName": "USB-Camera-General",
        "description": "My test camera",
        "adminState": "UNLOCKED",
        "operatingState": "UP",
        "protocols": {
            "USB": {
                "CardName": "Webcam C270 HD",
                "Path": "/dev/video0",
                "AutoStreaming": "false"
            }
        }
    }
    }
]'
  • The device is successfully added into Edgex but when we execute some command on the device such as StartStreaming the device-usb-camera service panics with the error panic: interface conversion: interface {} is nil, not string and eventually exits.

馃敟 Exception or Error

panic: interface conversion: interface {} is nil, not string

馃實 Your Environment

Deployment Environment: Docker, Docker + Dev Hybrid

EdgeX Version [REQUIRED]: 3.0

Anything else relevant?
This issue will be fixed in main. CardName and SerialNumber are optional parameters but the service does not have proper checks and when the device is added manually without one or both of these parameters the issue is seen. With the fixed service, based on their respective needs users can manually add a camera with or without these parameters.

@presatish presatish added the bug Something isn't working label Jun 22, 2023
@presatish presatish changed the title Panic when device is missing CardName or SerialNumber Panic when device is missing CardName or SerialNumber (Minnesota) Jun 22, 2023
@lenny-goodell lenny-goodell added this to New Issues in Device WG via automation Jun 22, 2023
@lenny-goodell lenny-goodell added this to the Napa milestone Jun 22, 2023
@lenny-goodell
Copy link
Member

@presatish , the work around for this is to add blank CardName and SerialNumber correct?

@lenny-goodell lenny-goodell linked a pull request Jun 22, 2023 that will close this issue
4 tasks
@lenny-goodell lenny-goodell moved this from New Issues to QA/Code Review in Device WG Jun 22, 2023
@presatish
Copy link
Contributor Author

@presatish , the work around for this is to add blank CardName and SerialNumber correct?

There is no need for blank ones, the blank ones will lead to errors. Either the user can add these fields with their respective values or can completely omit them as we have in the examples now.

@lenny-goodell
Copy link
Member

@presatish , I am talking about work around for Minnesota, since this is only being fix in Napa.

Device WG automation moved this from QA/Code Review to Done Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Device WG
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants