run error(create script failure: fail to retrieve target)
I had the exact same problem on my STM32F072B Disco board. I was able to solve this by first building the project, then simply deleting the 32F072BDISCOVERY.xml file. Upon re-running the debug, it seemed to work fine.
It is worth noting that I was able to debug my board when just making a normal C project without going through CubeMx prior to these steps.