Replies: 1 comment
-
|
오오 스스로 해결 했다니 멋져요! 👏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Docker 실행 시 오류
코덱의 유니코드가 utf-8이 아니라서 에러가 난다는 것 같은데, 이 코덱의 위치가 어딘지도 잘 모르겠어서 해결을 하지 못하는 상황이었습니다.
ㄴ 코덱의 유니코드가 아닌 backend의 .env파일을 utf-8로 바꾸니 해결되었습니다.
[명령어]
ringchat> docker compose up
[에러메시지 전문]
[+] Running 2/0
✔ Container ringchat-backend-1 Created 0.0s
✔ Container ringchat-frontend-1 Created 0.0s
Attaching to backend-1, frontend-1
frontend-1 |
frontend-1 | > frontend@0.1.0 dev
frontend-1 | > next dev
frontend-1 |
backend-1 | Skipping virtualenv creation, as specified in config file.
backend-1 | INFO: Will watch for changes in these directories: ['/workdir/backend']
backend-1 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
backend-1 | INFO: Started reloader process [1] using WatchFiles
frontend-1 | ▲ Next.js 14.2.5
frontend-1 | - Local: http://localhost:3000
frontend-1 | - Environments: .env.local
frontend-1 |
frontend-1 | ✓ Starting...
backend-1 | Process SpawnProcess-1:
backend-1 | Traceback (most recent call last):
backend-1 | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
backend-1 | self.run()
backend-1 | File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run
backend-1 | self._target(*self._args, **self._kwargs)
backend-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-1 | target(sockets=sockets)
backend-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 65, in run
backend-1 | return asyncio.run(self.serve(sockets=sockets))
backend-1 | File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
backend-1 | return loop.run_until_complete(main)
backend-1 | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 69, in serve
backend-1 | await self._serve(sockets)
backend-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 76, in _serve
backend-1 | config.load()
backend-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/config.py", line 434, in load
backend-1 | self.loaded_app = import_from_string(self.app)
backend-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-1 | module = importlib.import_module(module_str)
backend-1 | File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
backend-1 | return _bootstrap._gcd_import(name[level:], package, level)
backend-1 | File "", line 1050, in _gcd_import
backend-1 | File "", line 1027, in _find_and_load
backend-1 | File "", line 1006, in _find_and_load_unlocked
backend-1 | File "", line 688, in _load_unlocked
backend-1 | File "", line 883, in exec_module
backend-1 | File "", line 241, in _call_with_frames_removed
backend-1 | File "/workdir/backend/app/main.py", line 5, in
backend-1 | from app.database import Base
backend-1 | File "/workdir/backend/app/database.py", line 11, in
backend-1 | load_dotenv()
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/main.py", line 356, in load_dotenv
backend-1 | return dotenv.set_as_environment_variables()
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/main.py", line 92, in set_as_environment_variables
backend-1 | if not self.dict():
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/main.py", line 76, in dict
backend-1 | self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/main.py", line 238, in resolve_variables
backend-1 | for (name, value) in values:
frontend-1 | ✓ Ready in 2.2s
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/main.py", line 84, in parse
backend-1 | for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/main.py", line 26, in with_warn_for_invalid_lines
backend-1 | for mapping in mappings:
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/parser.py", line 173, in parse_stream
backend-1 | reader = Reader(stream)
backend-1 | File "/usr/local/lib/python3.10/site-packages/dotenv/parser.py", line 64, in init
backend-1 | self.string = stream.read()
backend-1 | File "/usr/local/lib/python3.10/codecs.py", line 322, in decode
backend-1 | (result, consumed) = self._buffer_decode(data, self.errors, final)
backend-1 | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
v View in Docker Desktop o View Config w Enable Watch
[시도]
"docker-compose.yml" 파일과
"docker-compose.dev.yml" 파일 모두에
" environment:
- PYTHONIOENCODING=utf-8" 라는 조건을 넣어보았으나 효과가 없었고,
backend 폴더의 "Dockerfile"에도
CMD 에 ["utf8"]의 요소를 추가하였으나 효과가 없었음.
[해결]
backend 폴더의 .env 파일을 메모장으로 utf-8로 바꾸어 저장 후
docker-compose up --build 명령어를 통해 재가동하니 해결된 것 같음.
Beta Was this translation helpful? Give feedback.
All reactions