{"record":{"id":"15a9c4fc3b3bb7dc","repo":"n8n-io/n8n","slug":"400-15a9c4","errorCode":"400","errorMessage":"You can't transfer a credential into the project that's already owning it.","messagePattern":"You can't transfer a credential into the project that's already owning it\\.","errorType":"exception","errorClass":"TransferCredentialError","httpStatus":400,"severity":"error","filePath":"packages/cli/src/credentials/credentials.service.ee.ts","lineNumber":226,"sourceCode":"\t\t);\n\n\t\t// 3. get source project\n\t\tconst sourceProject = ownerSharing.project;\n\n\t\t// 4. get destination project\n\t\tconst destinationProject = await this.projectService.getProjectWithScope(\n\t\t\tuser,\n\t\t\tdestinationProjectId,\n\t\t\t['credential:create'],\n\t\t);\n\t\tNotFoundError.isDefinedAndNotNull(\n\t\t\tdestinationProject,\n\t\t\t`Could not find project with the id \"${destinationProjectId}\". Make sure you have the permission to create credentials in it.`,\n\t\t);\n\n\t\t// 5. checks\n\t\tif (sourceProject.id === destinationProject.id) {\n\t\t\tthrow new TransferCredentialError(\n\t\t\t\t\"You can't transfer a credential into the project that's already owning it.\",\n\t\t\t);\n\t\t}\n\n\t\t// Transferring an end-user credential into a project is equivalent to creating\n\t\t// one there, so it must clear the same createEndUser gate.\n\t\tif (credential.isResolvable) {\n\t\t\tawait this.credentialsService.ensureCanManageEndUserCredential(user, destinationProject.id);\n\t\t}\n\n\t\t// 6. validate that the destination project has access to all external secret providers\n\t\tif (\n\t\t\tthis.licenseState.isExternalSecretsLicensed() &&\n\t\t\tthis.externalSecretsConfig.externalSecretsForProjects\n\t\t) {\n\t\t\tconst decryptedData = await this.credentialsService.decrypt(credential, true);\n\t\t\tawait validateAccessToReferencedSecretProviders(\n\t\t\t\tdestinationProject.id,","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/credentials/credentials.service.ee.ts#L208-L244","documentation":"Thrown by EnterpriseCredentialsService.transferOne when sourceProject.id === destinationProjectId. Transferring a credential to the project that already owns it is a no-op and is explicitly rejected. The check runs after both projects are resolved and access is verified, so the IDs are valid — just identical.","triggerScenarios":"POST transfer-ownership with a destinationProjectId equal to the credential's current owning project.","commonSituations":"UI defaulting the destination dropdown to the current owner. Caller re-issuing a transfer after a partial success. Mis-routed automation passing the source project as destination.","solutions":["Pass a destination project ID different from the current owning project.","Fetch the current owner project first and skip the transfer if it equals the destination.","Fix the form/selector so it cannot target the current owner."],"exampleFix":"// before\nawait transferCredential(id, currentOwnerProjectId);\n\n// after\nif (destinationId !== currentOwnerProjectId) {\n  await transferCredential(id, destinationId);\n}","handlingStrategy":"validation","validationCode":"if (destinationProjectId === currentOwnerProjectId) {\n  throw new Error('Destination equals current owner — nothing to transfer.');\n}\nawait transferOne(user, id, destinationProjectId);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter the current owner out of the destination project picker.","Skip the transfer call when source === destination.","Default the destination to a value other than the current owner."],"tags":["credentials","transfer","validation","enterprise"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}