OpenSim-NGC / OpenSim-Tranquillity

OpenSim Core ++. Provides Bug Fixes and some new ideas that enhance the reliability and performance of OpenSim Core Yeti.
Other
23 stars 13 forks source link

Linux - Startup fails on Sasquatch 06/2021 Release with Required module DefaultPermissionsModule not found #34

Closed sarapayne closed 1 year ago

sarapayne commented 3 years ago

This has to be configuration dependant since Mike has it working. However, my configuration works with Sasquatch 05/2021 Release Hotfix 1, Sasquatch 05/2021 and Opensim-Core.

In all versions of Sasquatch, the configuration is the same, with Opensim-Core it just lacks the globit config files and dll. Logs Attached.

05-2021-release - Pass.txt 06-2021 Release - Fail.txt Opensim-Core-07-2011 - Pass.txt

Opensim.exe Permions Section [Permissions] permissionmodules = DefaultPermissionsModule serverside_object_permissions = true allow_grid_gods = true region_owner_is_god = false region_manager_is_god = false

mdickson commented 3 years ago

You're definitely using the same config for all these cases? It looks like the regions are different at a minimum. I'll follow up with you and see if I can get the config you're using. I need to replicate this error to fix it.

sarapayne commented 3 years ago

Sometimes a video makes things clear when demonstrating consistency. This is exactly the same configuration.

startup-fail-Demonstration.tar.gz

I forgot to add the globit.ini file into the bin folder in the last demo, but it still gives the same result.

This is the config I am using, all passwords and similar have been removed

OpenSim- Config.tar.gz

mdickson commented 3 years ago

Ok I've replicated as best I can your config. With permissions explicitely enabled but no issue so this doesn't appear to be a simple config issue. The logs are very different when modules get loaded. So I'm wondering if its a loading issue. There have been changes in that area.

When you start OpenSim do you run from the binary directory? I do something like ....

(cd $BASEDIR && Opensim.exe) vs $BASEDIR/OpenSim.exe where you might not be in the actual directory the code is in.

sarapayne commented 3 years ago

3 Consecutive runs log. The first has no globits.ini and neither does the 2nd, for completeness the 3rd log includes the Globit.ini file.

The first log is different to the subsequent ones but the end result is the same.

3-Consecutive-Run-Logs.tar.gz

sarapayne commented 3 years ago

I removed my last comment, that change was a user error. I had added in the external name for lsl but not changed the variable. Robust starts successfully other than on the first run. However, I am still getting exactly the same results as previous attempts for simulators. I also replaced the bin folder again to confirm I can still run the previous version and I can.

KayakerMagic commented 3 years ago

I just cloned a new copy of NGC today, got it to build on an Ubuntu 18.04 system, tried to test it and got the same error about DefaultPermissionsModule. I run from the binary directory and reach out to a folder with specifics for each region. Tried this after building the Debug and the Release version, same result. Log from the last try: OpenSim.log.txt

sarapayne commented 3 years ago

During config reading the default permissions string is set correctly, however it looks as though the fault is more generic and this is just the one that gets picked up.

OpenSimBase.cs at line 455

`if (m_securePermissionsLoading) { foreach (string s in m_permsModules) { if (!scene.RegionModules.ContainsKey(s)) { m_log.Fatal("[MODULES]: Required module " + s + " not found."); Environment.Exit(0); } }

            m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray()));
        }scene.RegionModules = {Dictionary<string, IRegionModuleBase>} Count = 0`

The dictionary at this point is empty, it has no entries

empty dictionary

unless that dictionary is supposed to contain just one entry this fault is not really related to default permissions at all

sarapayne commented 3 years ago

Comparing launching OpenCore against the lastest sasquatch to find where it goes wrong.

ServerUtils.cs Line 273

`public static T LoadPlugin(string dllName, string className, Object[] args) where T:class { string interfaceName = typeof(T).ToString();

        try
        {
            Assembly pluginAssembly = Assembly.LoadFrom(dllName);

            foreach (Type pluginType in pluginAssembly.GetTypes())
            {
                if (pluginType.IsPublic)
                {
                    if (className != String.Empty
                        && pluginType.ToString() != pluginType.Namespace + "." + className)
                        continue;

                    Type typeInterface = pluginType.GetInterface(interfaceName);

                    if (typeInterface != null)
                    {
                        T plug = null;
                        try
                        {
                            plug = (T)Activator.CreateInstance(pluginType,
                                    args);
                        }
                        catch (Exception e)
                        {
                            if (!(e is System.MissingMethodException))
                            {
                                m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}",
                                    interfaceName,
                                    dllName,
                                    e.InnerException == null ? e.Message : e.InnerException.Message),
                                        e);
                            }
                            m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length);
                            return null;
                        }

                        return plug;
                    }
                }
            }

            return null;
        }
        catch (ReflectionTypeLoadException rtle)
        {
            m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin from {0}:\n{1}", dllName,
                String.Join("\n", Array.ConvertAll(rtle.LoaderExceptions, e => e.ToString()))),
                rtle);
            return null;
        }
        catch (Exception e)
        {
            m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin from {0}", dllName), e);
            return null;
        }
    }`

Assembly pluginAssembly = Assembly.LoadFrom(dllName);

On Opensim core this works, however, in the latest sasquatch, it fails and jumps to the catch. Failing with file not found error

System.IO.FileNotFoundException: Invalid Image File name: 'OpenSim.Services.SimulationService.dll' at (wrapper managed-to-native) System.Reflection.Assembly.LoadFrom(string,bool,System.Threading.StackCrawlMark&) at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00002] in <533173d24dae460899d2b10975534bb0>:0 at OpenSim.Server.Base.ServerUtils.LoadPlugin[T] (System.String dllName, System.String className, System.Object[] args) [0x00010] in /home/sara/src/FireAndIce/OpenSim-Sasquatch/OpenSim/Server/Base/ServerUtils.cs:273

This failure means that OpenSimBase.cs at line 255 m_simualtionDataService returns as null

sarapayne commented 3 years ago

Edited:

Missing DLL's are only when building with Rider, command-line builds produce the dlls, however, the main issue still persists. Adding in the missing dll's to Riders build folders manually results in just one pluginType existing rather than the several expected.

mdickson commented 3 years ago

Some more information. All of the plugin types that do work (Robust, RegionServer Startup, etc) use a Plugin Loader in OpenSIm. Framework to load plugins. This appears to function ok. The RegionModule loader (which is itself a plugin and was loaded from the PluginManager) directly interfaces with Mono.Addins (as does the Wind modules btw). I'm looking at reworking the Module loader a bit to use the Framework classes. I still don't have a handle on why it works on my grid environments but not on others. I've reviewed things looking for environmental differences but can't see anything. Going to continue that effort as well while I rework the module loader.

sarapayne commented 1 year ago

Following a lot of work by @mdickson this issue is resolved at some point before commit e8d271f