본문 바로가기

Error14

elasticsearch.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=10)) elasticsearch에 데이터를 bulk 하는 과정에 발생한 에러이다. 1만 건의 데이터를 벌크 하면서 readtimeout 에러가 발생한 것 es = Elasticsearch("http://localhost:9200", timeout=100, max_retries=10, retry_on_timeout=True) 파이썬을 사용하기에 elasticsearch 선언 시에 timeout을 기본값의 10에서 늘려주면 된다. 2021. 7. 14.
OSError: cannot write mode RGBA as JPEG jpg 파일을 열고 BytesIO에 save 하는 과정에서 발생한 오류이다. jpg는 기본적으로 투명도를 지원하지 않는 다고 한다. RGBA의 A(alpha)가 투명도를 담당하는 부분인데 jpg의 경우에는 이 A를 뺀 RGB로 convert 해주어야 한다고 한다. im=Image.open(newpath+'/'+j) if j_[-1] == 'jpg' or j_[-1]=='JPG': im=im.convert('RGB') j_[-1]='jpeg' im.save(buffer, j_[-1]) 이렇게 하니 해결됐다. 2021. 7. 8.
nginx upstream time out [error] 16992#16992: *2 upstream timed out (110: Connection timed out) while reading response header from upstream runserver 실행 시에 끊기지 않던 로직이 nginx의 uwsgi 소켓 연결 시 1분 후 연결을 종료하는 문제가 발생했다. [error] 16992#16992: *2 upstream timed out (110: Connection timed out) while reading response header from upstream stl 파일을 읽어 값을 계산한 뒤에 리턴하는 로직이었기에 1분 이상의 시간이 필요했다. nginx 설정에서 uwsgi_read_timeout 300s; uwsgi의 read timeout을 설정해 주니 해결됐다. 2021. 6. 14.
django.template.exceptions.TemplateDoesNotExist: admin/import_export/change_list_import_export.html 장고 어드민에서 데이터를 파일로 import, export 하기 위해 pip를 하고 어드민 클래스에 상속하고 runserver를 돌렸더니,, django.template.exceptions.TemplateDoesNotExist: admin/import_export/change_list_import_export.html 다음과 같은 에러가 발생하였다. 해결방법은 앱에다가 추가해주면 해결된다. INSTALLED_APPS = [ 'import_export', ] 2021. 6. 10.
elasticsearch 에러 { "error" : { "root_cause" : [ { "type" : "illegal_argument_exception", "reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true." } ], "ty.. { "error" : { "root_cause" : [ { "type" : "mapper_parsing_exception", "reason" : "No handler for type [string] declared on field [professor]" } ], "type" : "mapper_parsing_exception", "reason" : "No handler for type [string] declared on field [professor]" }, "status" : 400 } elasticsearch 6.0v 이후로 mapping 파일의 type을 string이 아닌 text로 지정해야 한다. 파일로 돌아가 string을 text로 변경하니 해결됐다. 2021. 6. 8.
elasticsearch 에러 {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."}],"type":"illegal_argument_exception","reason":"Types c.. { "error" : { "root_cause" : [ { "type" : "illegal_argument_exception", "reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true." } ], "type" : "illegal_argument_exception", "reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true." }, "status" : 400 } mapping 도중 발생한 에러인데 "Types.. 2021. 6. 8.
elasticsearch 에러 {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The bulk request must be terminated by a newline [\\n]"}],"type":"illegal_argument_exception","reason":"The bulk request must be terminated by a newline [\\n]"},.. 벌크 시에 이러한 에러가 생겼다. 읽어보면 "The bulk request must be terminated by a newline [\\n]" 벌크 할 파일로 들어가 엔터를 쳐주어 빈라인으로 끝나야 한다는 조건을 충족시켜주면 해결된다. 2021. 6. 8.
elasticsearch 에러 {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406} elasticsearch 데이터 파일 PUT, POST 시에 발생하는 에러이다. elasticsearch 6.0 v 이후부터는 엄격하게 content-type을 확인한다고 한다. -H 'Content-Type: application/json' curl 명령어에 content-type 옵션을 명시해주자 2021. 6. 8.
AWS S3 버킷 AccessDenied 문제 위와 같은 에러가 발생하여 처음에는 권한 설정 관련 부분으로 생각하여 권한 설정 변경하였다. 그래도 같은 에러가 발생하여 url을 보고 s3 버킷의 경로로 들어가니 해당 경로에 파일이 없었다. 파일이 없어도 위와 같은 에러가 발생할수있다. 2021. 6. 4.