diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 144cbbee6f..f89b9049c0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -218,10 +218,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // Count inventory items (different to asset count) CountItems++; - + // Don't chase down link asset items as they actually point to their target item IDs rather than an asset if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) + { + int curErrorCntr = m_assetGatherer.ErrorCount; m_assetGatherer.AddForInspection(inventoryItem.AssetID); + m_assetGatherer.GatherAll(); + curErrorCntr = m_assetGatherer.ErrorCount - curErrorCntr; + if(curErrorCntr > 0) + { + string spath; + int indx = path.IndexOf("__"); + if(indx > 0) + spath = path.Substring(0,indx); + else + spath = path; + + if(curErrorCntr > 1) + { + m_log.WarnFormat("[INVENTORY ARCHIVER]: item {0} '{1}', type {2}, in '{3}', contains at least {4} references to missing or damaged assets", + inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath, curErrorCntr); + } + else if(curErrorCntr == 1) + { + m_log.WarnFormat("[INVENTORY ARCHIVER]: item {0} '{1}', type {2}, in '{3}', contains at least 1 reference to a missing or damaged asset", + inventoryItem.ID, inventoryItem.Name, itemAssetType.ToString(), spath); + } + } + } } /// @@ -427,7 +452,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_log.DebugFormat( "[INVENTORY ARCHIVER]: The items to save reference {0} assets", m_assetGatherer.GatheredUuids.Count + errors); if(errors > 0) - m_log.DebugFormat("[INVENTORY ARCHIVER]: {0} of this assets have problems and will be ignored", errors); + m_log.DebugFormat("[INVENTORY ARCHIVER]: {0} of these assets have problems and will be ignored", errors); AssetsRequest ar = new AssetsRequest( new AssetsArchiver(m_archiveWriter), diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 548aa3a43d..46ce2ce2b2 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes /// The gathered uuids. public IDictionary GatheredUuids { get; private set; } public HashSet FailedUUIDs { get; private set; } - + public int ErrorCount { get; private set; } /// /// Gets the next UUID to inspect. /// @@ -103,7 +103,7 @@ namespace OpenSim.Region.Framework.Scenes /// Asset service. /// /// - /// Gathered UUIDs will be collected in this dictinaory. + /// Gathered UUIDs will be collected in this dictionary. /// It can be pre-populated if you want to stop the gatherer from analyzing assets that have already been fetched and inspected. /// public UuidGatherer(IAssetService assetService, IDictionary collector, HashSet failedIDs) @@ -114,6 +114,7 @@ namespace OpenSim.Region.Framework.Scenes // FIXME: Not efficient for searching, can improve. m_assetUuidsToInspect = new Queue(); FailedUUIDs = failedIDs; + ErrorCount = 0; } /// @@ -232,9 +233,6 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat("[UUID GATHERER]: Failed to get part - {0}", e); - m_log.DebugFormat( - "[UUID GATHERER]: Texture entry length for prim was {0} (min is 46)", - part.Shape.TextureEntry.Length); } } } @@ -286,14 +284,14 @@ namespace OpenSim.Region.Framework.Scenes private void GetAssetUuids(UUID assetUuid) { if(FailedUUIDs.Contains(assetUuid)) + { + ErrorCount++; return; + } // avoid infinite loops if (GatheredUuids.ContainsKey(assetUuid)) - { - FailedUUIDs.Add(assetUuid); return; - } AssetBase assetBase; try @@ -303,13 +301,15 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat("[UUID GATHERER]: Failed to get asset {0} : {1}", assetUuid, e.Message); + ErrorCount++; FailedUUIDs.Add(assetUuid); return; } if(assetBase == null) { - m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid); +// m_log.ErrorFormat("[UUID GATHERER]: asset {0} not found", assetUuid); + ErrorCount++; FailedUUIDs.Add(assetUuid); return; } @@ -318,7 +318,8 @@ namespace OpenSim.Region.Framework.Scenes if(assetBase.Data == null || assetBase.Data.Length == 0) { - m_log.ErrorFormat("[UUID GATHERER]: asset {0}, type {1} has no data", assetUuid, assetType); +// m_log.ErrorFormat("[UUID GATHERER]: asset {0}, type {1} has no data", assetUuid, assetType); + ErrorCount++; FailedUUIDs.Add(assetUuid); return; } @@ -355,6 +356,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.ErrorFormat("[UUID GATHERER]: Failed to gather uuids for asset with id {0} type {1}: {2}", assetUuid, assetType, e.Message); GatheredUuids.Remove(assetUuid); + ErrorCount++; FailedUUIDs.Add(assetUuid); } } @@ -363,7 +365,10 @@ namespace OpenSim.Region.Framework.Scenes { // Here, we want to collect uuids which require further asset fetches but mark the others as gathered if(FailedUUIDs.Contains(assetUuid)) + { + ErrorCount++; return; + } if(GatheredUuids.ContainsKey(assetUuid)) return; try