Database is locked and server not showing

A new update is now available, introducing seasons and more!
  • I run a server at home from a machine on my network, i've been running this quite successfully for well over a year, but suddenly i'm getting these database locked errors....


    org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
    at org.sqlite.core.DB.newSQLException(DB.java:909)
    at org.sqlite.core.DB.newSQLException(DB.java:921)
    at org.sqlite.core.DB.throwex(DB.java:886)
    at org.sqlite.core.DB.exec(DB.java:155)
    at org.sqlite.jdbc3.JDBC3Connection.commit(JDBC3Connection.java:174)
    at y.a.a(SourceFile:314)
    at C.i.a(SourceFile:87)
    at C.a.a(SourceFile:201)
    at D.n.execute(SourceFile:39)
    at z.b.run(SourceFile:24)



    Repeated over and over again.


    I tried the server_ip, which was set to default 0.0.0.0, changed this to 127.0.0.1, the server then fails to show up in the server list.
    I changed server_ip to my DNS (as I have a dynamic ip), same result.
    Changed back to 0.0.0.0 and still won't show in the list (wtf????? mind f**k)


    Connected via internal IP address 192.168.1.??, still got the locked errors.


    Went into the worlds folder, selected and viewed properties and found it all "read only", I deselected that and found it resolved the locked database locally, but now I can't see my server in the main list.


    I don't understand why even with changing back to the original working config, my server has now disappeared :(

  • org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

    A "database locked" error indicates that the server cannot access the database file. Usually this happens when another process keeps a lock on the database (for example, another server process running in the background -> please check your task manager if there is already a java process running), or if there is a permission issue (especially on Linux make sure that the server has full permission to access the worlds folder and its content). This can also happen if the world file is corrupted, but if you didn't touch the world files, that's unlikely.


    I tried the server_ip, which was set to default 0.0.0.0, changed this to 127.0.0.1, the server then fails to show up in the server list.
    I changed server_ip to my DNS (as I have a dynamic ip), same result.

    If you bind it to 127.0.0.1, the server is only available through localhost. Usually you have to put your remote IP there, however, this doesn't work when running the server on your private machine (behind a router) - since your computer does not know your remote IP, so the server cannot bind to it. You have to leave the server_ip field blank, so the server binds to all addresses ;)

  • ^^


    I have noticed a Java related error sometimes when shutting the server down, I wonder if this is keeping the DB as read only?


    I have scripting that obtains my external IP for various other types of server I run, I tried to get that working with RW to automatically fill in the server_ip field, but it was a little tricky to do. I'll just go with blank!


    I'm also going to add an Attrib -r %RWserverpath% /s /d to my monitoring and auto restart batch script, to ensure the files are not ready only whenever the server starts.


    Hopefully this will sort it all out! :)

  • I got a db is locked the other night. All I had to do was restart the server and it was fixed.


    It does sometimes, but the problem is I can go several days without even looking at the server.


    I have another recent issue with strange errors apparently triggered by clients doing an ALT+F4 instead of disconnecting properly, server then falls over and disappears from the server list. But it's random and hard to pin point..........


    I'm now working on a way of creating a script to read the log files, pick out keywords, identify when something goes wrong and do an automated restart.... Unfortunately this is where I run out of skill, as i've never been very good at automatically parsing log file data.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!