Error Tracking for Backup Failure Callbacks to EasyEngine dashboard#472
Merged
mrrobot47 merged 2 commits intoEasyEngine:developfrom Dec 22, 2025
Merged
Conversation
…llbacks - Add error type constants for categorized error reporting (validation, config, filesystem, network, database, disk_space, lock, fatal, interrupted, unknown) - Add error tracking properties (message, type, code) to capture failure details - Create capture_error() method to store error information for API callbacks - Enhance dash_shutdown_handler() to auto-capture PHP fatal errors and process interruptions - Update send_dash_failure_callback() to include error details in API payload Error captures added for: - Invalid --dash-auth format (1001) - Unsupported site type (1003) - rclone not installed (2001) - rclone backend not configured (2002) - Concurrent backup process (lock file) (2003) - Insufficient disk space (3001) - Tool installation failures (2010, 2011) - rclone upload failures (4001) - PHP fatal errors (captured from error_get_last) - Process interruptions (Ctrl+C, SIGTERM, SIGKILL)
…tency - Fix indentation inconsistencies in backup functions - Change unsupported site type error code from 1003 to 1002 for consistency - Use consistent error codes for fatal errors (5001) and interruptions (6000) - Improve rclone backend error message to show actual backend name Add error captures for backup operations: - Site files archive creation failure (3002) - WordPress content archive creation failure (3002) - Nginx configuration archive creation failure (3002) - PHP configuration archive creation failure (3002) - Database dump failure (4002) - Database SQL compression failure (3002) Error code reference: - 1xxx: Validation errors (1001, 1002) - 2xxx: Configuration errors (2001, 2002, 2003, 2010, 2011) - 3xxx: Filesystem/archive errors (3001, 3002) - 4xxx: Network/database errors (4001, 4002) - 5xxx: PHP fatal errors (5001) - 6xxx: Process interruptions (6000)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive error tracking for backup failures in EasyEngine, enabling the EasyEngine dashboard to receive detailed error context (message, type, and code) when backups fail. Previously, the dashboard only knew that a backup failed without understanding the root cause.
- Adds error type constants and tracking properties to categorize failures into validation, configuration, filesystem, network, database, disk space, lock, fatal, and interrupted errors
- Implements
capture_error()method that records the first error encountered and a shutdown handler that automatically detects PHP fatal errors or interrupted processes - Updates all backup operations to capture errors before calling
EE::error(), ensuring consistent error reporting to the dashboard API
💡 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.
Overview
This PR implements comprehensive error tracking for backup failures, sending detailed error information (message, type, code) to EasyEngine dashboard API when backups fail. Previously, EasyEngine dashboard only knew that a backup failed but had no context about why it failed.
Error Code Reference for EasyEngine dashboard
Error Code Categories
Complete Error Code List
1xxx: Validation Errors
validation_errorvalidation_error2xxx: Configuration Errors
configuration_errorconfiguration_errorlock_errorconfiguration_errorconfiguration_error3xxx: Resource Errors
disk_space_errorfilesystem_errorfilesystem_errorfilesystem_errorfilesystem_errorfilesystem_error4xxx: Network & Database Errors
network_errordatabase_error5xxx: Fatal Errors
fatal_error6xxx: Process Interruptions
interrupted