Skip to content

fix: server creation error handling#1347

Open
MrWeez wants to merge 5 commits into
Ctrlpanel-gg:developmentfrom
MrWeez:fix/no-ptero-id
Open

fix: server creation error handling#1347
MrWeez wants to merge 5 commits into
Ctrlpanel-gg:developmentfrom
MrWeez:fix/no-ptero-id

Conversation

@MrWeez
Copy link
Copy Markdown
Collaborator

@MrWeez MrWeez commented May 8, 2026

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

  • Bug fix
  • New feature
  • Breaking change
  • Refactor / code quality
  • Documentation
  • Other:

Testing

Server creation tested with conditions when:

  • required variable isn't set
  • pterodactyl was offline
  • pterodactyl returns 500

AI Assistance

  • I used AI tools to assist with this contribution

Checklist

  • My PR targets the development branch
  • Commit messages follow Conventional Commits
  • Code follows PSR-12
  • I have reviewed my own code
  • I have tested all affected functionality
  • No new warnings or errors introduced

Legal

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ServerController to skip Pterodactyl calls and block certain actions when pterodactyl_id is missing.
  • Refactor ServerCreationService and ReconcileServerCreationJob failure 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.

Comment thread app/Services/ServerCreationService.php
Comment thread app/Services/ServerCreationService.php Outdated
Comment thread app/Services/ServerCreationService.php
Comment thread app/Services/ServerCreationService.php Outdated
Comment thread app/Jobs/ReconcileServerCreationJob.php
Comment thread app/Jobs/ReconcileServerCreationJob.php
Comment thread app/Http/Controllers/ServerController.php
Comment thread themes/default/views/servers/index.blade.php Outdated
Comment thread themes/default/views/servers/index.blade.php Outdated
@MrWeez MrWeez marked this pull request as ready for review May 12, 2026 22:24
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