작성자 없음
작성자 정보가 삭제된 글입니다.
해결된 질문
작성
·
300
1
회원가입시 이러한 에러가 계속 발생합니다.
console.log로
test@test.com qwer1234
email, password는 들어가는것도 확인했고 auth/signup error를 catch했을땐 409code로 에러가 들어왔습니다.
무엇이 문제일까요...?
중복이 문제인가 싶어 다른 여러 아이디로도 해봤는데 계속해서 저러한 에러가 뜨면서 실패하고있습니다ㅜㅜ
QueryFailedError: duplicate key value violates unique constraint "UQ_e12875dfb3b1d92d7d7c5377e22"
at PostgresQueryRunner.query (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/driver/postgres/PostgresQueryRunner.ts:331:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at InsertQueryBuilder.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/query-builder/InsertQueryBuilder.ts:163:33)
at SubjectExecutor.executeInsertOperations (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:435:42)
at SubjectExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:137:9)
at EntityPersistExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/EntityPersistExecutor.ts:182:21)
at AuthService.signup (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/auth/auth.service.ts:43:7)
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-proxy.js:9:17 {
query: 'INSERT INTO "user"("loginType", "email", "password", "nickname", "imageUri", "kakaoImageUri", "RED", "YELLOW", "GREEN", "BLUE", "PURPLE", "createdAt", "updatedAt", "deletedAt", "hashedRefreshToken") VALUES ($1, $2, $3, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING "id", "RED", "YELLOW", "GREEN", "BLUE", "PURPLE", "createdAt", "updatedAt", "deletedAt"',
parameters: [
'email',
'test@test.com',
'$2a$10$hlFtQkbll6R0pJNkTywGh.DaRGVm1uhu9DJm9c.Q0OeduuMRzdNyK'
],
driverError: error: duplicate key value violates unique constraint "UQ_e12875dfb3b1d92d7d7c5377e22"
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/pg/lib/client.js:526:17
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at PostgresQueryRunner.query (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/driver/postgres/PostgresQueryRunner.ts:260:25)
at InsertQueryBuilder.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/query-builder/InsertQueryBuilder.ts:163:33)
at SubjectExecutor.executeInsertOperations (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:435:42)
at SubjectExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:137:9)
at EntityPersistExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/EntityPersistExecutor.ts:182:21)
at AuthService.signup (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/auth/auth.service.ts:43:7)
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-proxy.js:9:17 {
length: 234,
severity: 'ERROR',
code: '23505',
detail: 'Key (email)=(test@test.com) already exists.',
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: 'public',
table: 'user',
column: undefined,
dataType: undefined,
constraint: 'UQ_e12875dfb3b1d92d7d7c5377e22',
file: 'nbtinsert.c',
line: '670',
routine: '_bt_check_unique'
},
length: 234,
severity: 'ERROR',
code: '23505',
detail: 'Key (email)=(test@test.com) already exists.',
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: 'public',
table: 'user',
column: undefined,
dataType: undefined,
constraint: 'UQ_e12875dfb3b1d92d7d7c5377e22',
file: 'nbtinsert.c',
line: '670',
routine: '_bt_check_unique'
}
QueryFailedError: duplicate key value violates unique constraint "UQ_e12875dfb3b1d92d7d7c5377e22"
at PostgresQueryRunner.query (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/driver/postgres/PostgresQueryRunner.ts:331:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at InsertQueryBuilder.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/query-builder/InsertQueryBuilder.ts:163:33)
at SubjectExecutor.executeInsertOperations (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:435:42)
at SubjectExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:137:9)
at EntityPersistExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/EntityPersistExecutor.ts:182:21)
at AuthService.signup (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/auth/auth.service.ts:43:7)
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-proxy.js:9:17 {
query: 'INSERT INTO "user"("loginType", "email", "password", "nickname", "imageUri", "kakaoImageUri", "RED", "YELLOW", "GREEN", "BLUE", "PURPLE", "createdAt", "updatedAt", "deletedAt", "hashedRefreshToken") VALUES ($1, $2, $3, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) RETURNING "id", "RED", "YELLOW", "GREEN", "BLUE", "PURPLE", "createdAt", "updatedAt", "deletedAt"',
parameters: [
'email',
'test@test.com',
'$2a$10$DfBqqh82WjRRFN5Fj2zJu.RiqJzzJCD4vR5xA1.y2zRxaAol0pP6W'
],
driverError: error: duplicate key value violates unique constraint "UQ_e12875dfb3b1d92d7d7c5377e22"
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/pg/lib/client.js:526:17
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at PostgresQueryRunner.query (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/driver/postgres/PostgresQueryRunner.ts:260:25)
at InsertQueryBuilder.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/query-builder/InsertQueryBuilder.ts:163:33)
at SubjectExecutor.executeInsertOperations (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:435:42)
at SubjectExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/SubjectExecutor.ts:137:9)
at EntityPersistExecutor.execute (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/persistence/EntityPersistExecutor.ts:182:21)
at AuthService.signup (/Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/src/auth/auth.service.ts:43:7)
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /Users/kwonbeomjun/Documents/rn/rn-baro_review-v1/server/node_modules/@nestjs/core/router/router-proxy.js:9:17 {
length: 234,
severity: 'ERROR',
code: '23505',
detail: 'Key (email)=(test@test.com) already exists.',
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: 'public',
table: 'user',
column: undefined,
dataType: undefined,
constraint: 'UQ_e12875dfb3b1d92d7d7c5377e22',
file: 'nbtinsert.c',
line: '670',
routine: '_bt_check_unique'
},
length: 234,
severity: 'ERROR',
code: '23505',
detail: 'Key (email)=(test@test.com) already exists.',
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: 'public',
table: 'user',
column: undefined,
dataType: undefined,
constraint: 'UQ_e12875dfb3b1d92d7d7c5377e22',
file: 'nbtinsert.c',
line: '670',
routine: '_bt_check_unique'
}
답변 2
앗 해결하셨다니 다행입니다 👍 또 막히는 부분 있다면 알려주세요!