Mysql issue when running Simulator on debian

Daniel
Daniel
Hi there,

I am desperately looking at my console and can't detect where I'm wrong. I tried to test Diva (OpenSim 0.9.0.0) on Debian 9. As I know Diva from using it on a Windows machine, I expected no problems. I installed latest Mono (4.6.2) and MySQL (10.1.26) and follow the guide at https://github.com/diva/d2/wiki/MySql without success. I tried several combinations with other users (e.g. root) and without pw or whatever came to my mind ... in the end this error appeared each time:

[SERVICE BASE]: Failed to load plugin OpenSim.Region.Framework.Interfaces.ISimulationDataStore from Diva.Data.MySQL.dll with args Data Source=localhost;Database=opensim;User ID=root;Password=daniel1;Old Guids=true;Allow Zero Datetime=true;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
  at System.Reflection.MonoProperty.GetterAdapterFrame[T,R] (System.Reflection.MonoProperty+Getter`2[T,R] getter, System.Object obj) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x0006f] in <8f2c484307284b51944a1a13a14c0266>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00088] in <8f2c484307284b51944a1a13a14c0266>:0
  at MySql.Data.MySqlClient.NativeDriver.SetConnectAttrs () [0x00062] in <0004ab8b375b422f9000ac25a68089d9>:0
  at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate (System.Boolean reset) [0x00080] in <0004ab8b375b422f9000ac25a68089d9>:0
  at MySql.Data.MySqlClient.NativeDriver.Authenticate (System.String authMethod, System.Boolean reset) [0x0002a] in <0004ab8b375b422f9000ac25a68089d9>:0
  at MySql.Data.MySqlClient.NativeDriver.Open () [0x00320] in <0004ab8b375b422f9000ac25a68089d9>:0
  at MySql.Data.MySqlClient.Driver.Open () [0x0000b] in <0004ab8b375b422f9000ac25a68089d9>:0
  at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x0003f] in <0004ab8b375b422f9000ac25a68089d9>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00019] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00089] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00243] in <8f2c484307284b51944a1a13a14c0266>:0
23:44:12 - [SERVER UTILS]: Error loading plugin OpenSim.Region.Framework.Interfaces.ISimulationDataService from OpenSim.Services.SimulationService.dll. Exception: Could not find a storage interface in the given moduleSystem.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Could not find a storage interface in the given module
  at OpenSim.Services.SimulationService.SimulationDataService.LoadPlugin[T] (System.String dllName) [0x000ae] in <edcd243cd13b402887f8bf7acfaea414>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <8f2c484307284b51944a1a13a14c0266>:0
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00019] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00089] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <8f2c484307284b51944a1a13a14c0266>:0
  at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00243] in <8f2c484307284b51944a1a13a14c0266>:0
23:44:12 - [SERVER UTILS]: Error loading plugin OpenSim.Services.SimulationService.dll: Exception has been thrown by the target of an invocation. args.Length 1
23:44:12 - Fatal error: System.Exception: Could not load an ISimulationDataService implementation from OpenSim.Services.SimulationService.dll:SimulationDataService, as configured in the LocalServiceModule parameter of the [SimulationDataStore]: config section.
  at OpenSim.OpenSimBase.StartupSpecific () [0x0019d] in <923d35acb07a4af78ba683818705cd03>:0
  at OpenSim.OpenSim.StartupSpecific () [0x000fe] in <923d35acb07a4af78ba683818705cd03>:0
  at OpenSim.Framework.Servers.BaseOpenSimServer.Startup () [0x00064] in <b227fbf334b14382937cb22519a8d518>:0

Are there any ideas or experiences? I hope someone can help me :)

Best regards

Comments

  • Pius Noel
    Pius Noel
     Moderator edited December 2017
    Even it sounds a little bit strange, to me it sounds like an issue related to your mysql configuration in some way. Nowadays, where the mysql distribution has switched from MySQL to MariaDB on some newer Linux distributions and due to enhanced security configurations mysql issues are not always trivial to deal with.

    One issue I'm aware of with Diva and MariaDB (default mysql on Debian 9) is a missing GridUser table. However, this is another issue you will probably run into later. 

    In your case, for now, OpenSim.exe cannot even access the mysql database at all. I'm not sure it's a  security, installation or configuration issue.

    I just installed Diva (OpenSim 0.9.0.0) from the archives at http://metaverseink.com/Downloads.html on a Debian Stretch VM running on Oracle Virtualbox on my PC and didn't have the issue you have.

    My setup is as follows:
    - Debian GNU/Linux 9.3 (stretch), Kernel Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linux
    - mysql  Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
    - Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1)

    From your error messages I've seen you are using 'root' to access the database. I didn't test, but this might already be the cause of the problem.

    I'd suggest to try the following from your user account:

    1) Make sure you have installed MariaDB client and server
      $ sudo apt install mariadb-client mariadb-server

    2) Run mysql with sudo from your user account and if needed, delete the existing opensim schema and user 'opensim'@'localhost' before creating the new one.
    $ sudo mysql
    MariaDB [(none)]> drop database opensim;
    MariaDB [(none)]> drop user 'opensim'@'localhost';
     
    MariaDB [(none)]> create database opensim;
    MariaDB [(none)]> use opensim;
    MariaDB [opensim]> create user 'opensim'@'localhost' identified by 'your-password';
    MariaDB [opensim]> grant all on opensim.* to 'opensim'@'localhost';
    MariaDB [opensim]> flush privileges;
    MariaDB [opensim]> exit
    Note: Unlike mentioned in some Diva documentation you don't need a Debian user 'opensim'. The mysql username does not depend on an existing Linux account with the same name.

    3) cd into your diva bin directory and reconfigure Diva with actual database config data.
    e.g.
    daniel@debian:$ cd diva-r09000/bin/
    daniel@debian:~/diva-r09000/bin$ mono Configure.exe
    4.0.30319.42000
    Name of your world: Diva-Test
    MySql database host: [localhost]
    MySql database schema name: [opensim]
    MySql database user account: [opensim]
    MySql database password for that account: your-password
    ...

    4) Start Diva from your diva bin directory 
    daniel@debian:~/diva-r09000/bin$ mono OpenSim.exe
    At this point OpenSim should start and allow you to configure your first Region, Estate and Estate owner as your first user. Finally you should get to the console prompt from where you can enter commands like terrain fill 21 etc.

    However, you will probably get two errors:
    The first one I mentioned above and is related to mysql. It's error message starts like this:
    Table 'opensim.GridUser' doesn't existMySql.Data.MySqlClient.MySqlException (0x80004005): ...
    
    I've been dealing with this issue some time ago and got it resolved, but I don't remember exactly what the problem was (as far as I remember an invalid option for MariaDB). However, I'm quite sure I could help you to get this fixed again in case you need it.

    The second one is related to an internal server error, when Diva tries to register your simulator. I've seen the same error on windows installs already long time ago.
    [REST CLIENT]: Error fetching resource from server: http://metaverseink.com/cgi-bin/register.py?service=online&host=<your-host-domain-name>&port=9000&secret=b7de5b22-109e-4aca03250d91d System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

    I hope it helps.
    Pius
  • Pius Noel
    Pius Noel
     Moderator edited January 1
    Meanwhile I remembered the problem with MariaDB and the missing GridUser table mentioned above. The problem is, that MariaDB uses the utf8mb4 character set per default when you create the table, but the table has been designed for the utf8 character set which uses less bytes. while utf8 needs one to three bytes per character, utf8mb4 needs 4 bytes per character. Given the defined length of 255 characters for the UserID, which is the primary key, this results in more than the maximum length of 767 bytes for the primary key when used with the utf8mb4 character set.

    The solution is simple: create the database with utf8 as the default character set.

    MariaDB [(none)]> create database opensim character set = 'utf8' collate = 'utf8_general_ci';
    Pius
  • Daniel
    Daniel
     Member
    First, thanks als lot for the detailed hint.

    I followed your solution but ran into the same error - the root user was my last option, prior I used the famous 'opensim'-user ;) I tried everything again with version 0.8.2.1 and my region came up like a charm. That's the good news - so far I have no clue why, it's the same setting. I will try to figure it out and share my results.

    Best regards
  • Pius Noel
    Pius Noel
     Moderator
    Thanks for the feedback. As I never had and can't reproduce this issue I currently can't imagine anything else then a authentication issue (especially because your're using root in your example).

    On the other hand there have been made several changes to some of the MySQL data and MySQL authentication related source files between OpenSim version 0.8.2.1 and  the release date of Diva OpenSim 0.9.0.0.

    If the problem persists and can be reproduced by you it would be nice if you could file an error report at http://opensimulator.org/mantis.

    Regards
    Pius
  • Daniel
    Daniel
     Member
    I will file the error report ;) thanks for the hint
  • Pius Noel
    Pius Noel
     Moderator
    One final note to avoid confusion for others: to make sure nothing is missing I wrote "Make sure you have installed MariaDB client and server". This is not necessary. It's enough to install mariadb-server.
  • Gubbly
    Gubbly
     Member
    You have no problem with your MySQL. You are missing a DLL file or your diva plugin is not compatible with your OpenSim version. Try downloading the Diva installation from Opensimulator.org and installing it with the included installer.
  • kbt
    kbt
     Member edited October 25
    nevermind.
  • Manfred Aabye
    Manfred Aabye
     Member edited October 28
    Probably root has no mysql rights.
    You have to create a user and register it with mysql with the right one.
    But that is at ubuntu there are good instructions to mysql.
    Please change your password immediately.

    Ubuntu is based on Debian most commands are the same.

    MariaDB is not needed.
    Please use MySQL standard.
    $ sudo apt-get remove mariadb-client mariadb-server


    Original:
    Warscheinlich hat root keine mysql rechte.
    Du must ein benutzer anlegen und diesen bei mysql eintagen mit den rechten.
    Das steht aber bei ubuntu dort gibt es gute anleitungen zu mysql.
    Ändere bitte sofort dein Passwort.

    Ubuntu basiert auf Debian die meisten befehle sind genauso.

    MariaDB wird nicht benötigt.
    Bitte benutze MySQL Standart.
    $ sudo apt-get remove mariadb-client mariadb-server






Sign In or Register to comment.

Welcome

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions

© Copyright 2018 - Metropolis Metaversum
All times are GMT