PreciousStones - Back under the development of phaed

Discussion in 'Inactive/Unsupported Plugins' started by aPunch, Apr 20, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    aPunch

    Ryannober, Avous and kahlilnc like this.
  2. Offline

    phaed

    Replacing the ids on the DB is not gonna change the blocks on the world that to the new type. All that will do is make the DB data not match with whats present in the world and on next server restart those DB records will be cleaned up and deleted by the orphan catcher process.

    You're other plugins are using the old way of using MySQL, which is using their own instance of MySQL per plugin and hand writing all the SQL. PreciousStones uses Bukkit's global persistence system (ebeans) which is shared amongst all plugins who choose to use it. PreciousStones is not the only plugin using this, it is being used by all new plugins. If you configure it correctly for one, the rest will automatically work.

    Code:
    2011-05-11 18:16:25 [INFO] Can not test connection as heartbeatsql is not set
    This is basically bukkit trying to connect to your MySQL server and not finding a connection. You *must* have bukkit.yml misconfigured :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  3. Offline

    Nananea

    The bukkit.yml is correct now and not throwing errors. I'll report what you said to the host though and see what they say. Thank you for helping me troubleshoot it phaed, I really appreciate it. It sounds like their ebeans isn't configured properly. I see an ebeans.properties in the root folder, but it has nothing inside, just a blank file. Is that correct?
     
  4. Offline

    Ryannober

    Code:
    2011-05-13 05:06:36 [SEVERE] Error: Error executing stmt[alter table allowed_players add constraint fk_allowed_players_field_1 foreign key (field_id) references fields (id)] error[[SQLITE_ERROR] SQL error or missing database (near "constraint": syntax error)] loading PreciousStones v4.0.1 (Is it up to date?)
    javax.persistence.PersistenceException: Error: Error executing stmt[alter table allowed_players add constraint fk_allowed_players_field_1 foreign key (field_id) references fields (id)] error[[SQLITE_ERROR] SQL error or missing database (near "constraint": syntax error)]
        at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerator.java:233)
        at org.bukkit.plugin.java.JavaPlugin.installDDL(JavaPlugin.java:253)
        at net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones.setupDatabase(Unknown Source)
        at net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones.onEnable(Unknown Source)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:336)
        at com.earth2me.essentials.commands.Commandreloadall.run(Commandreloadall.java:27)
        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:45)
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:569)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:278)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:682)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:645)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:639)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.RuntimeException: Error executing stmt[alter table allowed_players add constraint fk_allowed_players_field_1 foreign key (field_id) references fields (id)] error[[SQLITE_ERROR] SQL error or missing database (near "constraint": syntax error)]
        at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatement(DdlGenerator.java:281)
        at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatements(DdlGenerator.java:246)
        at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerator.java:224)
        ... 25 more
    Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near "constraint": syntax error)
        at org.sqlite.DB.newSQLException(DB.java:383)
        at org.sqlite.DB.newSQLException(DB.java:387)
        at org.sqlite.DB.throwex(DB.java:374)
        at org.sqlite.NativeDB.prepare(Native Method)
        at org.sqlite.DB.prepare(DB.java:123)
        at org.sqlite.PrepStmt.<init>(PrepStmt.java:42)
        at org.sqlite.Conn.prepareStatement(Conn.java:404)
        at org.sqlite.Conn.prepareStatement(Conn.java:399)
        at org.sqlite.Conn.prepareStatement(Conn.java:383)
        at com.avaje.ebeaninternal.server.lib.sql.PooledConnection.prepareStatement(PooledConnection.java:426)
        at com.avaje.ebeaninternal.server.lib.sql.PooledConnection.prepareStatement(PooledConnection.java:396)
        at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatement(DdlGenerator.java:271)
        ... 27 more
    
    Do you know what could of caused this? When in game i try to do something but all it says is /ps help - help commands for Precious Stones
     

    Attached Files:

  5. Offline

    phaed

    Give me some context. This is happening the first time you loaded it? Have you already had pstones 4.x loaded before? Have the tables already been created? Or is this happening the first time its trying to create the tables? Give me the whole story of this error, how did it come to be.

    Yes ebeans.properties is not being really used for anything that I know of.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  6. Offline

    NEO

    @phaed

    I am getting the same thing, heartbeat.sql is not set when i use /ps save. Ive looked over my bukkit.yml and everything seems fine.

    Code:
    database:
        username: usernamehere
        isolation: SERIALIZABLE
        driver: org.sqlite.JDBC
        password: passwordhere
        url: jdbc:mysql://localhost/minecraft
     
  7. Offline

    phaed

    Hmm odd, can you post the whole exception on a code box to see it? Have you tried deleting the tables and running it again so it can recreate them?
     
  8. Offline

    NEO

    I,ll delete the tables now and post with the result when my server restarts.

    Code:
    2011-05-13 02:00:41 [INFO] Can not test connection as heartbeatsql is not set
    2011-05-13 02:00:41 [INFO] Closing Connection[PreciousStones.0] psReuse[2] psCreate[2] psSize[2]
    2011-05-13 02:00:41 [INFO] Can not test connection as heartbeatsql is not set
    2011-05-13 02:00:41 [INFO] Closing Connection[PreciousStones.1] psReuse[2] psCreate[3] psSize[3]
    2011-05-13 02:00:41 [INFO] DataSourcePool [PreciousStones] grow; id[PreciousStones.2] busy[3] max[20]
     
  9. Offline

    phaed

    Change log
    Version 4.1.2 - by phaed
    • massive performance improvement
    • added "The Shocker" and "Creature Repeller" pstones
    • added /ps setradius. now you can define the height of any field in-game (must be lower than configured radius)
    • added /ps setheight. now you can define the height of any field in-game (must be lower than configured height)
    • added /ps setvelocity for launchers/cannons. now you can define how high they go per stone in-game (must be lower than configured radius)
    • updated the default skycannon and mine pstone to have radius of 0 and extra-height of 1 so they only work when you step directly above them
    WARNING - READ BEFORE UPDATING from 4.0.x
     
  10. Offline

    Joy

    Thanks for the update :)

    phaed: any chance of getting any sort of command or config option to enable blacklisting players, or something like that? We want any player to be able to use placed cannons/launchers and such, without having to whitelist hundreds of people manually.

    Would be great!
     
  11. Offline

    Aiquen

    I am trying to start PS for first time... first lines of error are:
    Code:
    2011-05-13 10:55:55 [INFO] executing 1 of 14 create table ps_allowed_players ( id                        bigint primary key,...
    2011-05-13 10:55:55 [INFO] executing 2 of 14 create table ps_cloaked ( id                        bigint primary key, data_byt...
    2011-05-13 10:55:55 [INFO] executing 3 of 14 create table ps_fields ( id                        bigint primary key, x...
    2011-05-13 10:55:55 [INFO] executing 4 of 14 create table ps_item_stacks ( id                        bigint primary key, type...
    2011-05-13 10:55:55 [INFO] executing 5 of 14 create table ps_snitch_entries ( id                        bigint primary key, n...
    2011-05-13 10:55:55 [INFO] executing 6 of 14 create table ps_unbreakables ( id                        bigint primary key, x...
    2011-05-13 10:55:55 [INFO] executing 7 of 14 alter table ps_allowed_players add constraint fk_ps_allowed_players_field_1 fore...
    2011-05-13 10:55:55 [INFO] Can not test connection as heartbeatsql is not set
    2011-05-13 10:55:55 [INFO] Closing Connection[PreciousStones.0] psReuse[0] psCreate[7] psSize[6]
    2011-05-13 10:55:55 [INFO] DataSourcePool [PreciousStones] grow; id[PreciousStones.2] busy[3] max[20]
    and next are (and everything from his post):
     
  12. Offline

    phaed

    What does your bukkit.yml look like? You wouldn't by any chance be trying to use SQLite would you?
     
  13. Offline

    Ryannober

    I think I figured out the problem, can anyone explain how I should change my bukkit.yml from sqlite to MySQL, I'm an idiot when it comes to that.
    Thanks guys, I appreciate it

    -ryan
     
  14. Offline

    Aiquen

    I am totally trying to use sqlite.. you're not supporting that? You weren't commenting this at:
    So I thought I wouldn't care... hmm... no pm answering, no source code (but that's your choice), no flatfile (like before), no standalone mysql config, no sqlite support... sorry but... great plugin with bad support... I beseech you, could you explain me, why youre using .monitor priority at protection events? (when you both are not able to anwer me at pm) .. I do not want be ungrateful, I am just really sad, that I cant use this new version and with my plugin...
     
  15. Offline

    phaed

    I'm using monitor because it can't really trust every plugin author out there to check isCancelled. Many don't. (btw Worldguard uses monitor as well). Ill set up a public method you can use tho.

    Source code is available at my Github. The link is right under the download link.

    Ah look at that, did not notice he was using sqlite lmao. I had stated sqllite does not work. Not because I do not want to support it, but because ebeans, bukkit's built in persistence system, does not support table joins in sqlite.

    Aha problem solved, can't believe i didn't see it. You aren't using MySQL. You are using SQLite. Change the driver to mysql, and setup a mysql database. All should be good. The OP says it clearly: PreciousStones now requires MySQL

    Will do.

    PreciousStones now requires MySQL

    Make sure the driver in the bukkit.yml isn't set to use sqlite.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  16. Offline

    Kaosvf

    Hi,
    my database insn't in "localhost", how can I do?
    I receive this error: Access denied for user 'root'@'94.x.x.x(Server IP)' (using password: YES)
    The database is in another address.
     
  17. Offline

    NEO

    Well i know it requires mysql :p Ive never used bukkit.yml to configure the dozens of plugins i have that use mysql already. Usually the driver is pre set to mysql instead of sqlite.

    Thank you for the support phaed :D
     
  18. Offline

    phaed

    Unless that server is configured to allow remote MySQL connections it isn't going to work.
     
  19. Offline

    Kaosvf

    It is enabled, the problem is that i put the address of remote server and in the error that I receive it wrote ...'@'(the address of localhost, not remote host)
     
  20. Offline

    phaed

    Whats your bukkit.yml look like?
     
  21. Offline

    Kaosvf

    Code:
    database:
        username: root
        isolation: SERIALIZABLE
        driver: com.mysql.jdbc.Driver
        password: mypassword
        url: jdbc:mysql://mysql.remoteaddress.com/database_name
     
  22. Offline

    phaed

    And you're saying the error is showing your localhost's adderess,. That's very weird, could be a bug with ebeans. May want to start a thread here: http://forums.bukkit.org/forums/bukkit-help.6/
     
  23. Offline

    Aiquen

    Hmm, yes, other plugins... but, who cares? They should check event cancellation.. :) And wg is using .high (what isn't good too imo), protection should be .lowest (.low), and cancel events. Really thank you for some public (static) function...

    And GitHub? It's posting 404 for about last 10 days to me... (with little jawa, or what is that xD)
     
  24. Offline

    LSky

    My server crashed when I reloaded an unrelated plugin, since then it will not start up pstones any more;

    2011-05-13 20:26:27 [INFO] DataSourcePool [PreciousStones] autoCommit[false] transIsolation[SERIALIZABLE] min[2] max[20]
    2011-05-13 20:26:32 [SEVERE] FATAL: DataSourcePool [PreciousStones] is down!!!
    2011-05-13 20:26:32 [INFO] Reseting DataSourcePool [PreciousStones] min:2 max:20 free:0 busy:0 waiting:0 highWaterMark:0 waitCount:0 hitCount:0
     
  25. Offline

    Zane B.

    what's wrong?

    Code:
    13:41:31 [INFO] Can not test connection as heartbeatsql is not set
    13:41:31 [INFO] Closing Connection[PreciousStones.1] psReuse[0] psCreate[1] psSi
    ze[0]
    13:41:31 [INFO] Installing database for PreciousStones due to first time usage
    13:41:31 [INFO] runScript
    13:41:31 [INFO] executing 1 of 14 create table ps_allowed_players ( id
                  bigint primary key,...
    13:41:31 [INFO] executing 2 of 14 create table ps_cloaked ( id
          bigint primary key, data_byt...
    13:41:31 [INFO] executing 3 of 14 create table ps_fields ( id
         bigint primary key, x...
    13:41:31 [INFO] executing 4 of 14 create table ps_item_stacks ( id
              bigint primary key, type...
    13:41:31 [INFO] executing 5 of 14 create table ps_snitch_entries ( id
                 bigint primary key, n...
    13:41:31 [INFO] executing 6 of 14 create table ps_unbreakables ( id
               bigint primary key, x...
    13:41:31 [INFO] executing 7 of 14 alter table ps_allowed_players add constraint
    fk_ps_allowed_players_field_1 fore...
    13:41:31 [INFO] Can not test connection as heartbeatsql is not set
    13:41:31 [INFO] Closing Connection[PreciousStones.0] psReuse[0] psCreate[7] psSi
    ze[6]
    13:41:31 [INFO] DataSourcePool [PreciousStones] grow; id[PreciousStones.2] busy[
    3] max[20]
    13:41:31 [SEVERE] Error: Error executing stmt[alter table ps_allowed_players add
     constraint fk_ps_allowed_players_field_1 foreign key (field_id) references ps_f
    ields (id)] error[[SQLITE_ERROR] SQL error or missing database (near "constraint
    ": syntax error)] loading PreciousStones v4.1.2 (Is it up to date?)
    javax.persistence.PersistenceException: Error: Error executing stmt[alter table
    ps_allowed_players add constraint fk_ps_allowed_players_field_1 foreign key (fie
    ld_id) references ps_fields (id)] error[[SQLITE_ERROR] SQL error or missing data
    base (near "constraint": syntax error)]
            at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerato
    r.java:233)
            at org.bukkit.plugin.java.JavaPlugin.installDDL(JavaPlugin.java:253)
            at net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones.setupDatabase
    (PreciousStones.java:154)
            at net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones.onEnable(Prec
    iousStones.java:85)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:676)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:249)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:260)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.RuntimeException: Error executing stmt[alter table ps_allow
    ed_players add constraint fk_ps_allowed_players_field_1 foreign key (field_id) r
    eferences ps_fields (id)] error[[SQLITE_ERROR] SQL error or missing database (ne
    ar "constraint": syntax error)]
            at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatement(DdlGener
    ator.java:281)
            at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatements(DdlGene
    rator.java:246)
            at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runScript(DdlGenerato
    r.java:224)
            ... 13 more
    Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (
    near "constraint": syntax error)
            at org.sqlite.DB.newSQLException(DB.java:383)
            at org.sqlite.DB.newSQLException(DB.java:387)
            at org.sqlite.DB.throwex(DB.java:374)
            at org.sqlite.NativeDB.prepare(Native Method)
            at org.sqlite.DB.prepare(DB.java:123)
            at org.sqlite.PrepStmt.<init>(PrepStmt.java:42)
            at org.sqlite.Conn.prepareStatement(Conn.java:404)
            at org.sqlite.Conn.prepareStatement(Conn.java:399)
            at org.sqlite.Conn.prepareStatement(Conn.java:383)
            at com.avaje.ebeaninternal.server.lib.sql.PooledConnection.prepareStatem
    ent(PooledConnection.java:426)
            at com.avaje.ebeaninternal.server.lib.sql.PooledConnection.prepareStatem
    ent(PooledConnection.java:396)
            at com.avaje.ebeaninternal.server.ddl.DdlGenerator.runStatement(DdlGener
    ator.java:271)
            ... 15 more
     
  26. Offline

    Nananea

    You're using SQLite instead of MySQL
     
    Tungsten likes this.
  27. Offline

    Zane B.

    well wth, half my plugins use SQLite, half use MySQL, i have both though, how should i set up my bukkit.yml, currently is
    Code:
    database:
        username: bukkit
        isolation: SERIALIZABLE
        driver: org.sqlite.JDBC
        password: walrus
        url: jdbc:sqlite:{DIR}{NAME}.db
     
  28. Offline

    phaed

    I care when its PStone protection that stops working not their plugins.

    https://github.com/phaed420/PreciousStones

    You may be out of luck. Changing your other plugins to MySQL is the only solution I can think of. Ask your question here: http://forums.bukkit.org/forums/bukkit-help.6/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  29. Offline

    Zane B.

    well the only plugin i use that runs sqlite is minecart mania, i think? everytime i switch the bukkit.yml it gives me an error for minecart mania

    can u send me your mysql.jar? maybe mine is not updated or somthin
     
  30. Offline

    phaed

    Have you created an MySQL database prior to switching the bukkit.yml?
     
  31. Offline

    Zane B.

    mysql.db, nope.

    is there an older version that is flatfile?

    Ok i got it, i just used the current PreciousStones folder and an older flatfile version my friend gave me

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
Thread Status:
Not open for further replies.

Share This Page