Coughing up crap without the other symptoms of a cold or allergies should be an indication to go see the doctor. I had that happen when I was training for my first STP and a course of antibiotics put me back on track--but that was with a month or so to recover before the event. See what your doctor says about riding. I have no doubt you trained enough, but the health issue is troubling.
Rodriguez Adventure
Bacchetta Bellandare
HPV Gekko fx
Custom Rodriguez Tandem
2009 Specialized Tricross
2012 Trek Mamba