ClassiCube / MCGalaxy

A Minecraft Classic / ClassiCube server software
GNU General Public License v3.0
168 stars 79 forks source link

SQLite is completley borked using .NET Core build #701

Closed forkiesassds closed 2 years ago

forkiesassds commented 2 years ago

Possibly an issue with Linux?

user@lan:~/agdfgfh/MCGalaxy/CLI/bin/Debug/netcoreapp3.1$ ./MCGalaxyCLI_core 
(16:29:40) Starting Server
(16:29:40) Error executing SQL statement: CREATE TABLE if not exists `Opstats` (
ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Time DATETIME,
Name VARCHAR(17),
Cmd VARCHAR(40),
Cmdmsg VARCHAR(40)
);

!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: CREATE TABLE if not exists `Players` (
ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Name VARCHAR(17),
IP CHAR(15),
FirstLogin DATETIME,
LastLogin DATETIME,
totalLogin MEDIUMINT,
Title CHAR(20),
TotalDeaths SMALLINT,
Money MEDIUMINT UNSIGNED,
totalBlocks BIGINT,
totalCuboided BIGINT,
totalKicked MEDIUMINT,
TimeSpent VARCHAR(20),
color VARCHAR(6),
title_color VARCHAR(6),
Messages MEDIUMINT UNSIGNED
);

!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: SELECT COUNT(*) FROM `sqlite_master` WHERE type='table' AND name=@0
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: PRAGMA table_info(`Players`)
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: CREATE TABLE if not exists `Economy` (
player VARCHAR(20),
money INT,
total INT,
purchase VARCHAR(255),
payment VARCHAR(255),
salary VARCHAR(255),
fine VARCHAR(255), PRIMARY KEY(player) 
);

!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: SELECT * FROM `Economy` WHERE money > 0
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: SELECT COUNT(*) FROM `sqlite_master` WHERE type='table' AND name=@0
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: SELECT COUNT(*) FROM `sqlite_master` WHERE type='table' AND name=@0
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Error executing SQL statement: SELECT COUNT(*) FROM `sqlite_master` WHERE type='table' AND name=@0
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Level "main" loaded.
(16:29:40) Error executing SQL statement: SELECT TimeSpent FROM `Players` LIMIT 1
!!!Error (Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory) - See logs/errors/2022-05-03error.log for more details.
(16:29:40) Started listening on port 25565... 
(16:29:40) Finished setting up server
(16:29:40) Finding classicube.net url..
UnknownShadow200 commented 2 years ago

What do you mean by that

forkiesassds commented 2 years ago

Updated post with logs

UnknownShadow200 commented 2 years ago

Is libsqlite3-0 package installed?

forkiesassds commented 2 years ago

Is libsqlite3-0 package installed?

Yes.

user@lan:~/agdfgfh/MCGalaxy/CLI$ sudo apt install libsqlite3-0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libsqlite3-0 is already the newest version (3.37.2-2).
libsqlite3-0 set to manually installed.
forkiesassds commented 2 years ago

Detailed logs

----5/3/2022 7:59:43 PM ----
Type: DllNotFoundException
Source: MCGalaxy_core
Message: Unable to load shared library 'sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libsqlite3: cannot open shared object file: No such file or directory
Trace:    at MCGalaxy.SQL.Interop.sqlite3_open_v2(Byte[] utf8Filename, IntPtrdb, Int32 flags, IntPtr vfs)
   at MCGalaxy.SQL.SQLiteConnection.Open() in /home/user/zsplugin/MCGalaxy/MCGalaxy/Database/Backends/SQLiteBackend.cs:line 196
   at MCGalaxy.SQL.SqlQuery.Execute(String sql, Object[] parameters, Boolean createDB) in /home/user/zsplugin/MCGalaxy/MCGalaxy/Database/SqlQuery.cs:line 30
   at MCGalaxy.SQL.Database.Do(String sql, Boolean createDB, Object arg, ReaderCallback callback, Object[] args) in /home/user/zsplugin/MCGalaxy/MCGalaxy/Database/Database.cs:line 184
UnknownShadow200 commented 2 years ago

probably need to copy sqlite3.so.0 from lib folder to sqlite3.so in MCGalaxy folder image

forkiesassds commented 2 years ago

probably need to copy sqlite3.so.0 from lib folder to sqlite3.so in MCGalaxy folder image

This solves the issue.

UnknownShadow200 commented 2 years ago

Documented in https://github.com/UnknownShadow200/MCGalaxy#compiling---net-6--net-5--net-core now