-
Notifications
You must be signed in to change notification settings - Fork 12
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
Silent mode on 1.19.0+ and MySQL may fail #849
Comments
Here's just a little more context: FA and the database are both run as Docker containers. If I manually connect to the fusionauth database using the same credentials used in the docker compose files ( |
@markschmid is this a single node configuration of FusionAuth? |
@robotdan Yes, it's a single node configuration on Docker. These are the env vars that are used:
|
I think this is likely the same issue as #857. If it is, the lock failure is a side effect of the driver not being loaded in time. Here is the stack trace from issue #857
I was able to recreate this one, and there is a case where we attempt to lock the database before we have downloaded the MySQL driver. So the root cause is the driver is not found. |
Closing for now, I think this is the same root issue as #857 . If we encounter it again, we can re-open. |
I can confirm: it now works. Upgraded from 1.18.8 to 1.19.6 without any hassle. Thanks. |
hey @robotdan, sorry to comment on a closed issue but just triple checking... I am having the same issue (Unable to capture database lock) on 1.19.8, the only difference is that I am trying to connect to a postgresql instance. Just wondering if it is possible that the fix was only for mysql? No idea really how it was fixed in the end. Thanks! |
@acatalina not sure, please open a new issue and provide any debug information you have. Thanks! |
Oh, cool, cheers. I'll investigate a little bit further and create an issue. Thanks! |
Facing same issue with Postgresql as JDBC connection 2021-11-25 12:12:55.513 PM ERROR com.inversoft.maintenance.db.DatabaseSilentModeWorkflowTask - Encountered an error while running silent mode |
Since we closed this one out and it was originally for MySQL, @whizzygeeks can you open a new issue please. Then add as many details as possible, such as what version of Postgres, what platform (Linux, Windows, macOS, AWS, Azure, etc), more details the better. Thanks! |
I have the same issue using latest docker image and trying to connect to PostgreSQL 12 on GCP Cloud SQL |
Thanks for the update @Mistic92 , re-opening. Still not sure how to debug this one though. We are essentially using the same strategy that Google Flyway (now managed by RedGate it appears) uses for db cross node locking. Perhaps we need to see if they are any fixes or changes in their strategy since we first built this. https://github.com/flyway/flyway/ It think this is the PostgreSQL locking code in FlyWay. Here is essentially what we are doing in MySQL and PostgreSQL respectively.
If we take an exception in either of these cases, we'll throw this:
|
The stack trade from @whizzygeeks looks like a different issue. It has this line:
This implies that the password for the "root" user is invalid. If you have defined a "root" user, then we will use that when attempting to capture the lock of the entire database. If you don't define a "root" user, then we will use the "ordinary" user to attempt to lock the database. Can you all provide snippets of your configuration files and environment variables specifically around the database configuration? This will help us identify if the issue is configuration or implementation. |
Facing the same issue as @whizzygeeks. Got this exception during upgrade from 1.30.2 to 1.32.1. Rolling back to 1.30.2 fix the issue. |
@endyrocket can you provide the stack trace of you have it, the version of Postgres and where it is running (local, GCP, RDS, etc) Thanks! |
Moved to new issue: #1762 Linking the 2 since many people seem to be having the same problem. |
This still happens, Postgres 14.2 |
Silent mode on 1.19.0+ and MySQL may fail
Description
It is unclear if this is a bug in FusionAuth or the db configuration.But a user expererienced the following after updating to 1.19.1.
In version >= 1.19.0 we support silent mode db upgrades even when using runtime mode
production
. This allows FusionAuth optionally handle the db schema updates even in a production multi-node environment.In MySQL we do this with a db lock, obtained using the following statement:
This MySQL function has been around at least since 5.6, I didn't look at older documentation. In this case the user is on version
8.0.21
.https://dev.mysql.com/doc/refman/8.0/en/locking-functions.html#function_get-lock
We throw the
IllegalStateException
because theSELECT
statement did not return a result, or the result was not equal to1
.Affects versions
1.19.0+
Steps to reproduce
Using MySQL
Update from pre 1.19.0 to 1.19.0 or 1.19.1 using silent mode in runtime mode for
development
orproduction
. If inproduction
runtime mode you'll need to also explicitly enable silent mode by using environment variableFUSIONAUTH_APP.SILENT_MODE=true
or addingfusionaut-app.silent-mode=true
to yourfusionauth.properties
file.Expected behavior
No error, for the db lock to work.
Platform
MySQL version 8.0.21
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: