Flashing Nexus 5 factory image fails on writing userdata
I encounter the same problem today :)
flash-all script failed when writing userdata

I have managed to solve this issue by manually continue the flashing process:

1) extract image-hammerhead-m4b30z.zip

2) cd to the extracted folder

3) run the following commands (one by one)
fastboot erase userdata
fastboot flash userdata userdata.img
fastboot erase cache
fastboot flash cache cache.img
fastboot reboot