Symptom:
The following error appears when deploying the cube or designing aggregations
The reference to attribute is not valid
Cause:
The partitions file has gotten out of sync with the cube file. Perhaps the cube file got checked back in to source control but the partitions file changes were undone.
Solution Options:
You may be able to hack the partitions file to clean up invalid attribute references.
Then again it may be easier just to roll back and reapply your changes.