[Google Pixel 2 Questions & Answers] depii:
I received my Pixel2 (not XL! Europe free version) today. It came with Android 8.0 (November). I tried to flash 8.1 factory image (walleye-opm1.171019.011-factory-f74dd4fd.zip) via fastboot. But same "Command Flash Error" here while update bootloader. My bootloader version was 0059. The update requires 0066. (See Code 1).

The "Deuces v4 script" DIDN'T help me. It installed 8.1 on system-partition without update bootloader and some other partitions. uuh. I was scared of it for a moment, but the device starts Android 8.1 but bootloader stay at 0059.

My solution

- i added my google account to the phone

- i registered my pixel 2 for beta program via android.com/beta (with computer)

- i checked systemupdates, downloaded & installed 8.1 beta (round about 1.1GB)

- phone reboots and stucked 30 minutes at the G-logo

- i pressed power and volume-down till it reboots into bootloader

- i saw, that now the bootloader is version 0066!

- now i could run flash-all.sh without problems (i started the flash-all.sh commands manually, see Code 2)

- i was in Slot B, i switched to Slot A with: fastboot --set-active=_a; adb reboot-bootloader

- i saw, the Slot A bootloader was the old version 0059, i tried to flash it, without success, same error

- i switched to Slot B again and flashed the A bootloader: fastboot flash bootloader_a bootloader-walleye-mw8998-002.0066.00.img (see Code 3).

- now both bootloader are version 0066

I hope it will help you.

Code 1:

# fastboot flash bootloader bootloader-walleye-mw8998-002.0066.00.img
target reported max download size of 536870912 bytes
sending 'bootloader' (38644 KB)...
OKAY [ 1.594s]
writing 'bootloader'...
(bootloader) Updating: partition:0 @00002000 sz=0000B000
FAILED (remote: Command Flash Error)
finished. total time: 1.598s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.151s
# fastboot flash radio radio-walleye-g8998-00164-1710262031.img
target reported max download size of 536870912 bytes
sending 'radio' (60428 KB)...
OKAY [ 2.420s]
writing 'radio'...
(bootloader) Updating: modem @00001000 sz=03B01000
OKAY [ 0.544s]
finished. total time: 2.964s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.151s
# fastboot -w update image-walleye-opm1.171019.011.zip
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.img'
archive does not contain 'system.sig'
archive does not contain 'vendor.sig'
Creating filesystem with parameters:
Size: 57071874048
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 13933563
Block groups: 426
Reserved block group size: 1024
Created filesystem with 11/3489792 inodes and 265112/13933563 blocks
Erase successful, but not automatically formatting.
Can't determine partition type.
FAILED (remote: GetVar Variable Not found)
--------------------------------------------
Bootloader Version...: mw8998-002.0059.00
Baseband Version.....: g8998-00164-1710262031
Serial Number........: xxxxxxxxx
--------------------------------------------
checking product...
OKAY [ 0.001s]
checking version-bootloader...
FAILED

Device version-bootloader is 'mw8998-002.0059.00'.
Update requires 'mw8998-002.0066.00'.

finished. total time: 0.004s

Code 2:

# fastboot flash bootloader bootloader-walleye-mw8998-002.0066.00.img
target reported max download size of 536870912 bytes
sending 'bootloader_b' (38644 KB)...
OKAY [ 1.768s]
writing 'bootloader_b'...
(bootloader) Updating: partition:0 @00002000 sz=0000B000
(bootloader) Updating: partition:1 @0000D000 sz=0000B000
(bootloader) Updating: partition:2 @00018000 sz=0000B000
(bootloader) Updating: partition:3 @00023000 sz=0000B000
(bootloader) Updating: partition:4 @0002E000 sz=0000B000
(bootloader) Updating: partition:5 @00039000 sz=0000B000
(bootloader) Updating: cmnlib64 @00044000 sz=00048000
(bootloader) Updating: cmnlib @0008C000 sz=00037000
(bootloader) Updating: devcfg @000C3000 sz=0000F000
(bootloader) Updating: hyp @000D2000 sz=00040000
(bootloader) Updating: keymaster @00112000 sz=00046000
(bootloader) Updating: lockbooter @00158000 sz=00016000
(bootloader) Updating: pmic @0016E000 sz=0000D000
(bootloader) Updating: rpm @0017B000 sz=0003A000
(bootloader) Updating: tz @001B5000 sz=001DB000
(bootloader) Updating: xbl @00390000 sz=003A2000
(bootloader) Updating: apdp @00732000 sz=00004000
(bootloader) Updating: msadp @00736000 sz=00004000
(bootloader) Updating: hosd @0073A000 sz=01E1E000
(bootloader) Updating: abl @02558000 sz=00065000
OKAY [ 0.889s]
finished. total time: 2.658s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.201s
# fastboot flash radio radio-walleye-g8998-00164-1710262031.img
target reported max download size of 536870912 bytes
sending 'radio_b' (60428 KB)...
OKAY [ 2.727s]
writing 'radio_b'...
(bootloader) Updating: modem @00001000 sz=03B01000
OKAY [ 0.545s]
finished. total time: 3.272s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.001s]
finished. total time: 0.101s
# fastboot -w update image-walleye-opm1.171019.011.zip
extracting android-info.txt (0 MB) to RAM...
extracting boot.img (32 MB) to disk... took 0.202s
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'boot_other.img'
extracting dtbo.img (8 MB) to disk... took 0.033s
archive does not contain 'dtbo.sig'
archive does not contain 'dt.img'
archive does not contain 'recovery.img'
extracting system.img (1920 MB) to disk... took 11.869s
archive does not contain 'system.sig'
extracting system_other.img (568 MB) to disk... took 4.173s
archive does not contain 'system.sig'
extracting vbmeta.img (0 MB) to disk... took 0.000s
archive does not contain 'vbmeta.sig'
extracting vendor.img (347 MB) to disk... took 2.423s
archive does not contain 'vendor.sig'
archive does not contain 'vendor_other.img'
wiping userdata...
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 13933563 4k blocks and 3489792 inodes
Filesystem UUID: 9c0d344d-4d88-428e-99a4-ccef9c9cf298
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

--------------------------------------------
Bootloader Version...: mw8998-002.0066.00
Baseband Version.....: g8998-00164-1710262031
Serial Number........: xxxxxxxxx
--------------------------------------------
checking product...
OKAY [ 0.001s]
checking version-bootloader...
OKAY [ 0.001s]
checking version-baseband...
OKAY [ 0.001s]
sending 'boot_b' (32768 KB)...
OKAY [ 1.495s]
writing 'boot_b'...
OKAY [ 0.001s]
sending 'dtbo_b' (8192 KB)...
OKAY [ 0.679s]
writing 'dtbo_b'...
OKAY [ 0.000s]
erasing 'system_b'...
OKAY [ 0.396s]
sending sparse 'system_b' 1/4 (524284 KB)...
OKAY [ 22.653s]
writing 'system_b' 1/4...
OKAY [ 0.001s]
sending sparse 'system_b' 2/4 (524284 KB)...
OKAY [ 26.109s]
writing 'system_b' 2/4...
OKAY [ 0.000s]
sending sparse 'system_b' 3/4 (524284 KB)...
OKAY [ 25.569s]
writing 'system_b' 3/4...
OKAY [ 0.000s]
sending sparse 'system_b' 4/4 (393508 KB)...
OKAY [ 20.279s]
writing 'system_b' 4/4...
OKAY [ 0.000s]
erasing 'system_a'...
OKAY [ 1.999s]
sending sparse 'system_a' 1/2 (524284 KB)...
OKAY [ 23.680s]
writing 'system_a' 1/2...
OKAY [ 0.000s]
sending sparse 'system_a' 2/2 (57592 KB)...
OKAY [ 5.069s]
writing 'system_a' 2/2...
OKAY [ 0.000s]
sending 'vbmeta_b' (4 KB)...
OKAY [ 0.269s]
writing 'vbmeta_b'...
OKAY [ 0.000s]
erasing 'vendor_b'...
OKAY [ 0.141s]
sending 'vendor_b' (355428 KB)...
OKAY [ 16.130s]
writing 'vendor_b'...
OKAY [ 0.000s]
Setting current slot to 'b'...
OKAY [ 1.682s]
erasing 'userdata'...
OKAY [ 0.942s]
sending 'userdata' (4669 KB)...
OKAY [ 0.224s]
writing 'userdata'...
OKAY [ 0.000s]
rebooting...

finished. total time: 147.489s

Code 3:

# fastboot --set-active=_a
Setting current slot to 'a'...
OKAY [ 0.016s]
finished. total time: 0.016s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.251s
# fastboot flash bootloader bootloader-walleye-mw8998-002.0066.00.img
target reported max download size of 536870912 bytes
sending 'bootloader' (38644 KB)...
OKAY [ 1.812s]
writing 'bootloader'...
(bootloader) Updating: partition:0 @00002000 sz=0000B000
FAILED (remote: Command Flash Error)
finished. total time: 1.724s
# fastboot flash bootloader_a bootloader-walleye-mw8998-002.0066.00.img
target reported max download size of 536870912 bytes
sending 'bootloader_a' (38644 KB)...
OKAY [ 1.733s]
writing 'bootloader_a'...
(bootloader) Updating: partition:0 @00002000 sz=0000B000
FAILED (remote: Command Flash Error)
finished. total time: 1.737s
# fastboot --set-active=_b
Setting current slot to 'b'...
OKAY [ 0.015s]
finished. total time: 0.015s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.051s
# fastboot flash bootloader_a bootloader-walleye-mw8998-002.0066.00.img
target reported max download size of 536870912 bytes
sending 'bootloader_a' (38644 KB)...
OKAY [ 1.735s]
writing 'bootloader_a'...
(bootloader) Updating: partition:0 @00002000 sz=0000B000
(bootloader) Updating: partition:1 @0000D000 sz=0000B000
(bootloader) Updating: partition:2 @00018000 sz=0000B000
(bootloader) Updating: partition:3 @00023000 sz=0000B000
(bootloader) Updating: partition:4 @0002E000 sz=0000B000
(bootloader) Updating: partition:5 @00039000 sz=0000B000
(bootloader) Updating: cmnlib64 @00044000 sz=00048000
(bootloader) Updating: cmnlib @0008C000 sz=00037000
(bootloader) Updating: devcfg @000C3000 sz=0000F000
(bootloader) Updating: hyp @000D2000 sz=00040000
(bootloader) Updating: keymaster @00112000 sz=00046000
(bootloader) Updating: lockbooter @00158000 sz=00016000
(bootloader) Updating: pmic @0016E000 sz=0000D000
(bootloader) Updating: rpm @0017B000 sz=0003A000
(bootloader) Updating: tz @001B5000 sz=001DB000
(bootloader) Updating: xbl @00390000 sz=003A2000
(bootloader) Updating: apdp @00732000 sz=00004000
(bootloader) Updating: msadp @00736000 sz=00004000
(bootloader) Updating: hosd @0073A000 sz=01E1E000
(bootloader) Updating: abl @02558000 sz=00065000
OKAY [ 0.890s]
finished. total time: 2.625s
# fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.000s]
finished. total time: 0.050s