본문 바로가기

반응형

error records

(33)
[Nestjs, Mongoose 에러] AllExceptionFilter document must have an _id before saving Nestjs + Mongoose db 로직을 수정하면서 모델을 수정했는데 기존에 잘 되던 create 요청에 에러가 났다. AllExceptionFilter MongooseError: document must have an _id before saving 저장 전 _id 가 반드시 있어야 한다는 것 같다. 모델에 디폴트로 _id가 생성되긴 하지만 모델에 _id에 정의해주었고 @Prop() 을 붙여준 게 문제였다. @Schema({ collection: 'blabla', timestamps: true, versionKey: false, read: 'secondaryPreferred', }) export class blablaModel { @Prop()
compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew .zshrc 파일에서 무언가 수정 후에 아래 명령어로 적용을 해주어야하는데 계속 에러가 났다. .zshrc 수정 후 zshrc를 실행시켜주기 명령어 exec zsh or source ~/.zshrc * source ~/.zshrc 보다는 Exec zsh가 더 좋다고 한다. 그리고 나온 에러 compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew 저 경로를 못찾는다고 나오는데 경로따라 가보니 분명 _brew 파일이 있었다. 찾아보니 1. homebrew cleanup 해주기 brew cleanup 만 해주어도 에러가 고쳐지는 사람들이 있었고 나는 아니었다. 2. symbolic links 재설정 더 찾아보니 int..
[mongoDB/mongoose] Schema hasn't been registered for model / Populate Schema hasn't been registered for model error cases below schema const userSchema = new Schema( { name: String, friends: [{ type: Schema.Types.ObjectId, ref: 'friends' }], }, { timestamps: false, read: 'secondaryPreferred', versionKey: false, }, ); 스키마 User에 friends라는 다른 모델을 Ref 해놓고 mongoose Populate를 하다가 나온 에러! Wrong usage const getFriends = async (userIdx, projection) => { return UserModel.fi..
Typescript Error: Property 'user' does not exist on type 'Request' Typescript import { Request, Response } from 'express'; const exec = async (req: Request, res: Response, next: Function): Promise => { const { idx } = req.user; const { restaurantIdx } = req.params; . . . }; export default { exec }; 빨간 줄이 간 .user You can see the res line above, the error is : Error : TS2339: Property 'user' does not exist on type 'Request >'. 기본적으로 express에서 가져온 Request에는 user라는..
[No overload matches this call] is not assignable to type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>> [No overload matches this call] ~ is not assignable to type 'RequestHandler TS2769: No overload matches this call. The last overload gave the following error. Argument of type '(req: Request, res: Response, next: NextFunction) => any' is not assignable to parameter of type 'RequestHandlerParams'. Type '(req: Request, res: Response, next: NextFunction) => any' is not assignable to type 'RequestHa..
[node.js] setHeader content-disposition 파일명 한글 깨짐 / TypeError - Invalid character in header content ["Content-Disposition"] node.js에서 엑셀 파일 생성 및 내보내기 (다운로드) 를 진행할 때 파일명에 한글이 들어가면 아래와 같은 에러가 나온다. res.setHeader( 'Content-Disposition', `attachment; filename=파일명예시.xlsx`, ); TypeError - Invalid character in header content ["Content-Disposition"] 해결법 1. 먼저 한글 String에 인코딩을 해주고 2. filename 바로 뒤에 [ *utf-8'' ] 를 적는다. res.setHeader( 'Content-Disposition', `attachment; filename*utf-8''=encodeURI('파일명예시').xlsx`, ); 그럼 엑셀 파일명이 내가 ..
[Joi] callStack: Error: item added into group finishDate created a dependencies error\n Joi 를 사용하다가 나온 에러 Joi callStack: Error: item added into group finishDate created a dependencies error\n My code : const validationSettings = { index: Joi.number().integer().required().label('index'), startDate: Joi.date() .format('YYYY-MM-DD') .min( Joi.ref('finishDate', { adjust: finishDate => new Date(finishDate.setDate(finishDate.getDate() - 89)), }), ) .label('startDate'), finishDate: Joi.da..
[Node.js Error] Request path contains unescaped characters 지하철 주소 api를 가져오는데 아래와 같은 에러가 나왔다. 찾아보니 url에 한글이 들어가서 나오는 에러!! [ERROR] : Request path contains unescaped characters const stinNm = '강남'; const addressRequestUrl = `http://openapi.kric.go.kr/openapi/convenientInfo/stationInfo?serviceKey=${apiKey}&stinNm=${stinNm}`; 아래처럼 endoceURI() 로 바꿔주니 에러가 해결되었다 const stinNm = encodeURI('강남');
[Error] Unable to boot device in current state: Booted Unable to boot device in current state: Booted Xcode simulator를 키는데 위와 같은 에러가 나왔다. 구동된게 이미 있다고 알려주는 것 같다. Error in Xcode while running (build + run ios) project in simulator. 전체 디바이스들을 리스트로 쭉 뽑아서 그 중에 "booted"인 디바이스의 Id를 shutdown해준다. To solve this error : Get the list of devices xcrun simctl list Now you can see which is "booted" or "shutdown" find the booted one and copy the id and shut it down..
TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters 공공 데이터 사이트에서 API를 가져와 사용할 때 나온 TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters 찾아보니 const requestUrl = 'http://openapi.kric.go.kr/openapi/convenientInfo/stationInfo'; const subwayServiceKey = 'mywkjv32kjshh....'; const stationName ='용산'; const url = `${requestUrl}?serviceKey=${subwayServiceKey}&format=json&stinNm=${stationName}`; console.log('url =', url); 한글을 ur..
[security_exception] missing authentication credentials for REST request 해결법 사용자 아이디 / 비밀번호의 인증이 필요하다. curl 명령어 뒤에 --user : 를 붙여주면 된다. Elaseticsearch service token 만들기 curl -X POST "localhost:9200/_security/service/elastic/fleet-server/credential/token/token1?pretty" --user elastic:asdfasdf
ERROR: for docker-elk-main_logstash_1 Cannot start service logstash: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use docker ELK docker-compose up 명령어 중 에러가 나왔다. ERROR: for docker-elk-main_logstash_1 Cannot start service logstash: Ports are not available: listen tcp 0.0.0.0:5000: bind: address already in use port 5000이 이미 사용 중이라는 것 !! 사용 중인 포트를 제거하는 명령어를 입력해도 계속해서 켜진다. lsof -i:5000 kill -9 PID 이런 경우 해결법 1. 5000번 이외의 다른 포트 사용하기 해결법 2. 시스템 환경설정 -> 공유 (share) -> AirPlay 수신 모드를 꺼주면 된다. AirPlay는 주변에 있는 iPhon, Mac, i..
[React Native] xcrun: error: SDK "iphoneos" cannot be located unable to lookup item 'Path' in SDK 'iphoneos' Failed to install CocoaPods dependencies for iOS project, which is required by this template. React Native 를 TypeScript를 사용하여 실행하기 위해 처음 명령어를 입력 후에 $ npx react-native init LuckIsComing --template react-native-template-typescript Failed to install CocoaPods dependencies for iOS project, which is required by this template. 에러가 나왔다. 에러 설명에 나온대로 $ cd ./[프로젝트명]/ios && pod install 해당 ios에 들어가 pod를 수기 설치하니 또 에러가 나왔다. xcrun: error: SDK "iphoneos" cannot be located unable to lookup item 'Path' in..
[React Native] "RNSScreenStackHeaderConfig" was not found in the UIManager. React Native에서 navigator 사용을 위해 아래의 라이브러리 들을 설치했다. $ npm install @react-navigation/native @react-navigation/native-stack 문제가 없다고 생각했는데 나온 에러 ! "RNSScreenStackHeaderConfig" was not found in the UIManager. 찾아보니 필수로 설치가 필요한 라이브러리들이 두개 더 있었다. $ npm install react-native-screens react-native-safe-area-context 위 두개를 더 설치하고 프로젝트 경로로 가서 $ cd ios $ pod install $ cd .. $ react-native run-ios pod install을 다..
[elasticsearch] "Content-Type header [application/x-www-form-urlencoded] is not supported","status":406 elasticSearch에서 PUT 또는 POST를 하는 경우 나온 에러 "Content-Type header [application/x-www-form-urlencoded] is not supported","status":406 elasticsearch 6.0 이후부터는 content-type을 꼭 넣어야 한다고! 아래와 같은 명령어를 curl -XPOST http://localhost:9200/classes/1/ -d ' {"title": "acb", "subject": "def"}' {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}% 이렇게 옵션을 추가해주니 되었다. curl..
[gitflow Error ] /Applications/Sourcetree.app/Contents/Resources/bin/getopt: No such file or directory flags:FATAL unable to parse provided options with getopt. gitflow 설치 후 init rep하려니 아래와 같은 에러가 나왔다. Error : /Applications/Sourcetree.app/Contents/Resources/bin/getopt: No such file or directory flags:FATAL unable to parse provided options with getopt. 이유를 찾아보니 sourceTree path와 뭔가 꼬인 것 같다. 해결법 $ cat ~/.gitflow_export => export FLAGS_GETOPT_CMD=/Applications/Sourcetree.app/Contents/Re~ 이런게 쭉 보인다. $ nano ~/.gitflow_export => 파일 편집하러 가서 위에서 본 저 줄을 모두 삭제한다. ..
[gitflow Error] 'fatal: branch 'develop' does not exist' gitflow설치 후, webstorm 오른 아래쪽에 no-git 이었나 요걸 클릭해서 init repo(gitflow 시작) 클릭하니 아래의 에러가 나왔다. Error 'fatal: branch 'develop' does not exist 해결법 $ git checkout develop develop으로 체크아웃 한 후 init repo를 다시 클릭하면 된다. 만약 에러가 Error 'fatal: branch 'master' does not exist Master로 나오면 master로 checkout 해주고 init repo 를 하면 된다. Reference : https://stackoverflow.com/questions/46915350/got-fatal-branch-master-does-not-..
Expected `onClick` listener to be a function, instead got a value of `object` type. [ERROR] Expected `onClick` listener to be a function, instead got a value of `object` type. "onClick" 이 실행되어야 한다는 오류 return {v} 여기의 OnClickd을 넣자마자 오류가 나왔다. 찾아보니 () => {실행시킬 함수} 로 click을 하면 바로 실행되게 만들면 오류가 사라진다. Transactions {info['block'].transactions.map((v,i) => { return {search(info['block'].transactions[i])}} className={"hover"}>{v} })} ​
[ERROR]DELETE_FAILED: IamRoleLambdaExecution (AWS::IAM::Role)Cannot delete entity, must detach all policies first. (Service: AmazonIdentityManagement; Status Code: 409; Error Code: DeleteConflict; 에러난 상황 : aws batch 서버의 권한 - 실행 역할을 재설정(기존 거를 다른 거로 변경)하기위해 serverless.yml의 소스 코드에 iam을 추가하고 재배포하려다가 에러가 났다. ERROR: DELETE_FAILED: IamRoleLambdaExecution (AWS::IAM::Role) Cannot delete entity, must detach all policies first. (Service: AmazonIdentityManagement; Status Code: 409; Error Code: DeleteConflict; 해결법 : aws - Lambda 함수 - 구성 - 권한 - 실행 역할을 바꿀 새로운 역할 이름으로 변경해준다. -> serverless.yml 코드에 iam 주소를..
Error: EPERM: operation not permitted Error: EPERM: operation not permitted, unlink ~ serverless 서버를 배포하다가 나온 에러 해결법을 찾아보니 여러개의 방법이 있었는데 첫번째로 많은 사람들이 사용한 방법은 1. 캐시 지우기 $ npm cache clean --force 2. 최신 버젼 npm 을 관리자 admin으로 설치하기 $ npm install -g npm@latest --force 3. 캐시 다시 지우기 $npm cache clean --force 이었는데 나는 그대로 에러가 나왔다. 에러 끝에 자세히 보니 Error: EPERM: operation not permitted, unlink '/Users/'userName'/Documents/project/batch-serverless/.b..
AWS Lambda Error: Unzipped size must be smaller than 262144000 bytes AWS Lambda Error: Unzipped size must be smaller than 262144000 bytes AWS Lambda 서버 배포 중 4KB 환경변수 크기 에러 해결 이후 또 나타난 에러 해결 방법 : 프로젝트 파일 크기를 크게 만드는 개발 packages를 제외시키면 된다. serverless.yml 파일에서 package: exclude: - node_modules/** node_modules/** 를 제외하도록 추가하기 -> 해결되었다 ! References : https://stackoverflow.com/questions/45342990/aws-lambda-error-unzipped-size-must-be-smaller-than-262144000-bytes AWS Lamb..
[mysql] ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails dataGrip으로 mysql 의 테이블에 원격 저장소에서 불러온 데이터를 복붙하려고 했는데 계속 에러가 났다. 해당 테이블을 삭제하려고 해도 삭제가 안되었다. (update & delete 불가라고 나옴) 터미널 가서 삭제 명령어를 쳐보니 foreign key 설정이 되어 있어서 (다른 데이터와 연결되어 있어서) update & delete를 제한한다고...! 일단 복붙할 곳은 local mysql 이고 당장 foreign키 사용 예정이 없어서 강제 해제하고 삭제 진행 -> 다시 복붙을 했다. // 해당 db에 들어가기 use [database-name]; // foreign_key 해제 set foreign_key_checks = 0; // 원하는 테이블 삭제 drop table [table-name..
[React Native Expo ERROR] expo start 보안 오류: (:) [], PSSecurityException UnauthorizedAccess expo start 명령어에서 처음 보는 오류 발생 + CategoryInfo : 보안 오류: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess 해결 방법 1. Windows PoweShell 열고 아래 명령어 입력 Set-ExecutionPolicy RemoteSigned ↓↓↓ 이제 잘 된다 !!
[Mysql] Error: connect ECONNREFUSED 127.0.0.1:3306 Error: connect ECONNREFUSED 127.0.0.1:3306 mysql 이 실행되지 않을 때, 연결되지 않아서 발생하는 오류 mysql을 제대로 설치하고 실행까지 잘 완료했는지 확인 필요 변수로 빼봄 > 안됨 const mysql = require('mysql') const connection = mysql.createConnection({ host: process.env.DB_HOST, user: process.env.DB_USER, password: process.env.DB_PASSWORD, database: process.env.DB_DATABASE }) connection.connect(); 다시 mysql 삭제 -> https://velog.io/@moorekwon/MySQL-..

반응형