jcnelson / vdev

A device-file manager for *nix
GNU General Public License v3.0
101 stars 13 forks source link

Vbox errors #95

Closed suedi closed 8 years ago

suedi commented 8 years ago

The same user as in #94 now has this left in vdevd.log when grep'ed for ERROR

All ERROR's left!

11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: [helpers] [WARN]: Could not find pvs in /sbin/pvs.  LVM physical volume symlinks in /mnt/live/tmp/dev/disk/by-id will not be created.

11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 11680 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 19868 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 17146 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 17150 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 11686 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 16084 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 16828 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 16135 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 19565 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 17007 to die
11527:00007F6BB5A76700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 11955 to die

28968:00007FF3AE281700: [../libvdev/util.c:0645] vdev_read_file: ERROR: open('/mnt/live/tmp/dev/metadata//dev/vboxusb/001/002/vdev_instance') rc = -2
28968:00007FF3AE281700: [          vdev.c:0075] vdev_device_read_vdevd_instance: ERROR: vdev_read_file('/mnt/live/tmp/dev/metadata//dev/vboxusb/001/002/vdev_instance') rc = -2
28968:00007FF3AE281700: [          vdev.c:0156] vdev_remove_unplugged_device: ERROR: vdev_device_read_vdevd_instance('/mnt/live/tmp/dev/vboxusb/001/002') rc = -2

28968:00007FF3AE281700: [../libvdev/util.c:0645] vdev_read_file: ERROR: open('/mnt/live/tmp/dev/metadata//dev/vboxusb/001/004/vdev_instance') rc = -2
28968:00007FF3AE281700: [          vdev.c:0075] vdev_device_read_vdevd_instance: ERROR: vdev_read_file('/mnt/live/tmp/dev/metadata//dev/vboxusb/001/004/vdev_instance') rc = -2
28968:00007FF3AE281700: [          vdev.c:0156] vdev_remove_unplugged_device: ERROR: vdev_device_read_vdevd_instance('/mnt/live/tmp/dev/vboxusb/001/004') rc = -2

28968:00007FF3AE281700: [../libvdev/util.c:0645] vdev_read_file: ERROR: open('/mnt/live/tmp/dev/metadata//dev/vboxusb/004/002/vdev_instance') rc = -2
28968:00007FF3AE281700: [          vdev.c:0075] vdev_device_read_vdevd_instance: ERROR: vdev_read_file('/mnt/live/tmp/dev/metadata//dev/vboxusb/004/002/vdev_instance') rc = -2
28968:00007FF3AE281700: [          vdev.c:0156] vdev_remove_unplugged_device: ERROR: vdev_device_read_vdevd_instance('/mnt/live/tmp/dev/vboxusb/004/002') rc = -2

28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 29188 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 28987 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 6767 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 4051 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 4055 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 32407 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 2873 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 3735 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 2924 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 6464 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 3914 to die
28968:00007FF3AD8AB700: [          vdev.c:0395] vdev_error_thread_main: ERROR: ENVIRON tells 2825 to die

There seems to be some chink regarding virtualbox and USB sticks. Something happens when USB drive is removed under virtualbox? I asked the user for more info and will post then

full log https://www.dropbox.com/s/k7x37kmy2o9ejia/vdevd_aou1_vbox.log?dl=1

Also is the ERROR: ENVIRON tells XXXXX to die happening when user kills them manually?

jcnelson commented 8 years ago

Hi @suedi,

Thank you for forwarding the errors to me.

The ERROR: ENVIRON tells XXXXX to die errors seem to originate from a shutdown request. In both cases where they occur in the log file, vdevd is in the process of shutting down its daemonlets and logging benchmark information (it records immediately afterwards that it is exiting).

It also seems that the user was running vdevd with the --once flag set, since the VirtualBox USB errors you're seeing come from the code that makes vdevd look for and remove devices that have been unplugged since the last time it was run with --once. Specifically, the error means that vdevd was unable to tell whether or not the device was processed by this particular invocation, or a previous invocation (if the latter is true, then the device was unplugged and can be removed).

The Virtualbox USB error the user is seeing comes from the fact that the helper (VBoxCreateUSBNode.sh) creates extra USB device nodes under /dev/vboxusb, but the unplugged-device-cleanup code assumes that for every $DEVICE_PATH there is also a /dev/metadata/$DEVICE_PATH directory. This was not the case here, because the VirtualBox USB helper creates extra device nodes that vdevd does not know about (meaning vdevd doesn't know how to clean them up when they disappear).

I've pushed a possible fix. Please let me know if you get a chance to try it?

Thanks!

suedi commented 8 years ago

I was still working with the user on #94 I think your fix is still good for that but there is a collateral issue with alphaOS

However the ERROR's about vboxusb has now disappeared. The user claims never to have used virtualbox. So cannot test issue #95 on the user.

It might mean that #95 was dependant on #94 ???

How to re-create that situation to verify your fix?

EDIT

found away to create that situation here.

just did

mkdir -p /tmp/dev//metadata/dev/vboxusb/001/002/
touch /tmp/dev//metadata/dev/vboxusb/001/002/links

and then run vdevd -1 again

will test your fix...

suedi commented 8 years ago

Hmmm...

I am not sure this was the right way of testing it?

I did as I sketched above and got ERROR's in log

07055:00007FDF9F133700: [          vdev.c:0395] vdev_error_thread_main: ERROR: /usr/lib/vdev/subr.sh: line 46: /mnt/live/tmp/dev/metadata//dev//vboxusb/001/004/links: No such file or directory
07055:00007FDF9F133700: [          vdev.c:0395] vdev_error_thread_main: ERROR: /usr/lib/vdev/subr.sh: line 46: /mnt/live/tmp/dev/metadata//dev//vboxusb/002/003/links: No such file or directory

and in /tmp/dev/metadata/dev/vboxusb

tree /tmp/dev/metadata/dev/vboxusb/ 
/tmp/dev/metadata/dev/vboxusb/
|-- 001
|   |-- 002
|   |   `-- links
|   `-- 004
|       `-- vdev_instance
`-- 002
    `-- 003
        `-- vdev_instance

I am groping in the dark here cause I don't know how it should work. Can you shed some light on this?

I don't get any vboxusb devices at all on my comp?

jcnelson commented 8 years ago

Hi @suedi,

The device nodes under /dev/vboxusb are a special case. They're not created by vdevd directly (i.e. there's no corresponding /sys/devices/... directory for them), but by the VBoxCreateUSBNode.sh helper. This means that vdevd doesn't ever get a chance to set up /dev/metadata/dev/vboxusb/...; the helper must do so manually. The fact that you're seeing these errors regarding the links file is an oversight on my part--the helper should have also created the contents /dev/metadata/dev/vboxusb/....

The user does not need to run inside Virtualbox for /dev/vboxusb to be created. They should get created for each non-hub USB device. I just pushed a possible fix.

suedi commented 8 years ago

I tried latest fix.

It looks OK in /dev/vboxusb and /dev/metadata/dev/vboxusb

The error's my user got was not reproducable so cannot test on that.

closing...