FPtje / DarkRP

DarkRP, a non-serious roleplay gamemode for Garry's Mod.
https://darkrp.miraheze.org
MIT License
466 stars 710 forks source link

SQL database not working #2517

Closed gmanc2 closed 8 years ago

gmanc2 commented 8 years ago

Description of the bug

Won't save to database

How to make the bug happen

Its constant

Lua errors

L 07/09/2016 - 17:07:10: Lua Error: [ERROR] gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:241: attempt to index local 'jobTable' (a nil value)

  1. unknown - gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua:241

    [ERROR] addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:980: table index is nil

  2. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:980

    1. doInclude - [C]:-1
    2. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:137
      1. Call - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:148
      2. unknown - gamemodes/darkrp/gamemode/cl_init.lua:53

    [DarkRP] gamemodes/darkrp/gamemode/libraries/fn.lua:252: attempt to index local 'xs' (a nil value)

  3. isMayor - gamemodes/darkrp/gamemode/libraries/fn.lua:252
    1. Init - addons/ariviaf4menu/lua/arivia/cl/cl_tab_commands.lua:27
    2. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:37
      1. UpdateCommands - addons/ariviaf4menu/lua/arivia/cl/cl_init.lua:773
      2. Init - addons/ariviaf4menu/lua/arivia/cl/cl_init.lua:434
      3. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:37
      4. openF4Menu - addons/ariviaf4menu/lua/arivia/cl/cl_init.lua:1109
        1. Call - addons/ariviaf4menu/lua/arivia/cl/cl_init.lua:1131
        2. unknown - gamemodes/darkrp/gamemode/modules/base/cl_gamemode_functions.lua:62

[ERROR] gamemodes/darkrp/gamemode/modules/fadmin/fadmin/access/sv_init.lua:382: attempt to index global 'MySQLite' (a nil value)

  1. fn - gamemodes/darkrp/gamemode/modules/fadmin/fadmin/access/sv_init.lua:382
    1. unknown - addons/ulib-master/lua/ulib/shared/hook.lua:110

      Why the developer of DarkRP is responsible for this issue

Last night a commit was made and I updated and now sql simply doesnt work... it worked before now it doesn't...

gmanc2 commented 8 years ago

b95808fd65e698d8735a1431539bbec5 1 ef00993f3f35e009e27da722d831bc88 1

As you can see all of the assests are in place for sql and


RP_MySQLConfig = {} -- Ignore this line
--[[
Welcome to MySQL for DarkRP!
In this file you can find a manual for MySQL configuration and the MySQL config settings.
 ]]

RP_MySQLConfig.EnableMySQL = true -- Set to true if you want to use an external MySQL database, false if you want to use the built in SQLite database (garrysmod/sv.db) of Garry's mod.
RP_MySQLConfig.Host = "ip" -- This is the IP address of the MySQL host. Make sure the IP address is correct and in quotation marks (" ")
RP_MySQLConfig.Username = "obn" -- This is the username to log in on the MySQL server.
                                -- contact the owner of the server about the username and password. Make sure it's in quotation marks! (" ")
RP_MySQLConfig.Password = "password" -- This is the Password to log in on the MySQL server,
                                    -- Everyone who has access to FTP on the server can read this password.
                                    -- Make sure you know who to trust. Make sure it's in quotation marks (" ")
RP_MySQLConfig.Database_name = "obn_ww" -- This is the name of the Database on the MySQL server. Contact the MySQL server host to find out what this is
RP_MySQLConfig.Database_port = 3306 -- This is the port of the MySQL server. Again, contact the MySQL server host if you don't know this.
RP_MySQLConfig.Preferred_module = "tmysql4" -- Preferred module, case sensitive, must be either "mysqloo" or "tmysql4". Only applies when both are installed.
RP_MySQLConfig.MultiStatements = false -- Only available in tmysql4: allow multiple SQL statements per query. Has no effect if no scripts use it.

--[[
MANUAL!
HOW TO USE MySQL FOR DARKRP!
Download andyvincent's/Drakehawke's/KingofBeast's gm_MySQL OO module and read the guide here:
http://facepunch.com/showthread.php?t=1357773

WHAT TO DO IF YOU CAN'T GET IT TO WORK!
    - There are always errors on the server, try if you can see those (with HLDS/server logs)
    - the same errors are also in the logs if you can't find the errors on the server.
        the logs are at garrysmod/data/DarkRP_logs/ on the SERVER!
        The MySQL lines in the log always precede with "MySQL Error:" (without the quotation marks)
    - make sure the settings in this file (mysql.lua) are correct
    - make sure the MySQL server is accessible from the servers IP
]]
Shigbeard commented 8 years ago

Have you double checked to make sure you've correctly uploaded DarkRP to your server? If you are using Filezilla, you will likely find that some files were not uploaded or are corrupted.

Try using https://winscp.net/eng/docs/free_ftp_client_for_windows for an alternative FTP Client to Filezilla.

gmanc2 commented 8 years ago

@Shigbeard All files were uploaded...

Bo98 commented 8 years ago

Could you post the first error you see? jobTable errors are usually caused by earlier errors.

gmanc2 commented 8 years ago

[ERROR] addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:980: table index is nil
  1. unknown - addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua:980
   2. doInclude - [C]:-1
    3. loadCustomDarkRPItems - gamemodes/ww1/gamemode/libraries/modificationloader.lua:137
     4. Call - gamemodes/ww1/gamemode/libraries/modificationloader.lua:148
      5. unknown - gamemodes/ww1/gamemode/cl_init.lua:53
Bo98 commented 8 years ago

Ah, that is an error in your jobs file. Around line 980. It probably is that one of your teams listed under GAMEMODE.CivilProtection does not exist.

gmanc2 commented 8 years ago

@Bo98 The last on my jobs file is 691

gmanc2 commented 8 years ago

I also get this


SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
SQL Error: 
[PlayerSelectSpawn] Error! No spawn points!
gmanc2 commented 8 years ago

Why did you close this @FPtje

FPtje commented 8 years ago

Not a help forum

gmanc2 commented 8 years ago

But it's obviously and error with the update you just made as I've never had this error in the past @FPtje

FPtje commented 8 years ago

To me it obviously isn't because MySQL works fine for me. Everything loads, everything works just fine.

thomas-pns commented 3 years ago

Hello, @FPtje for me the SQL database is not working, I have the same error as @gmanc2, I installed a libmysqlclient.so at the root of me ServerFiles and I will install in garrysmod / lua / bin ( I create the bin directory) gmsv_mysqloo_linux64.dll, do you have an answer to this problem? image image image

FPtje commented 3 years ago

MySQLite itself should load with DarkRP, even when MySQL itself isn't installed or doesn't work. There must be an earlier error than the one in your last screenshot that would prevent MySQLite from loading.

I have to ask, did you happen to use FileZilla to copy over the DarkRP folder to your server?

thomas-pns commented 3 years ago

I use MobaXterm for connect to my VPS ovh and i install darkrpmodification for connect at my database and your gamemode DarkRP

FPtje commented 3 years ago

Guessing FileZilla was a longshot. I think DarkRP is not installed correctly, or some addon breaks it. You should see some earlier errors while the server is starting up or loading a map.

thomas-pns commented 3 years ago

I have deactivated all the addons and I still have the same error, sorry to disturb you image the end we don't see :

[ERROR] gamemodes/darkrp/gamemode/init.lua:112: attempt to index global 'MySQLite' (a nil value)

  1. unknown - gamemodes/darkrp/gamemode/init.lua:112

Couldn't Load Init Script: 'darkrp/gamemode/init.lua'

FPtje commented 3 years ago

That error is much clearer: it fails to load the MySQLOO module, which means it's either the wrong version or not installed properly.

thomas-pns commented 3 years ago

thanks