An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
debug: add detailed Sentinel container processing logging
Andras Bacsai747a48b93379
diff --git a/app/Jobs/PushServerUpdateJob.php b/app/Jobs/PushServerUpdateJob.phpindex 8b3f56e146..4056bc8fdb 100644--- a/app/Jobs/PushServerUpdateJob.php+++ b/app/Jobs/PushServerUpdateJob.php@@ -110,6 +110,13 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue, Silenced$this->containers = collect(data_get($data, 'containers'));+ Log::debug('[STATUS-DEBUG] Raw Sentinel data received', [+ 'source' => 'PushServerUpdateJob',+ 'container_count' => $this->containers->count(),+ 'containers' => $this->containers->toArray(),+ ]);+ ray('Raw Sentinel containers:', $this->containers->toArray());+$filesystemUsageRoot = data_get($data, 'filesystem_usage_root.used_percentage');ServerStorageCheckJob::dispatch($this->server, $filesystemUsageRoot);@@ -146,6 +153,24 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue, Silenced$containerStatus = "$containerStatus ($containerHealth)";$labels = collect(data_get($container, 'labels'));$coolify_managed = $labels->has('coolify.managed');++ Log::debug('[STATUS-DEBUG] Processing container from Sentinel', [+ 'source' => 'PushServerUpdateJob (loop)',+ 'container_name' => data_get($container, 'name'),+ 'container_status' => $containerStatus,+ 'labels' => $labels->toArray(),+ 'has_coolify_managed' => $coolify_managed,+ ]);++ if (! $coolify_managed) {+ Log::debug('[STATUS-DEBUG] Container skipped - not coolify managed', [+ 'source' => 'PushServerUpdateJob',+ 'container_name' => data_get($container, 'name'),+ ]);++ continue;+ }+if ($coolify_managed) {$name = data_get($container, 'name');if ($name === 'coolify-log-drain' && $this->isRunning($containerStatus)) {@@ -166,6 +191,19 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue, Silenced$containerName = $labels->get('com.docker.compose.service');if ($containerName) {$this->applicationContainerStatuses->get($applicationId)->put($containerName, $containerStatus);+ Log::debug('[STATUS-DEBUG] Container added to applicationContainerStatuses', [+ 'source' => 'PushServerUpdateJob',+ 'application_id' => $applicationId,+ 'container_name' => $containerName,+ 'container_status' => $containerStatus,+ ]);+ } else {+ Log::debug('[STATUS-DEBUG] Container skipped - no com.docker.compose.service label', [+ 'source' => 'PushServerUpdateJob',+ 'container_name' => data_get($container, 'name'),+ 'application_id' => $applicationId,+ 'labels' => $labels->toArray(),+ ]);}} else {$previewKey = $applicationId.':'.$pullRequestId;@@ -224,12 +262,22 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue, Silencedprivate function aggregateMultiContainerStatuses(){+ Log::debug('[STATUS-DEBUG] Starting aggregation of multi-container application statuses', [+ 'source' => 'PushServerUpdateJob',+ ]);+ ray('Starting aggregation of multi-container application statuses');+ ray($this->applicationContainerStatuses->toArray());if ($this->applicationContainerStatuses->isEmpty()) {return;}foreach ($this->applicationContainerStatuses as $applicationId => $containerStatuses) {$application = $this->applications->where('id', $applicationId)->first();+ Log::debug('[STATUS-DEBUG] Processing application for aggregation', [+ 'source' => 'PushServerUpdateJob',+ 'app_id' => $applicationId,+ 'container_statuses' => $containerStatuses->toArray(),+ ]);if (! $application) {continue;}@@ -297,22 +345,22 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue, Silenced// All containers are exited$aggregatedStatus = 'exited (unhealthy)';}-+ Log::debug('[STATUS-DEBUG] Sentinel status change', [+ 'source' => 'PushServerUpdateJob',+ 'app_id' => $application->id,+ 'app_name' => $application->name,+ 'old_status' => $application->status,+ 'new_status' => $aggregatedStatus,+ 'container_statuses' => $relevantStatuses->toArray(),+ 'flags' => [+ 'hasRunning' => $hasRunning,+ 'hasUnhealthy' => $hasUnhealthy,+ 'hasUnknown' => $hasUnknown,+ ],+ ]);// Update application status with aggregated resultif ($aggregatedStatus && $application->status !== $aggregatedStatus) {- Log::debug('[STATUS-DEBUG] Sentinel status change', [- 'source' => 'PushServerUpdateJob',- 'app_id' => $application->id,- 'app_name' => $application->name,- 'old_status' => $application->status,- 'new_status' => $aggregatedStatus,- 'container_statuses' => $relevantStatuses->toArray(),- 'flags' => [- 'hasRunning' => $hasRunning,- 'hasUnhealthy' => $hasUnhealthy,- 'hasUnknown' => $hasUnknown,- ],- ]);+$application->status = $aggregatedStatus;$application->save();}diff --git a/routes/api.php b/routes/api.phpindex 366a97d748..cd6ffc8c83 100644--- a/routes/api.php+++ b/routes/api.php@@ -14,6 +14,7 @@ use App\Http\Controllers\Api\TeamController;use App\Http\Middleware\ApiAllowed;use App\Jobs\PushServerUpdateJob;use App\Models\Server;+use Illuminate\Support\Facades\Log;use Illuminate\Support\Facades\Route;Route::get('/health', [OtherController::class, 'healthcheck']);@@ -158,6 +159,7 @@ Route::group(['prefix' => 'v1',], function () {Route::post('/sentinel/push', function () {+ Log::info('Received Sentinel push request', ['ip' => request()->ip(), 'user_agent' => request()->header('User-Agent')]);$token = request()->header('Authorization');if (! $token) {return response()->json(['message' => 'Unauthorized'], 401);