From a533db7e279d533a6858a194fef5d913553c1bf9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 23 Aug 2012 22:30:14 +0100 Subject: [PATCH 1/2] Add an [HGAssetService] section to SQLiteStandalone.ini with the same connection string as [AssetService]. This is necessary because commit 8131a24 (Tue Mar 27 10:08:13 2012) started passing the config section name rather than hardcoding "AssetService" This meant that the HG external-facing asset service tried to read ConnectionString from [HGAssetService] rather than [AssetService]. On SQLite, not finding this meant that it fell back to [DatabaseService], which is set for OpenSim.db rather than Asset.db. Therefore, all external asset requests returned null. Solution taken here is to create an [HGAssetService] section with the same ConnectionString as [AssetService]. This bug does not affect normal MySQL/MSSQL config since they use the [DatabaseService] connection string anyway. Addresses http://opensimulator.org/mantis/view.php?id=6200, many thanks to DanBanner for identifying the exact problem commit which was very helpful. This was a regression from OpenSimulator 0.7.3.1 which did not contain this bug. --- bin/config-include/storage/SQLiteStandalone.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/config-include/storage/SQLiteStandalone.ini b/bin/config-include/storage/SQLiteStandalone.ini index c1de71aa21..67d98fff69 100644 --- a/bin/config-include/storage/SQLiteStandalone.ini +++ b/bin/config-include/storage/SQLiteStandalone.ini @@ -7,6 +7,16 @@ [AssetService] ConnectionString = "URI=file:Asset.db,version=3" +; The HGAssetService section controls the connection given to the AssetService in a Hypergrid configuration. +; This has to be separate from [AssetService] because the Hypergrid facing connector uses [HGAssetService] for its config data instead. +; However, the internal asset service will still use the [AssetService] section. +; Therefore, you will almost certainly want the ConnectionString in [HGAssetService] to be the same as in [AssetService] +; so that they both access the same database. +; This issue does not apply to normal MySQL/MSSQL configurations, since by default they use the settings in [DatabaseService] and +; do not have separate connection strings for different services. +[HGAssetService] + ConnectionString = "URI=file:Asset.db,version=3" + [InventoryService] ;ConnectionString = "URI=file:inventory.db,version=3" ; if you have a legacy inventory store use the connection string below From aede42b87559aa1f8f3197b53b9bf5c2b547701a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 23 Aug 2012 23:13:53 +0100 Subject: [PATCH 2/2] If a script state save fails for some reason on shutdown/region removal, get xengine to spit out some useful information and continue to save other script states --- .../Region/ScriptEngine/XEngine/XEngine.cs | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 53f899abcd..5a3f002c53 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -589,7 +589,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (m_Assemblies.ContainsKey(instance.AssetID)) { string assembly = m_Assemblies[instance.AssetID]; - instance.SaveState(assembly); + + try + { + instance.SaveState(assembly); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[XEngine]: Failed final state save for script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", + instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name) + , e); + } } // Clear the event queue and abort the instance thread @@ -707,7 +719,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine assembly = m_Assemblies[i.AssetID]; } - i.SaveState(assembly); + try + { + i.SaveState(assembly); + } + catch (Exception e) + { + m_log.Error( + string.Format( + "[XEngine]: Failed to save state of script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", + i.PrimName, i.ScriptName, i.ItemID, i.ObjectID, World.Name) + , e); + } } instances.Clear();