ubuntu / ubuntu-report

Report hardware and other collected metrics like installer or upgrade information
GNU General Public License v3.0
68 stars 29 forks source link

Snap: cannot access /var/lib/ubuntu_dist_channel (used for OEM information) #28

Open pieqq opened 5 years ago

pieqq commented 5 years ago

Hello! I was trying to package ubuntu-report in one of my snaps, and found an issue that happens with the snapcraft.yaml file from this repository as well.

On a device with an OEM image, if I run the debian package:

$ ubuntu-report show | grep DCD
    "DCD": "canonical-oem-somerville-bionic-amd64-xxx"

However, if I run the snap version, nothing comes out. I added debug info, and...

$ mysnap.ubuntu-report show -vv                                                                                                            
(...)                                                                                                                
INFO[0000] no DCD information: open /var/lib/ubuntu_dist_channel: no such file or directory                                                                                  
couldn't open /var/lib/ubuntu_dist_channel
(...)

It seems to be an issue with the files available by default in a snap runtime environment. I've asked a question on the snapcraft forum.

In the meantime I just wanted to open an issue here so you are aware about this.

Cheers!