A SNAFU. Completely bollixed up. Screwed. A disaster. Everything went wrong. "It was a complete Cockup." Although, it's true, there's usually a dash in there: "Cock-up." The origins of the phrase are unclear; it is generally agreed to have been originally British military slang from the 1920s. However, its etymology is unknown. Some possibilities do exist, however, and none of them are actually obscene. The phrase apparently gets 'cock' from the verb cock - as in, 'to set at an angle.' Cocking a gun involves setting the hammer at an angle. Why the military would consider cocking up to be bad is the question.

If the slang is from the British Army, that might help - as in fact the naval officer's cap was apparently worn with the brim cocked up. Hence, to 'cock up' might have been used to invoke the scorn that 'regular army types' have felt for the Navy since time immemorial; as in "if you wanted to laze around, you should've joined the Navy!" To cock up, then, would be to make a situation resemble one handled by the Navy. Given that the phrase was used early on to refer to land fronts ("The eastern front is a total cock-up") this would possibly indicate that things on the ground had deteriorated to where a Naval officer might as well have been responsible.

This is only a guess, however.