ColinHDev / CPlot

Land and world management plugin for PocketMine-MP
https://discord.gg/cAYKEtaqnp
GNU General Public License v3.0
29 stars 12 forks source link

[BUG]: Crash on SQLite preparing #1

Closed supercrafter333 closed 2 years ago

supercrafter333 commented 2 years ago

Error:

[13:51:00.509] [Server thread/CRITICAL]: ErrorException: "SQLite3::prepare(): Unable to prepare statement: 1, no such table: main.players" (EXCEPTION) in "plugins/CPlot_dev-19.phar/src/ColinHDev/CPlot/provider/SQLiteProvider" at line 246
--- Stack trace ---
  #0 (): pocketmine\errorhandler\ErrorToExceptionHandler::handle(integer 2, string[79] SQLite3::prepare(): Unable to prepare statement: 1, no such table: main.players, string[98] phar:///home/Development/plugins/CPlot_dev-19.phar/src/ColinHDev/CPlot/provider/, integer 246)
  #1 plugins/CPlot_dev-19.phar/src/ColinHDev/CPlot/provider/SQLiteProvider(246): SQLite3->prepare(string[96] INSERT OR REPLACE INTO playerSettings (playerUUID, ID, value) VALUES (:playerUUI)
  #2 plugins/CPlot_dev-19.phar/src/ColinHDev/CPlot/provider/SQLiteProvider(108): ColinHDev\CPlot\provider\SQLiteProvider->createSQLite3Stmt(string[96] INSERT OR REPLACE INTO playerSettings (playerUUID, ID, value) VALUES (:playerUUI)
  #3 plugins/CPlot_dev-19.phar/src/ColinHDev/CPlot/CPlot(59): ColinHDev\CPlot\provider\SQLiteProvider->__construct(array[2])
  #4 pmsrc/src/plugin/PluginBase(95): ColinHDev\CPlot\CPlot->onLoad()
  #5 pmsrc/src/plugin/PluginManager(214): pocketmine\plugin\PluginBase->__construct(object pocketmine\plugin\PharPluginLoader#23399, object pocketmine\Server#10, object pocketmine\plugin\PluginDescription#23444, string[35] /home/Development/plugin_data/CPlot, string[50] phar:///home/Development/plugins/CPlot_dev-19.phar, object pocketmine\plugin\DiskResourceProvider#23568)
  #6 pmsrc/src/plugin/PluginManager(357): pocketmine\plugin\PluginManager->internalLoadPlugin(string[43] /home/Development/plugins/CPlot_dev-19.phar, object pocketmine\plugin\PharPluginLoader#23399, object pocketmine\plugin\PluginDescription#23444)
  #7 pmsrc/src/Server(1003): pocketmine\plugin\PluginManager->loadPlugins(string[26] /home/Development/plugins/)
  #8 pmsrc/src/PocketMine(303): pocketmine\Server->__construct(object BaseClassLoader#3, object pocketmine\utils\MainLogger#2, string[18] /home/Development/, string[26] /home/Development/plugins/)
  #9 pmsrc/src/PocketMine(326): pocketmine\server()
  #10 pmsrc(11): require(string[62] phar:///home/Development/PocketMine-MP.phar/src/PocketMine.php)
ColinHDev commented 2 years ago

Fixed with 5446b90819b02f924daddded3f0be23696df6fee. Please remember that this is far from a full release and will receive many, mostly internal changes. (Also, we are pending a rewrite of the database system when I switch from natively depending on the SQLite3 extension to libasynql.)

supercrafter333 commented 2 years ago

Libasynql is a very gr8 solution 👍

supercrafter333 commented 2 years ago

This issue doesn't fixed the bug. Please reopen it until the bug is finally fixed.

ColinHDev commented 2 years ago

Libasynql is a very gr8 solution 👍

Yes, but I need to rewrite some parts since internally the plugin depends on synchronized database queries.

ColinHDev commented 2 years ago

This issue doesn't fixed the bug. Please reopen it until the bug is finally fixed.

You need to delete the old database file since a foreign key was set to a false table.