{"record":{"id":"279bf2da52da6e08","repo":"coollabsio/coolify","slug":"unable-to-store-the-project-icon","errorCode":null,"errorMessage":"Unable to store the project icon.","messagePattern":"Unable to store the project icon\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"app/Services/ProjectIconStorageService.php","lineNumber":20,"sourceCode":"\nnamespace App\\Services;\n\nuse App\\Models\\Project;\nuse Illuminate\\Http\\UploadedFile;\nuse RuntimeException;\n\nclass ProjectIconStorageService extends AvatarStorageService\n{\n    public function storeProject(Project $project, UploadedFile $upload): void\n    {\n        $settings = instanceSettings();\n        $storageType = $settings->avatar_storage_type === 's3' && $settings->avatar_s3_storage_id ? 's3' : 'local';\n        $s3StorageId = $storageType === 's3' ? $settings->avatar_s3_storage_id : null;\n        $disk = $this->disk($storageType, $s3StorageId);\n        $path = \"project-icons/{$project->uuid}/icon.jpg\";\n\n        if (! $disk->put($path, $this->compress($upload))) {\n            throw new RuntimeException('Unable to store the project icon.');\n        }\n\n        $oldStorageType = $project->icon_storage_type;\n        $oldS3StorageId = $project->icon_s3_storage_id;\n        $oldPath = $project->icon_path;\n\n        $project->forceFill([\n            'icon_path' => $path,\n            'icon_storage_type' => $storageType,\n            'icon_s3_storage_id' => $s3StorageId,\n        ])->save();\n\n        if ($oldPath && ($oldStorageType !== $storageType || $oldS3StorageId !== $s3StorageId)) {\n            $this->disk($oldStorageType ?? 'local', $oldS3StorageId)->delete($oldPath);\n        }\n    }\n\n    public function projectContents(Project $project): ?string","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Services/ProjectIconStorageService.php#L2-L38","documentation":"Error \"Unable to store the project icon.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Services/ProjectIconStorageService.php:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"70b9acc42467278373e00de77abb40684e25b395","analyzedAt":"2026-08-17T01:41:01.313Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}