Is this log from PlatformIO or from Arduino IDE?
I never saw a WriteFile failed error when uploading. It is strange.