I posted a script here that confirms the issue on our system:
get-volumeinformation.ps1
$pinvokes = @'
[DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public extern static bool GetVolumeInformationW(
string rootPathName,
System.Text.StringBuilder volumeNameBuffer,
int volumeNameSize,
out uint volumeSerialNumber,
out uint maximumComponentLength,
out uint fileSystemFlags,
This file has been truncated. show original
readme.md
Metricbeat fails using version 7.11 when GetVolumeInformationW returns false, which it does for floppy and cd-rom volumes.
Example output from this script:
```
PS> get-volumeinformation.ps1
Drives found by GetLogicalDriveStringsW: A:\ C:\ D:\ L:\
GetVolumeInformationW for A:\ returned False
A:\ volume name:
A:\ filesystem name:
This file has been truncated. show original
When the GetVolumeInformationW returns false/error it will get to this line:
return errors.Wrap(err, "GetAccessPaths failed") } for _, drive := range drives { dt, err := windows.GetDriveType(drive) if err != nil { return errors.Wrapf(err, "GetDriveType failed") } fsType, err := windows.GetFilesystemType(drive) if err != nil { return errors.Wrapf(err, "GetFilesystemType failed") } self.List = append(self.List, FileSystem{ DirName: drive, DevName: drive, TypeName: dt.String(), SysTypeName: fsType, }) } return nil