In most cases, an act of terror is preceded by an increase in chatter. The sources are often known, but there usually isn't enough specific information to prevent an attack. All the intelligence agencies can do is provide non-specific warnings. In the case of the Bulgarian attack, apparently there was a non-specific warning.
15 police officers killed in Colombia helicopter crash (Reuters)
from the article: Report: Israel fears Iranian terror attack at London 2012 Olympics