-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Numeric env vars are casted to int, failing if a string is expected #2058
Comments
That's not related to MySQL's version, but with the fact that your password is in fact a number (1234). See https://github.com/shlinkio/shlink-config/blob/main/functions/functions.php#L43 I need to re-evaluate this decision, but it should work if you use a non-fully-numeric password. |
BTW, this is probably a bug introduced in Shlink 4.0.0. One thing it changes is updating to the latest major version of the database abstraction library. I suppose previous versions didn't run in strict mode, which makes integers be converted to string transparently. In strict mode it would throw an error like this instead. It's usually a good practice to define strict versions for images, as in this case you got Shlink unintentionally updated when updating mysql, making you think that was the problem. |
I can confirm this. Although the password provided in my compose doesn't show the real configured password, it actually contained just numbers. Because the Database was already created, changing the password afterwards resulted in a failed authentication. Changing the password back to the previous one with just numbers and rolling back to shlink Version 3 resolved the error. Thanks for the explanation. |
I'll keep this open, as I actually need to fix it 😅. If you want (or have to) use only numbers as the database password, it should be possible. BTW, rolling back from Shlink 4.x to 3.x might not be a great idea, as it has applied a bunch of database migrations that have left the database in an incompatible way with Shlink 3.x. You'll run into issues, probably when trying to create a new short URL, and definitely in case you are using device-specific long urls. |
I have just released Shlink 4.0.3, which fixes this. You should be able to use numeric database credentials for the database with that version. |
Shlink version
4.0.2
PHP version
8.3.0
How do you serve Shlink
Docker image
Database engine
MySQL
Database version
8.3.0
Current behavior
Everything worked fine for weeks until I upgraded the mysql Database Image from 8.0 to the current Version 8.3. The Database starts up normally but the normal Shlink instance didn't. The following log shows the last outputs from the Shlink Container after startup with the verbosity env set to 3.
Expected behavior
A normal startup just like before.
Minimum steps to reproduce
The text was updated successfully, but these errors were encountered: