Skip to content

Purge dynamic database connection before setting a new one - #5682

Open
Linux123123 wants to merge 1 commit into
pterodactyl:1.0-developfrom
Linux123123:fix-database-dynamic-connection
Open

Purge dynamic database connection before setting a new one#5682
Linux123123 wants to merge 1 commit into
pterodactyl:1.0-developfrom
Linux123123:fix-database-dynamic-connection

Conversation

@Linux123123

Copy link
Copy Markdown
Contributor

DynamicDatabaseConnection currently sets the database host credentials in ConfigRepository, which is not used if a connection with that name is already cached in DatabaseManager. See the code here:
https://github.com/laravel/framework/blob/ee0296f03a02b8f890c6323f18bdf4669468c0c2/src/Illuminate/Database/DatabaseManager.php#L94-L110

This issue shows up wherever it is necessary to connect to multiple database hosts one after another (for example, ServerDeletionService).

In the aforementioned ServerDeletionService, this means some databases are not deleted, and there is no error. Unwanted deletions are unlikely to happen because DROP DATABASE IF EXISTS is used, along with databases being prefixed with server ID, they will not exist on any other database hosts.

I would really suggest everyone go over the database hosts and check if there are any undeleted databases. We found around 4,000 databases that were not in the panel database table. Basically, if the server had databases from multiple hosts, only the databases from the first host would be deleted.

Credits to @barrelltitor for finding the issue.

Copilot AI review requested due to automatic review settings July 16, 2026 09:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants