-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
efbundle tries to make a connection to the OnConfiguring connection string despite using --connection parameter #27510
Comments
IIRC, The Pomelo provider needs to get the MySQL version during configuration, so yes, it connects to the database to do that. |
Hmm, never mind. Looks like |
And I provide the server version in code. So it should not have to connect.
… Le 28 févr. 2022 à 18:09, Brice Lambson ***@***.***> a écrit :
Hmm, never mind. Looks like UseMySql takes the server version now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
|
@vIceBerg We will investigate this, but please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing. At the moment, I can't get this to reproduce in projects I have tried. |
Hi! There's the project. I included a README file with the commands I used and the log it produces |
@roji to try with Pomelo. |
I am also facing the exact same issue with EF Core Bundles and Pomelo, any ETA on this @ajcvickers ? |
I have encountered this exact scenario using Pomelo and efbundle. My DbContext tries to get its connection string configuration first from appconfig, then overwrites from environment variables that match the path in appconfig. It was awkward for me to have efbundle executable require a connection parameter and contributed to my confusion when encountering this problem. |
@roji Ping. |
I pulled together a small example based on my implementation using DbContextFactory with environment variables. Hope it helps, disregard if it does not. |
@bricelam @ajcvickers @lauxjpn this repros for me for MySQL (EF Core 6.0) with @vIceBerg's repro above, but does not repro when switching to SQL Server. This does smell similar to npgsql/efcore.pg#1876 on the PG side, but the above did not repro for Npgsql. @lauxjpn at this point this does look like a MySQL-specific issue - do you want to take a look? If you need help let us know, one of us can also take a look. |
Hi!
My connection string is actually hardcoded in the OnConfiguring method of my DbContext class
OnConfiguring method
Then I use this command to generate the efbundle
When I execute the bundle on another computer with this command
The other computer does not have access to my-dev-server, so I get this error:
If I run the bundle on my-dev-server but change the database like this:
The my-dev-database-2 gets created as expected on my-dev-server
Here's the complete stack trace
I know there's issues like #26869 that talks about using empty or null connection string in the OnConfigure methods, but I cannot find any talking about making a connection to another server than the one specified in the provided command line connectionstring.
Provider and version information
dotnet version: 7.0.100-preview.1.22110.4
EF Core version: 6.02
Database provider: Pomelo.EntityFrameworkCore.MySql
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022 17.0.4
The text was updated successfully, but these errors were encountered: