{"record":{"id":"9ac06d2d930572c0","repo":"coollabsio/coolify","slug":"a-database-with-this-name-already-exists","errorCode":null,"errorMessage":"A database with this name already exists.","messagePattern":"A database with this name already exists\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Livewire/Project/Service/Index.php","lineNumber":445,"sourceCode":"\n            $this->serviceApplication->delete();\n            $this->dispatch('success', 'Application deleted.');\n\n            return redirect()->route('project.service.configuration', $this->parameters);\n        } catch (\\Throwable $e) {\n            return handleError($e, $this);\n        }\n    }\n\n    public function convertToDatabase()\n    {\n        try {\n            $this->authorize('update', $this->serviceApplication);\n            $service = $this->serviceApplication->service;\n            $serviceApplication = $this->serviceApplication;\n\n            if ($service->databases()->where('name', $serviceApplication->name)->exists()) {\n                throw new \\Exception('A database with this name already exists.');\n            }\n\n            $redirectParams = collect($this->parameters)\n                ->except('database_uuid')\n                ->all();\n            DB::transaction(function () use ($service, $serviceApplication) {\n                $service->databases()->create([\n                    'name' => $serviceApplication->name,\n                    'human_name' => $serviceApplication->human_name,\n                    'description' => $serviceApplication->description,\n                    'exclude_from_status' => $serviceApplication->exclude_from_status,\n                    'is_log_drain_enabled' => $serviceApplication->is_log_drain_enabled,\n                    'image' => $serviceApplication->image,\n                    'service_id' => $service->id,\n                    'is_migrated' => true,\n                ]);\n                $serviceApplication->delete();\n            });","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/coollabsio/coolify/blob/70b9acc42467278373e00de77abb40684e25b395/app/Livewire/Project/Service/Index.php#L427-L463","documentation":"Error \"A database with this name already exists.\" thrown in coollabsio/coolify.","triggerScenarios":"Thrown at app/Livewire/Project/Service/Index.php:445 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"}