One of the Dimension table is derived from the fact table. The value in the Dimension table is something like this
ID Field1 Field2
NULL NULL Uknown
0 0 Unknown
1 1 underweight
. . .
We take care of nulls in dimension when generating from ETL, but if it is coming from Fact we may miss and I did that too.
The 0 and NULL are considered same attribute and the cube was giving duplicate attribute key for this. (Although the error was not specific, it was for all other dimensions attribute but there was warning for this). I then wrote ISNULL function for the column when there is null replace by -1 and then the cube started processing.