Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SQLITE_BUSY The database file is locked (database is locked) #86

Open
TNTUP opened this issue Dec 16, 2021 · 42 comments
Open

[BUG] SQLITE_BUSY The database file is locked (database is locked) #86

TNTUP opened this issue Dec 16, 2021 · 42 comments
Assignees
Labels
bug Fault in the plugin v7

Comments

@TNTUP
Copy link

TNTUP commented Dec 16, 2021

DO NOT ERASE THE TEMPLATE

FIRST-HAND CHECK - ARE YOU USING THE LATEST VERSION/SNAPSHOT OF HEADSPLUS? Have you checked to see if others have submitted the same bug report?

State here when you have checked the following points above.

Description of the bug

[0 02:42:37 WARN]: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
[0 02:42:37 WARN]: at org.sqlite.core.DB.newSQLException(DB.java:1012)
[0 02:42:37 WARN]: at org.sqlite.core.DB.newSQLException(DB.java:1024)
[0 02:42:37 WARN]: at org.sqlite.core.DB.execute(DB.java:863)
[0 02:42:37 WARN]: at org.sqlite.core.DB.executeUpdate(DB.java:904)
[0 02:42:37 WARN]: at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:98)
[0 02:42:37 WARN]: at HeadsPlus-7.0.2.jar//io.github.thatsmusic99.headsplus.sql.StatisticsSQLManager.addToTotalSync(StatisticsSQLManager.java:350)
[0 02:42:37 WARN]: at HeadsPlus-7.0.2.jar//io.github.thatsmusic99.headsplus.sql.StatisticsSQLManager.lambda$addToTotal$9(StatisticsSQLManager.java:315)
[0 02:42:37 WARN]: at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
[0 02:42:37 WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101)
[0 02:42:37 WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[0 02:42:37 WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[0 02:42:37 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[0 02:42:37 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[0 02:42:37 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)

To Reproduce

Steps to reproduce the behavior:

  1. Can't tell how it happens, related to statistics
  2. ...
  3. ...

Have you been able to reproduce the bug more than once?

Maybe, yes

Expected behavior

A clear and concise description of what you expected to happen.

No errors in console

Screenshots

If applicable, add screenshots to help explain your problem.

Has a debug report been generated?

If you have a debug report, go to plugin/HeadsPlus/debug, copy your report onto pastebin or hastebin, and paste it here, but also skip to the bottom question (additional information). If you don't, fill in the information below.

Not any.

Required information

  • Server version: 1.17.1
  • HeadsPlus version: 7.0.2
  • Whether or not the plugin uses MySQL SQLite
  • Server type (e.g Spigot, Paper): Paper
  • Uses Vault: Yes
  • Any other pieces of information that may be required.

Additional information

Add any other information/notes you'd like to add at the bottom

@TNTUP TNTUP changed the title [BUG] SQLITE_BUSY [BUG] SQLITE_BUSY The database file is locked (database is locked) Dec 16, 2021
@Thatsmusic99
Copy link
Collaborator

Nice to know this error is back to haunt me. Will get on this in hopefully the next hour.

@TNTUP
Copy link
Author

TNTUP commented Dec 16, 2021

Nice to know this error is back to haunt me. Will get on this in hopefully the next hour.

Don't worry! You will squash them with your keyboard! SMASH boom fixed!

@Thatsmusic99 Thatsmusic99 added the bug Fault in the plugin label Dec 16, 2021
@Thatsmusic99
Copy link
Collaborator

Can I ask if this dev build removes the errors at all? Feel free to have an ongoing report over the next 3 days or so

@TNTUP
Copy link
Author

TNTUP commented Dec 16, 2021

I'll try checking that out this night if theres no players on XD (I think it hates plugman, never tried it yet)

EDIT: Update has been applied and I'll monitor the console for errors^^ I'll let you know after 3 days if thats fine for ya

@TNTUP
Copy link
Author

TNTUP commented Dec 19, 2021

Looks like its still persisting :<

onsole : [0 15:07:40 WARN]: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
Console : [0 15:07:40 WARN]: at org.sqlite.core.DB.newSQLException(DB.java:1012)
Console : [0 15:07:40 WARN]: at org.sqlite.core.DB.newSQLException(DB.java:1024)
Console : [0 15:07:40 WARN]: at org.sqlite.core.DB.execute(DB.java:863)
Console : [0 15:07:40 WARN]: at org.sqlite.core.DB.executeUpdate(DB.java:904)
Console : [0 15:07:40 WARN]: at org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:98)
Console : [0 15:07:40 WARN]: at HeadsPlus-7.0.3+DEV_51.jar//io.github.thatsmusic99.headsplus.sql.SQLManager.lambda$executeUpdate$0(SQLManager.java:81)
Console : [0 15:07:40 WARN]: at HeadsPlus-7.0.3+DEV_51.jar//io.github.thatsmusic99.headsplus.sql.SQLManager.syncDatabaseOperation(SQLManager.java:87)
Console : [0 15:07:40 WARN]: at HeadsPlus-7.0.3+DEV_51.jar//io.github.thatsmusic99.headsplus.sql.SQLManager.executeUpdate(SQLManager.java:80)
Console : [0 15:07:40 WARN]: at HeadsPlus-7.0.3+DEV_51.jar//io.github.thatsmusic99.headsplus.sql.StatisticsSQLManager.addToTotalSync(StatisticsSQLManager.java:350)
Console : [0 15:07:40 WARN]: at HeadsPlus-7.0.3+DEV_51.jar//io.github.thatsmusic99.headsplus.sql.StatisticsSQLManager.lambda$addToTotal$9(StatisticsSQLManager.java:315)
Console : [0 15:07:40 WARN]: at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
Console : [0 15:07:40 WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101)
Console : [0 15:07:40 WARN]: at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
Console : [0 15:07:40 WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
Console : [0 15:07:40 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
Console : [0 15:07:40 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
Console : [0 15:07:40 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)

@Thatsmusic99
Copy link
Collaborator

:( alright, will check it tomorrow, my dumbass waited 3 and a half hours for this zip file to upload just for it to get corrupted halfway through

@TNTUP
Copy link
Author

TNTUP commented Dec 20, 2021

:( alright, will check it tomorrow, my dumbass waited 3 and a half hours for this zip file to upload just for it to get corrupted halfway through

Oh noes :( Take care and no rush, take your time! Also happy holidays!!

@Thatsmusic99
Copy link
Collaborator

Do you have a full log file for when this occurred (e.g. latest.log)? Happy holidays to you too!

@TNTUP
Copy link
Author

TNTUP commented Dec 20, 2021

Do you have a full log file for when this occurred (e.g. latest.log)? Happy holidays to you too!

It happens sometimes, can't tell how to reproduce it. I did a quick check and its the same stacktrace as I posted above. I think this is harmless but can't tell if there's loss (statistics related?)

Maybe better using MySQL? Maybe but that won't solve the issue for SQLite users =S

@Thatsmusic99
Copy link
Collaborator

There is definitely loss involved, some sort of connection isn't closing properly and that's causing the error, hence I asked for a full log file in case there's a reason why it happens.

@TNTUP
Copy link
Author

TNTUP commented Dec 20, 2021

latest-thatsmusicIsAwesome.log

Here ya go ;)

@Thatsmusic99
Copy link
Collaborator

Ohhh boy, there's a lot I would've missed if I didn't get that, the error stays the same but the stacktrace differs occasionally which is the useful bit. Cheers!

@Thatsmusic99
Copy link
Collaborator

Appreciate the ego stretch btw

@TNTUP
Copy link
Author

TNTUP commented Dec 20, 2021

Appreciate the ego stretch btw

xDDDD Damn I like your humor

@Thatsmusic99
Copy link
Collaborator

Another dev build went through for this, do you want to check for the errors with it? (https://ci.pluginwiki.us/job/HeadsPlus/54/artifact/target/HeadsPlus-7.0.3+DEV_54.jar)

@TNTUP
Copy link
Author

TNTUP commented Dec 20, 2021

Another dev build went through for this, do you want to check for the errors with it? (https://ci.pluginwiki.us/job/HeadsPlus/54/artifact/target/HeadsPlus-7.0.3+DEV_54.jar)

Will try that on my next maintenance. Is it plugman-safe (?) although this isn't recommended

@Thatsmusic99
Copy link
Collaborator

Most likely no, quite frankly I wouldn't risk it

@TNTUP
Copy link
Author

TNTUP commented Dec 20, 2021

Most likely no, quite frankly I wouldn't risk it

Okie dokie! I'll let you know when it happens (3 days span)

@TNTUP
Copy link
Author

TNTUP commented Dec 21, 2021

Still persists but it threw another error (this time it generated a report which I'll upload it here^^

Sqlite: https://paste.gg/p/anonymous/f3673f4819024a5eaf0018d01c73f533
12.21.2021 07_08_22-REPORT-2.json.txt

@Thatsmusic99
Copy link
Collaborator

Seems that you're still on dev build 51 according to the debug report, build 54 is meant to fix it 👀

@TNTUP
Copy link
Author

TNTUP commented Dec 21, 2021

Seems that you're still on dev build 51 according to the debug report, build 54 is meant to fix it 👀

o_O I thought by putting the DEV54 jar would load first than DEV 51... Guess I'm the wrong x( Sorry!

@Thatsmusic99
Copy link
Collaborator

All good, I've seen a few people in my job do a similar thing so it's pretty normal to see that kind of thing happen.

@TNTUP
Copy link
Author

TNTUP commented Dec 22, 2021

@Thatsmusic99
Copy link
Collaborator

That is quite annoying - do you think you can provide a full log of this again just to make sure nothing is missed?

@TNTUP
Copy link
Author

TNTUP commented Dec 22, 2021

That is quite annoying - do you think you can provide a full log of this again just to make sure nothing is missed?

https://paste.gg/p/anonymous/fa86d53f7d3f4e23bbe3f6c4b0e99f29

@Thatsmusic99
Copy link
Collaborator

Looks like it's time to rewrite the entirety of SQL management in this plugin!

@TNTUP
Copy link
Author

TNTUP commented Dec 22, 2021

Looks like it's time to rewrite the entirety of SQL management in this plugin!

Ouch. For now this can be ignored (the sqlite busy issue) until the end of Christmas/New Year. Take a break, profit your holidays with your family^^

@Thatsmusic99
Copy link
Collaborator

Wait no that's an overreaction, my mistake. I'll do that rewrite after the holidays if it's warranted 😂 trying one more thing.

@Thatsmusic99
Copy link
Collaborator

Tried one last thing here as I noticed the error was happening in one specific place.

@TNTUP
Copy link
Author

TNTUP commented Dec 22, 2021

Tried one last thing here as I noticed the error was happening in one specific place.

Will test and report you back tomorrow or later^^

@TNTUP
Copy link
Author

TNTUP commented Dec 22, 2021

😭😭😭😭😭😭 (look at line 31482, ignore errors related to other plugins)
latestoof.log

@Thatsmusic99
Copy link
Collaborator

this plugin really that stupid huh

man if only it could tell me WHY it's locked, I'll check it the next chance I get (most likely after Christmas but I can probably get it done tomorrow)

@TNTUP
Copy link
Author

TNTUP commented Dec 22, 2021

Okie dokie, for now I'll just discard those errors, statistics isn't very important in my case tho so thats fine :P (Else I can go with mysql if needed, could use it across all servers if I want)

Happy Holidays 👯

@Thatsmusic99
Copy link
Collaborator

Thatsmusic99 commented Dec 26, 2021

It's that time again, I've rewritten the bulk of SQL which can be found here, let me know how that goes.

@TNTUP
Copy link
Author

TNTUP commented Dec 27, 2021

I'll let you know tomorrow, Github had issues this morning so I couldn't get it on time before sleeping or I forgot yesterday evening haha xD

@TNTUP
Copy link
Author

TNTUP commented Dec 29, 2021

Hey there 👋

Today I haven't seen any HeadsPlus db errors! Yippie! For a first day, I'll give it 2 more days just to be sure its 100% solved. Else if you decide to close it, I'll let you know after 2 days :)

@TNTUP
Copy link
Author

TNTUP commented Jan 2, 2022

Heya @Thatsmusic99 been over 4 days and I hope you had a great holidays :) Sure I am, no more SQLITE errors !

@Thatsmusic99
Copy link
Collaborator

Brilliant news! I will do some cleaning up later for this update and release the new version with this fix as soon as possible.

@cloakfox
Copy link

Brilliant news! I will do some cleaning up later for this update and release the new version with this fix as soon as possible.

I am just getting a few more of these kind of errors on current latest version of the plugin (7.1.5)
using paper 1.20.4
https://gist.github.com/cloakfox/22bb8406c3e80cfd748a75bcc2d17992

@Thatsmusic99 Thatsmusic99 reopened this Jul 27, 2024
@Thatsmusic99
Copy link
Collaborator

I've tried improving some of the code surrounding adding statistics from what I've learned with similar errors from AT, can I ask if this helps at all? - https://ci.pluginwiki.us/job/HeadsPlus/174/

@cloakfox
Copy link

I've tried improving some of the code surrounding adding statistics from what I've learned with similar errors from AT, can I ask if this helps at all? - https://ci.pluginwiki.us/job/HeadsPlus/174/

Hey, thanks for the quick response!

I've rebooted the server with the latest dev version and haven't seen any errors pop up so far (they where getting spammed before). It seems to be fixed! 🎉

@Thatsmusic99
Copy link
Collaborator

Awesome, I'll keep this open for another day or two just in case it reappears :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fault in the plugin v7
Projects
None yet
Development

No branches or pull requests

3 participants