{"record":{"id":"6d842831bbd8b587","repo":"coollabsio/coolify","slug":"unable-to-generate-unique-uuid-for-backup-executio","errorCode":null,"errorMessage":"Unable to generate unique UUID for backup execution after 3 attempts","messagePattern":"Unable to generate unique UUID for backup execution after 3 attempts","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Jobs/DatabaseBackupJob.php","lineNumber":325,"sourceCode":"                    return;\n                }\n            }\n            $this->backup_dir = backup_dir().'/databases/'.str($this->team->name)->slug().'-'.$this->team->id.'/'.$this->directory_name;\n            if ($this->database->name === 'coolify-db') {\n                $databasesToBackup = ['coolify'];\n                $this->directory_name = $this->container_name = 'coolify-db';\n                $ip = Str::slug($this->server->ip);\n                $this->backup_dir = backup_dir().'/coolify'.\"/coolify-db-$ip\";\n            }\n            foreach ($databasesToBackup as $database) {\n                // Generate unique UUID for each database backup execution\n                $attempts = 0;\n                do {\n                    $this->backup_log_uuid = new_public_id();\n                    $exists = ScheduledDatabaseBackupExecution::where('uuid', $this->backup_log_uuid)->exists();\n                    $attempts++;\n                    if ($attempts >= 3 && $exists) {\n                        throw new \\Exception('Unable to generate unique UUID for backup execution after 3 attempts');\n                    }\n                } while ($exists);\n\n                $size = 0;\n                $localBackupSucceeded = false;\n                $s3UploadError = null;\n\n                // Step 1: Create local backup\n                try {\n                    if (str($databaseType)->contains('postgres')) {\n                        $this->backup_file = \"/pg-dump-$database-\".Carbon::now()->timestamp.'.dmp';\n                        if ($this->backup->dump_all) {\n                            $this->backup_file = '/pg-dump-all-'.Carbon::now()->timestamp.'.gz';\n                        }\n                        $this->backup_location = $this->backup_dir.$this->backup_file;\n                        $this->backup_log = ScheduledDatabaseBackupExecution::create([\n                            'uuid' => $this->backup_log_uuid,\n                            'database_name' => $database,","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Jobs/DatabaseBackupJob.php#L307-L343","documentation":"Error \"Unable to generate unique UUID for backup execution after 3 attempts\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Jobs/DatabaseBackupJob.php:325 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"}