Hey, we’ve hit issue where we got P4 streams used for builds on Horde using P4 Component stream and where we try to map files from same source. With P4 component stream you can have multiple streams/depots sourcing data into one stream (i.e. useful for raw resources common across multiple projects + code/data directly for the game). But it allows an extra step let you map resources from same folder 2 two different locations (in our case it is top-level folder /Resources and then some folder in UI structure), an example:
```
//CodeName/main/… …
//Resources/CodeName/… Resources/CodeName/…
//Resources/CodeName/UI/Images/… CodeNameGame/UIResources/CodeName/UI/Resources/Images/…
```
This works all good on developers PCs, however, with current Horde code, this leads to error during Agent workspace’s setup:
```
Unshelving changelist 123456...
Exception while executing lease 6a8417fece442f0a0e46d2e7: An item with the same key has already been added. Key: //Resources/CodeName/UI/Images/T_LoadingDotCircle.png
Done.
```
The issue is coming from the idea, that Horde agent is making list of files in managed workspace and when there are entries from same source, they fail to parse with the error above (“same key has already been added”). We thought that current managed workspace definition would solve it by unmapping one of the folders (i.e. the top-level /resources folder), an exhibit we use:
```
“workspaceTypes”: {
"default\-full": {
"cluster": "perforce\-main",
"identifier": "default\-full",
"view": \[
"\-/Resources/...",
"\-/CodeName/Content/Developers/...",
"\-/CodeName/Content/\_\_ExternalActors\_\_/Developers/...",
"\-/CodeName/Content/\_\_ExternalObjects\_\_/Developers/..."
],
"incremental": false,
"useAutoSdk": true,
"method": "name\=managedWorkspace\&useHaveTable\=false\&preferNativeClient\=false"
},
```
However this did not help. The reason behind is that the managed workspace still tries to resolve all the files, and just after it will perform the unmapping/not materializing files on the disk. So even we use `“-/Resources/…”` , there are still technically 2 sources from `//Resources/CodeName`. The missing bit is to add Unmap for managed workspace, I have prepared fix with tests in https://github.com/EpicGames/UnrealEngine/pull/15096 . We’ve put this in our production and all seems look so far - the issue was resolved and nothing break (yet we are on half-year older Horde version).
[Attachment Removed]