You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NoMethodError: undefined method `[]' for nil:NilClass
/src/vagrant-vmware-desktop/lib/vagrant-vmware-desktop/cap/disk.rb:118:in `block in get_disk'
Expected outcome:
Resize the primary NVMe disk according to the Vagrantfile
Cause of error
This is caused by several bugs:
1. get_disk() looks up the disk_info hash table for the keys defined in PRIMARY_DISK_SLOTS but did not correctly handle cases where the entry itself is absent (when there is no line matching "scsi0:0.present = *" in the vmx)
2. get_disk() does not return the expected nil value when a primary disk is not found
Fixing Item 1 and re-run will expose another bug with the following error due to get_disk() missing a nil return.
TypeError: no implicit conversion of String into Integer
/src/vagrant-vmware-desktop/lib/vagrant-vmware-desktop/cap/disk.rb:151:in `[]'
Expected: get_disk() returns nil when the queried disk is not found
Current: get_disk() returns an irrelevant value ["scsi0:0", "sata0:0", "ide0:0"] (the last evaluated statement)
This leads to the plugin failing with error instead of creating a new disk in cases where the primary disk defined in config is not present in the vmx file
Reproducing the error
(Without any of these lines:
scsi0.present = "FALSE"
orscsi0:0.present = "FALSE"
)config.vm.disk
withprimary: true
vagrant up
Error as follows
Expected outcome:
Resize the primary NVMe disk according to the Vagrantfile
Cause of error
This is caused by several bugs:
1.
get_disk()
looks up the disk_info hash table for the keys defined inPRIMARY_DISK_SLOTS
but did not correctly handle cases where the entry itself is absent (when there is no line matching "scsi0:0.present = *" in the vmx)vagrant-vmware-desktop/lib/vagrant-vmware-desktop/cap/disk.rb
Lines 115 to 119 in 66aed2d
2.
get_disk()
does not return the expected nil value when a primary disk is not foundFixing Item 1 and re-run will expose another bug with the following error due to get_disk() missing a nil return.
Expected: get_disk() returns nil when the queried disk is not found
Current: get_disk() returns an irrelevant value
["scsi0:0", "sata0:0", "ide0:0"]
(the last evaluated statement)This leads to the plugin failing with error instead of creating a new disk in cases where the primary disk defined in config is not present in the vmx file
vagrant-vmware-desktop/lib/vagrant-vmware-desktop/cap/disk.rb
Lines 113 to 133 in 66aed2d
3. nvme0:0 is not in the search list of primary disk
vagrant-vmware-desktop/lib/vagrant-vmware-desktop/cap/disk.rb
Line 31 in 66aed2d
Environment:
Vagrant 2.2.11.dev
VMWare Fusion 13.6.2 (MacOS)
VAGRANT_EXPERIMENTAL=disks
The text was updated successfully, but these errors were encountered: