Monday, June 8, 2015

Duplicate GUIDs - Something that should not happen

Recently I got an email from a colleague at work.  He had a project file that he could not save in MS Project Server (MS PS.)   The file came from a vendor, it was not one he had built himself.  The error he got said that an error had occurred during the save process.  He could open the file, save it locally, but when he tried to save to PS, he got the same error repeatedly.  I first checked the PS queues and noticed that an error was being returned as he had mentioned.  I followed the link that showed me the error message details and noticed that the problem was a duplicate key in the Resource table and mentioned the GUID column.



GUIDs are fields that allow for complete uniqueness for each task and resource within a MS Project file and across all MS Project files within a system.  There is also the UID field that allows for uniqueness within a single MS Project file.  Refer to my earlier post on GUIDs and UIDs for more info. Titled - "UIDs, GUIDs - There are Druids in Project"


Since GUIDs are unique across the enterprise, I was surprised to learn that duplicates can happen.  Since the detailed error message mentioned the resource table, I went to the project file and applied the Resource Sheet view.  Fortunately, there were only about 20-30 resources in the view.  I did notice that there were a few resources with nothing in the Name column yet had the other relevant columns filled in, meaning that they were actual resources.  I then exposed the GUID column and sorted on it (this did not work well) and noticed that, sure enough, there were duplicates in the GUID column.  The duplicate resources did not have any assignments associated with them.  I decided to delete these resources and see what happened.  As you could predict, without the dups, I was able to save the project file into PS.


I then did some research on the web and found a few references to duplicate GUIDs.  GUIDs are used in other Microsoft products and they can be duplicated in the other products as well.  In Project desktop, the  GUIDs are not checked for uniqueness when the file is saved.  However, in MS PS, the GUIDs are checked for uniqueness when the file is saved into the PS repository.  Since the GUID column becomes a key in the Resource table and duplicates are not allowed, the error above is presented.


Since this file came from a vendor, I was not able to determine the exact situation that caused the duplication of the GUIDs.  The vendor is state that they built a project file that covered the work and then cloned the file 20 times, one for each location where the work would happen.  In talking with other experts, I learned that GUIDs can be duplicated by repeated copying and pasting of tasks or resources within MS Project.