fix: server creation error handling#1347
Open
MrWeez wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent HTTP 500s and improve UX when a server record exists locally but was not successfully created on Pterodactyl (e.g., missing pterodactyl_id / identifier), by hardening controller/view behavior and adjusting provisioning failure handling.
Changes:
- Update the servers index UI to display provisioning/reconciliation/failed states and gracefully handle missing location/node/nest/egg fields.
- Add guards in
ServerControllerto skip Pterodactyl calls and block certain actions whenpterodactyl_idis missing. - Refactor
ServerCreationServiceandReconcileServerCreationJobfailure paths to delete/refund on confirmed “not created” scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| themes/default/views/servers/index.blade.php | Render servers even when some remote metadata is missing; add status badges and disable actions when identifiers are missing. |
| app/Services/ServerCreationService.php | Restructure create-server response handling; treat some Pterodactyl errors as permanent failures with refund/delete behavior. |
| app/Jobs/ReconcileServerCreationJob.php | Change confirmed-404 reconciliation behavior from “mark failed” to “delete + refund”. |
| app/Http/Controllers/ServerController.php | Avoid Pterodactyl API calls/actions when pterodactyl_id is missing; update store flow messaging for reconciliation state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Quick and simple fix to the servers without pterodactyl_id assigned (for example if server creation failed for some reason) caused HTTP 500 on servers. This PR improves error handling coming from pterodactyl, as well as improves user interaction if server creation failed (he will be notified about server status, an will be able to contact admins to resolve the problem from their end)
Type of Change
Testing
Server creation tested with conditions when:
AI Assistance
Checklist
developmentbranchLegal
By submitting this pull request, I confirm that my contribution is made
under the terms of the project's
Contributor License Agreement
and that I have read and agree to the
Code of Conduct.