Network Management
Orion Maps fails to load and generates an error
This article addresses an issue that prevents Orion Maps from displaying in the Orion Web Console, generating an error. Error: "An item with the same key has already been added" OrionWeb.log shows this error [Import faca86e6-8a6f-4666-8b53-df78070e13f7.OrionMap] (7646) ERROR MapRunner - (null) CreateMapTask {ID=faca86e6-8a6f-4666-8b53-df78070e13f7.OrionMap,State=Faulted,Exception=ArgumentException:"An item with the same key has already been added."}
First published date
Last published date
Overview
An item with the same key has already been addedWhen you open the OrionWeb.log (C:\ProgramData\SolarWinds\Logs\Orion) file, the following errors are recorded in the file:
ERROR MapService - (null) Unexpected error. SolarWinds.MapStudio.Web.MapRunnerFaultedException: An error occurred while generating map bde5d915-88bd-4ef8-a770-fa08806af7b4.OrionMap ---> System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at SolarWinds.MapEngine.FileSynchronization.GetFileList(MapStudioFileType fileType) at SolarWinds.MapEngine.FileSynchronization.SynchronizeFiles(MapStudioFileType fileType, Boolean doUpdate, Action`1 progressReportCallback) at SolarWinds.MapEngine.MapSynchronization.SynchronizeImportedAndUserGraphics(Boolean doUpdate, Action`1 progressReportCallback) at SolarWinds.MapEngine.MapSynchronization.GetSingleMapAndSubmap(SolarWindsIdentification swId, Boolean synchronizeUserGraphics) at SolarWinds.MapEngine.Engine.GetSingleMapAndAddTopEntities(SolarWindsIdentification swId, Boolean synchronizeUserGraphics) at SolarWinds.MapEngine.OrionEngine.GetMapWithoutLimitation(SolarWindsIdentification swId, Boolean disableViewLimitation, Boolean synchronizeUserGraphics) at MapImport.GetMapNetObject(CreateMapParameters parameters, StopwatchHelper sw, IEngine engine) at MapImport.SaveMap(CreateMapParameters parameters) at SolarWinds.MapStudio.Web.MapRunner.ImportThreadProc(Object obj) --- End of inner exception stack trace --- at SolarWinds.MapStudio.Web.MapRunner.CreateMapTask.ThrowStateException() at SolarWinds.MapStudio.Web.MapRunner.Execute(CreateMapParameters parameters) at MapService.CreateMap(CreateMapParameters parameters) at MapService.GetMap(String sessionId)
Product section
Cause
MapStudioFiles table.Resolution
- Run the following query against your Orion database to see if your database has this issue:
-- Scripts are not supported under any SolarWinds support program or service. -- Scripts are provided AS IS without warranty of any kind. SolarWinds further -- disclaims all warranties including, without limitation, any implied warranties -- of merchantability or of fitness for a particular purpose. The risk arising -- out of the use or performance of the scripts and documentation stays with you. -- In no event shall SolarWinds or anyone else involved in the creation, -- production, or delivery of the scripts be liable for any damages whatsoever -- (including, without limitation, damages for loss of business profits, business -- interruption, loss of business information, or other pecuniary loss) arising -- out of the use of or inability to use the scripts or documentation. select [FileName] from dbo.MapStudioFiles where FileType=128 and IsDeleted = 0 group by [FileName] having count(FileId) > 1
- If the query does not generate results, you are finished. No intervention is required.
If the query generates results, go to step 3.
- Back up the Orion SQL database.
SolarWinds Backup can help you streamline this task.
- Run the following query to remove the duplicate files:
DECLARE @file nvarchar(max) DECLARE cleanup_duplicated_pictures CURSOR FOR select [FileName] from dbo.MapStudioFiles where FileType=128 and IsDeleted = 0 group by [FileName] having count(FileId) > 1 OPEN cleanup_duplicated_pictures FETCH NEXT FROM cleanup_duplicated_pictures INTO @file WHILE @@FETCH_STATUS = 0 BEGIN delete from dbo.MapStudioFiles where FileId in ( select FileId from dbo.MapStudioFiles where [FileName] = @file and IsDeleted = 0 ) and FileId not in ( select top 1 FileId from dbo.MapStudioFiles where [FileName] = @file and IsDeleted = 0 ) FETCH NEXT FROM cleanup_duplicated_pictures INTO @file END CLOSE cleanup_duplicated_pictures DEALLOCATE cleanup_duplicated_pictures