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

Clearing metadata cache and redis database while running EdgeX with security #4360

Closed
neerajasjawali opened this issue Feb 15, 2023 · 19 comments
Labels
question Further information is requested

Comments

@neerajasjawali
Copy link

Hi all,
I am testing USB image capturing using EdgeX (jakarta) with security.
In devices and profiles files I have just added the USB sourceName and resourceName. While running the device-virtual-go for USB, getting the below error

level=ERROR ts=2023-02-13T06:18:55.089793534Z app=device-virtual source=transform.go:58 msg="failed to find DeviceResource in Device Edgex-stress-test for CommandValue (DeviceResource: , : <nil>)" level=ERROR ts=2023-02-13T06:18:55.090504567Z app=device-virtual source=executor.go:55 msg="AutoEvent - error occurs when reading resource LIGHT_2: failed to convert CommandValue to Event -> failed to find DeviceResource in Device Edgex-stress-test for CommandValue (DeviceResource: , : <nil>)"

I have added the error screenshot below.

Screenshot from 2023-02-13 11-01-03

Any suggestion on how to flush the Redis database and metadata cache while running EdgeX with security.

Thanks in advance

@neerajasjawali neerajasjawali added the question Further information is requested label Feb 15, 2023
@cloudxxx8
Copy link
Member

could you upload your profile and describe the steps to reproduce this issue?

@neerajasjawali
Copy link
Author

neerajasjawali commented Feb 20, 2023

Hi @cloudxxx8
Attached the screenshot of device.virtual.int.yaml for usb IP
Screenshot from 2023-02-20 14-26-11
I had first run the device-virtual for i2c-uart-gpio-usb ips and below is screenshot of device.virtual.int.yaml for the four ips.
Screenshot from 2023-02-20 14-29-10

When I switch from testing the device-virtual for i2c-uart-gpio-usb ips to usb ip, I get the error.

@cloudxxx8
Copy link
Member

What do you actually do when you mention to switch from testing the device-virtual for i2c-uart-gpio-usb ips to usb ip

@neerajasjawali
Copy link
Author

I have written seperate device-virtual-go for usb and other ips. So, while testing I run the respective device-virtual-go file. All the services would be running, which is same for usb and other ips.

@cloudxxx8
Copy link
Member

Did you create different devices and device profiles for the two device services, or did you just update the original devices?
I still don't understand how do you switch. Or, did you just shutdown one device service and start another one?

@neerajasjawali
Copy link
Author

Yes. I created different devices and profiles for the two device services.
Yeah, shutdown one service and run the another device service

@cloudxxx8
Copy link
Member

According to your original error error occurs when reading resource LIGHT_2, I can't find LIGHT_2 in your profile.

@neerajasjawali
Copy link
Author

As you can see in the first screenshot which i shared, for USB IP, I have not mentioned LIGHT_1 in devices and profiles file.

@cloudxxx8
Copy link
Member

What is the source name you defined in the AutoEvent in the Device?

@neerajasjawali
Copy link
Author

neerajasjawali commented Feb 21, 2023

For USB device-service the source name is CAMERA_1,CAMERA_2,PEN_DRIVE

Screenshot from 2023-02-21 14-21-22

@cloudxxx8
Copy link
Member

Those AutoEven sources are not defined in your usb device profile, only in the virtual device profile.

@neerajasjawali
Copy link
Author

Could you please elaborate?

@cloudxxx8
Copy link
Member

they are defined in device.virtual.int.yaml for usb IP (your first profile), but not in device.virtual.int.yaml for the four ips (your second profile).

Hi @cloudxxx8 Attached the screenshot of device.virtual.int.yaml for usb IP Screenshot from 2023-02-20 14-26-11 I had first run the device-virtual for i2c-uart-gpio-usb ips and below is screenshot of device.virtual.int.yaml for the four ips. Screenshot from 2023-02-20 14-29-10

When I switch from testing the device-virtual for i2c-uart-gpio-usb ips to usb ip, I get the error.

@neerajasjawali
Copy link
Author

There is separate device.virtual.int.yaml file, devices.toml file and device-virtual-go file for USB Ip and for four Ips.
For USB:
devices.toml file:
Screenshot from 2023-02-21 14-21-22

device.virtual.int.yaml:
Screenshot from 2023-02-21 14-41-03

@cloudxxx8
Copy link
Member

Please upload all the device, profile, and error log in text files, or we are not able to see all the information.

@cloudxxx8
Copy link
Member

The error happens in this line
https://github.com/edgexfoundry/device-sdk-go/blob/64ca9b081847739b4160c0dc87966f6c81a47c16/internal/transformer/transform.go#L58

It means the device resource AutoEvent is reading not defined in the Device Profile

@neerajasjawali
Copy link
Author

Yes. It's because I am running the device-virtual-go file for just USB ip. AutoEvent is reading the source name which I have not defined in the Device Profile. AutoEvent should just read for CAMERA_1,CAMERA_2 and PEN_DRIVE. Yet I do not know why it is reading the LIGHT_1 source name.

@cloudxxx8
Copy link
Member

it requires the checking of your devices and device profiles

@cloudxxx8
Copy link
Member

close due to no activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants