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
Comixed isn't starting anymore (Tomcat won't start) #109
Comments
@Dunuin I've seen this in my day job as well. The issue is that the database management code thinks someone else is updating the database (that's the "Could not acquire change log lock" message you're seeing). So to fix it you'll want to:
This should release the lock and let you then start your server. |
Does the h2 jar version matter?
CX appears to use .197, every time I tried using a newer version to query the database it caused CX issues.
… On 7/01/2020, at 12:44, Darryl L. Pierce ***@***.***> wrote:
@Dunuin I've seen this in my day job as well. The issue is that the database management code thinks someone else is updating the database (that's the "Could not acquire change log lock" message you're seeing).
So to fix it you'll want to:
Make sure your CX instance is not running or trying to start. This makes sure the database isn't locked at all.
Download the liquibase jar file from here.
Download the H2 JAR file from here.
Copy the h2.*.jar file out of the H2 extraction directory into the lib directory for liquibase.
From the liquibase directory execute the following (assuming you're on WIndows):
liquibase --url jdbc:h2:c:\users\[yourname]\.comixed releaseLocks
This should release the lock and let you then start your server.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
The H2 JAR I just used was from 3/13/2019, v1.4.199, and it didn't have an issue. What sort of issue did you see? |
I forget exactly - but I was running SQL against the CX db...CX then refused to play nice.
Google eventually led me to change the H2 jar, and it’s been fine since.
I’ll look into it again later, as it’s probably something that needs to be captured - assuming it’s an actual issue and not user error.
… On 7/01/2020, at 12:53, Darryl L. Pierce ***@***.***> wrote:
The H2 JAR I just used was from 3/13/2019, v1.4.199, and it didn't have an issue. What sort of issue did you see?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@bareheiny Even if it's user error, we should capture it here so someone else can refer to the solution you found. |
Sorry, replied to the e-mail notification thinking it was from the mailing list. Right-o, so attempting to access the CX database via the H2 Console results in this error: “General error: "java.lang.IllegalStateException: Unable to read the page at position ...” Note that this is at the connection stage...so there has been no opportunity for me to access the tables, let alone modify them or their content in a manner that causes corruption.. Google led me to a discussion around similar issues when attempting to use H2 1.4.200 to access a database created with H2 1.4.199. For CX, it appears that the 1.4.197 jar is required, as I can access, query and modify the CX database via SQL with that version of the driver. After attempting to connect to the database using H2 1.4.200 (as far as I can tell, this is the current version) my CX database is now corrupt. Launching CX results in this error: “org.h2.jdbc.JdbcSQLException: Row {1} not found in primary index "PUBLIC.SYS_DATA: 90496" [90143-197]” So, long story short...users should not try to access the CX database via SQL unless they have the H2. 1.4.197 jar. Of course, this could lead to serious issues if the dependency in CX changes to a newer version of the H2 driver. Maybe. |
@bareheiny Ah, that would make sense if the newer version of H2 updated the database file to a state that's not backwards compatible. Though ultimately I think my answer is, in this scenario, don't do that and if you do you void your warranty. 😄 |
@Dunuin Can you verify if this is still an issue for you, or can you close this ticket if it's not? |
@Dunuin Closing this ticket due to lack of response. I'm going to assume things are working now, but please feel free to re-open this is it's still an issue for you. |
Its still the same problem. Database is locking, I don't know how to unlock it because it is running inside the docker container so I have no idea how do add the H2 JAR or run the "liquibase --url jdbc:h2:c:\users[yourname].comixed releaseLocks". Then I delete the DB to start from scratch. I setup new accounts, import some comics and after a time the DB get locked again. Here for example is a log where I first wasn't able to start ComiXed because the DB was locked. Then I deleted the DB, started CX again. Setup stuff, tried to import 11 comics (didn't worked). Then I stopped the docker container, started it and DB was locked again. :( Would be really great if there would be argument to force unlocking of the DB or if the DB could unlock if someone places a "unlock_db.txt" next to the DB files or something like that. Edit: |
@Dunuin The only way I can think of that the DB would get locked is if , for some reason, the contain is shutdown during the time that the server has the lock to check for unrun migrations. After Liquibase (or schema manager) finishes, it unlocks the database and doesn't lock it again. What version of CX are you running in the container? And did you by any chance use the new container setup that lets you put the database outside of the container (this is the best option)? If the DB is outside of the container, then you can run the unlock command above on the file if it gets locked on you. That all said, I think it would be a good thing to include an unlock script as a part of the release binary. |
I'm using "comixed/comixed:latest" so its CX version "comixed-release-0.10.5-1.0". Database is stored on a persistent volume of the docker host (/var/lib/docker/volumes/ComiXed_db/_data) and that gets mapped inside the CX docker container to "/root/.comixed". So I can access the folder storing the DB from the docker host I'm just not sure how to run code or install something inside the CX docker container. |
@Dunuin Okay, then for now you should be able to unlock the DB using:
If you were to recreate your container, you could use something like what's described in the wiki to put the database in a better spot: https://github.com/comixed/comixed/wiki/Docker I've worked up a more flexible solution for the next release (0.11) that will make like much easier when these situations pop up. Follow #1077 to see what goes on there. With this new tool you'll be able to pass it the same arguments as used to launch the app to unlock the database without needing an external tool. |
Describe the bug
Latest comixed Prerelease isn't able to start. See the log, Tomcat refuses to start:
The text was updated successfully, but these errors were encountered: