prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [BUG] basic-auth init on remote database
  ### Describe the problem
  
  Same issue #9399 happened when trying to initialize database which invokes this function [migrate_if_needed](https://github.com/mlflow/mlflow/blob/master/mlflow/server/auth/db/utils.py#L30)
  
  Suggestion: Apply the same fix #9410 to force SqlAlchemy to render unobfuscated url
  
  ### Suggestion
  ```
  alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))
  ```
  
  ### What component(s) does this bug affect?
  
  - [ ] `area/artifacts`: Artifact stores and artifact logging
  - [ ] `area/build`: Build and test infrastructure for MLflow
  - [ ] `area/docs`: MLflow documentation pages
  - [ ] `area/examples`: Example code
  - [ ] `area/gateway`: AI Gateway service, Gateway client APIs, third-party Gateway integrations
  - [ ] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for Model Registry
  - [ ] `area/models`: MLmodel format, model serialization/deserialization, flavors
  - [ ] `area/recipes`: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  - [ ] `area/projects`: MLproject format, project running backends
  - [ ] `area/scoring`: MLflow Model server, model deployment tools, Spark UDFs
  - [X] `area/server-infra`: MLflow Tracking server backend
  - [ ] `area/tracking`: Tracking Service, tracking client APIs, autologging
  
  ### What interface(s) does this bug affect?
  
  - [ ] `area/uiux`: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  - [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  - [X] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry
  - [ ] `area/windows`: Windows support
  
  ### What language(s) does this bug affect?
  
  - [ ] `language/r`: R APIs and clients
  - [ ] `language/java`: Java APIs and clients
  - [ ] `language/new`: Proposals for new client languages
  
  ### What integration(s) does this bug affect?
  
  - [ ] `integrations/azure`: Azure and Azure ML integrations
  - [ ] `integrations/sagemaker`: SageMaker integrations
  - [ ] `integrations/databricks`: Databricks integrations
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mlflow/server/auth/db/utils.py`
  Content:
  ```
  1 from pathlib import Path
  2 
  3 from alembic.command import upgrade
  4 from alembic.config import Config
  5 from alembic.migration import MigrationContext
  6 from alembic.script import ScriptDirectory
  7 from sqlalchemy.engine.base import Engine
  8 
  9 
  10 def _get_alembic_dir() -> str:
  11     return Path(__file__).parent / "migrations"
  12 
  13 
  14 def _get_alembic_config(url: str) -> Config:
  15     alembic_dir = _get_alembic_dir()
  16     alembic_ini_path = alembic_dir / "alembic.ini"
  17     alembic_cfg = Config(alembic_ini_path)
  18     alembic_cfg.set_main_option("script_location", str(alembic_dir))
  19     alembic_cfg.set_main_option("sqlalchemy.url", url)
  20     return alembic_cfg
  21 
  22 
  23 def migrate(engine: Engine, revision: str) -> None:
  24     alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))
  25     with engine.begin() as conn:
  26         alembic_cfg.attributes["connection"] = conn
  27         upgrade(alembic_cfg, revision)
  28 
  29 
  30 def migrate_if_needed(engine: Engine, revision: str) -> None:
  31     alembic_cfg = _get_alembic_config(str(engine.url))
  32     script_dir = ScriptDirectory.from_config(alembic_cfg)
  33     with engine.begin() as conn:
  34         context = MigrationContext.configure(conn)
  35         if context.get_current_revision() != script_dir.get_current_head():
  36             upgrade(alembic_cfg, revision)
  37
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mlflow/server/auth/db/utils.py b/mlflow/server/auth/db/utils.py
  --- a/mlflow/server/auth/db/utils.py
  +++ b/mlflow/server/auth/db/utils.py
  @@ -28,7 +28,7 @@
   
   
   def migrate_if_needed(engine: Engine, revision: str) -> None:
  -    alembic_cfg = _get_alembic_config(str(engine.url))
  +    alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))
       script_dir = ScriptDirectory.from_config(alembic_cfg)
       with engine.begin() as conn:
           context = MigrationContext.configure(conn)
  
verification_info: {"golden_diff": "diff --git a/mlflow/server/auth/db/utils.py b/mlflow/server/auth/db/utils.py\n--- a/mlflow/server/auth/db/utils.py\n+++ b/mlflow/server/auth/db/utils.py\n@@ -28,7 +28,7 @@\n \n \n def migrate_if_needed(engine: Engine, revision: str) -> None:\n-    alembic_cfg = _get_alembic_config(str(engine.url))\n+    alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))\n     script_dir = ScriptDirectory.from_config(alembic_cfg)\n     with engine.begin() as conn:\n         context = MigrationContext.configure(conn)\n", "issue": "[BUG] basic-auth init on remote database\n### Describe the problem\r\n\r\nSame issue #9399 happened when trying to initialize database which invokes this function [migrate_if_needed](https://github.com/mlflow/mlflow/blob/master/mlflow/server/auth/db/utils.py#L30)\r\n\r\nSuggestion: Apply the same fix #9410 to force SqlAlchemy to render unobfuscated url\r\n\r\n### Suggestion\r\n```\r\nalembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))\r\n```\r\n\r\n### What component(s) does this bug affect?\r\n\r\n- [ ] `area/artifacts`: Artifact stores and artifact logging\r\n- [ ] `area/build`: Build and test infrastructure for MLflow\r\n- [ ] `area/docs`: MLflow documentation pages\r\n- [ ] `area/examples`: Example code\r\n- [ ] `area/gateway`: AI Gateway service, Gateway client APIs, third-party Gateway integrations\r\n- [ ] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for Model Registry\r\n- [ ] `area/models`: MLmodel format, model serialization/deserialization, flavors\r\n- [ ] `area/recipes`: Recipes, Recipe APIs, Recipe configs, Recipe Templates\r\n- [ ] `area/projects`: MLproject format, project running backends\r\n- [ ] `area/scoring`: MLflow Model server, model deployment tools, Spark UDFs\r\n- [X] `area/server-infra`: MLflow Tracking server backend\r\n- [ ] `area/tracking`: Tracking Service, tracking client APIs, autologging\r\n\r\n### What interface(s) does this bug affect?\r\n\r\n- [ ] `area/uiux`: Front-end, user experience, plotting, JavaScript, JavaScript dev server\r\n- [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models\r\n- [X] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry\r\n- [ ] `area/windows`: Windows support\r\n\r\n### What language(s) does this bug affect?\r\n\r\n- [ ] `language/r`: R APIs and clients\r\n- [ ] `language/java`: Java APIs and clients\r\n- [ ] `language/new`: Proposals for new client languages\r\n\r\n### What integration(s) does this bug affect?\r\n\r\n- [ ] `integrations/azure`: Azure and Azure ML integrations\r\n- [ ] `integrations/sagemaker`: SageMaker integrations\r\n- [ ] `integrations/databricks`: Databricks integrations\n", "before_files": [{"content": "from pathlib import Path\n\nfrom alembic.command import upgrade\nfrom alembic.config import Config\nfrom alembic.migration import MigrationContext\nfrom alembic.script import ScriptDirectory\nfrom sqlalchemy.engine.base import Engine\n\n\ndef _get_alembic_dir() -> str:\n    return Path(__file__).parent / \"migrations\"\n\n\ndef _get_alembic_config(url: str) -> Config:\n    alembic_dir = _get_alembic_dir()\n    alembic_ini_path = alembic_dir / \"alembic.ini\"\n    alembic_cfg = Config(alembic_ini_path)\n    alembic_cfg.set_main_option(\"script_location\", str(alembic_dir))\n    alembic_cfg.set_main_option(\"sqlalchemy.url\", url)\n    return alembic_cfg\n\n\ndef migrate(engine: Engine, revision: str) -> None:\n    alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))\n    with engine.begin() as conn:\n        alembic_cfg.attributes[\"connection\"] = conn\n        upgrade(alembic_cfg, revision)\n\n\ndef migrate_if_needed(engine: Engine, revision: str) -> None:\n    alembic_cfg = _get_alembic_config(str(engine.url))\n    script_dir = ScriptDirectory.from_config(alembic_cfg)\n    with engine.begin() as conn:\n        context = MigrationContext.configure(conn)\n        if context.get_current_revision() != script_dir.get_current_head():\n            upgrade(alembic_cfg, revision)\n", "path": "mlflow/server/auth/db/utils.py"}], "after_files": [{"content": "from pathlib import Path\n\nfrom alembic.command import upgrade\nfrom alembic.config import Config\nfrom alembic.migration import MigrationContext\nfrom alembic.script import ScriptDirectory\nfrom sqlalchemy.engine.base import Engine\n\n\ndef _get_alembic_dir() -> str:\n    return Path(__file__).parent / \"migrations\"\n\n\ndef _get_alembic_config(url: str) -> Config:\n    alembic_dir = _get_alembic_dir()\n    alembic_ini_path = alembic_dir / \"alembic.ini\"\n    alembic_cfg = Config(alembic_ini_path)\n    alembic_cfg.set_main_option(\"script_location\", str(alembic_dir))\n    alembic_cfg.set_main_option(\"sqlalchemy.url\", url)\n    return alembic_cfg\n\n\ndef migrate(engine: Engine, revision: str) -> None:\n    alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))\n    with engine.begin() as conn:\n        alembic_cfg.attributes[\"connection\"] = conn\n        upgrade(alembic_cfg, revision)\n\n\ndef migrate_if_needed(engine: Engine, revision: str) -> None:\n    alembic_cfg = _get_alembic_config(engine.url.render_as_string(hide_password=False))\n    script_dir = ScriptDirectory.from_config(alembic_cfg)\n    with engine.begin() as conn:\n        context = MigrationContext.configure(conn)\n        if context.get_current_revision() != script_dir.get_current_head():\n            upgrade(alembic_cfg, revision)\n", "path": "mlflow/server/auth/db/utils.py"}]}