인프런 커뮤니티 질문&답변

삼각형님의 프로필 이미지

작성한 질문수

Azure Native로 나만의 GPT 만들기

Azure Function Deploy 실패

해결된 질문

24.07.30 14:40 작성

·

92

1

Azure Function Deploy가 실패하는데 원인을 모르겠습니다. ㅠ.ㅠ

2:32:09 PM xbg-my-chatgpt-api: [05:31:59+0000] Collecting watchfiles>=0.13
2:32:09 PM xbg-my-chatgpt-api: [05:31:59+0000]   Using cached watchfiles-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
2:32:09 PM xbg-my-chatgpt-api: [05:31:59+0000] Collecting python-dotenv>=0.13
2:32:09 PM xbg-my-chatgpt-api: [05:31:59+0000]   Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:31:59+0000] Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0
2:32:09 PM xbg-my-chatgpt-api: [05:31:59+0000]   Using cached uvloop-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting websockets>=10.4
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached websockets-12.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting pyyaml>=5.1
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting isodate>=0.6.1
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached isodate-0.6.1-py2.py3-none-any.whl (41 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting pyjwt>=2.6.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached PyJWT-2.8.0-py3-none-any.whl (22 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting azure-core>=1.24.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached azure_core-1.30.2-py3-none-any.whl (194 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting aiosignal>=1.1.2
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000] Collecting attrs>=17.3.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:00+0000]   Using cached attrs-23.2.0-py3-none-any.whl (60 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting multidict<7.0,>=4.5
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached multidict-6.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (128 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting yarl<2.0,>=1.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached yarl-1.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting frozenlist>=1.1.1
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached frozenlist-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (272 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting requests>=2.21.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached requests-2.32.3-py3-none-any.whl (64 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting six>=1.11.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting idna>=2.0.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached idna-3.7-py3-none-any.whl (66 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000] Collecting dnspython>=2.0.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:01+0000]   Using cached dnspython-2.6.1-py3-none-any.whl (307 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000] Collecting typer>=0.12.3
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000]   Using cached typer-0.12.3-py3-none-any.whl (47 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000] Collecting certifi
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000]   Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000] Collecting anyio
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000]   Using cached anyio-4.4.0-py3-none-any.whl (86 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000] Collecting httpcore==1.*
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000]   Using cached httpcore-1.0.5-py3-none-any.whl (77 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000] Collecting sniffio
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000]   Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000] Collecting MarkupSafe>=2.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:02+0000]   Using cached MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000] Collecting pydantic-core==2.20.1
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000]   Using cached pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000] Collecting annotated-types>=0.4.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000]   Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000] Collecting urllib3<3,>=1.21.1
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000]   Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000] Collecting charset-normalizer<4,>=2
2:32:09 PM xbg-my-chatgpt-api: [05:32:04+0000]   Using cached charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (140 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000] Collecting rich>=10.11.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000]   Using cached rich-13.7.1-py3-none-any.whl (240 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000] Collecting shellingham>=1.3.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000]   Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000] Collecting pygments<3.0.0,>=2.13.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000]   Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000] Collecting markdown-it-py>=2.2.0
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000]   Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000] Collecting mdurl~=0.1
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000]   Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
2:32:09 PM xbg-my-chatgpt-api: [05:32:05+0000] Installing collected packages: mdurl, sniffio, pygments, markdown-it-py, idna, urllib3, typing-extensions, shellingham, rich, h11, click, charset-normalizer, certifi, anyio, websockets, watchfiles, uvloop, uvicorn, typer, six, requests, pyyaml, python-dotenv, pydantic-core, multidict, MarkupSafe, httptools, httpcore, frozenlist, dnspython, annotated-types, yarl, starlette, python-multipart, pyjwt, pydantic, jinja2, isodate, httpx, fastapi-cli, email-validator, azure-core, attrs, aiosignal, fastapi, azure-messaging-webpubsubservice, azure-functions, aiohttp
2:32:09 PM xbg-my-chatgpt-api: [05:32:09+0000] Successfully installed MarkupSafe-2.1.5 aiohttp-3.9.5 aiosignal-1.3.1 annotated-types-0.7.0 anyio-4.4.0 attrs-23.2.0 azure-core-1.30.2 azure-functions-1.20.0 azure-messaging-webpubsubservice-1.1.0 certifi-2024.7.4 charset-normalizer-3.3.2 click-8.1.7 dnspython-2.6.1 email-validator-2.2.0 fastapi-0.111.1 fastapi-cli-0.0.4 frozenlist-1.4.1 h11-0.14.0 httpcore-1.0.5 httptools-0.6.1 httpx-0.27.0 idna-3.7 isodate-0.6.1 jinja2-3.1.4 markdown-it-py-3.0.0 mdurl-0.1.2 multidict-6.0.5 pydantic-2.8.2 pydantic-core-2.20.1 pygments-2.18.0 pyjwt-2.8.0 python-dotenv-1.0.1 python-multipart-0.0.9 pyyaml-6.0.1 requests-2.32.3 rich-13.7.1 shellingham-1.5.4 six-1.16.0 sniffio-1.3.1 starlette-0.37.2 typer-0.12.3 typing-extensions-4.12.2 urllib3-2.2.2 uvicorn-0.30.3 uvloop-0.19.0 watchfiles-0.22.0 websockets-12.0 yarl-1.9.4
2:32:09 PM xbg-my-chatgpt-api: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
2:32:09 PM xbg-my-chatgpt-api: WARNING: You are using pip version 21.2.4; however, version 24.2 is available.
2:32:09 PM xbg-my-chatgpt-api: You should consider upgrading via the '/tmp/oryx/platforms/python/3.11.8/bin/python3.11 -m pip install --upgrade pip' command.
2:32:09 PM xbg-my-chatgpt-api: Not a vso image, so not writing build commands
2:32:09 PM xbg-my-chatgpt-api: Preparing output...
2:32:09 PM xbg-my-chatgpt-api: Copying files to destination directory '/home/site/wwwroot'...
2:32:11 PM xbg-my-chatgpt-api: Done in 1 sec(s).
2:32:11 PM xbg-my-chatgpt-api: Removing existing manifest file
2:32:11 PM xbg-my-chatgpt-api: Creating a manifest file...
2:32:11 PM xbg-my-chatgpt-api: Manifest file created.
2:32:11 PM xbg-my-chatgpt-api: Copying .ostype to manifest output directory.
2:32:11 PM xbg-my-chatgpt-api: Done in 14 sec(s).
2:32:12 PM xbg-my-chatgpt-api: Running post deployment command(s)...
2:32:12 PM xbg-my-chatgpt-api: Generating summary of Oryx build
2:32:12 PM xbg-my-chatgpt-api: Deployment Log file does not exist in /tmp/oryx-build.log
2:32:12 PM xbg-my-chatgpt-api: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
2:32:12 PM xbg-my-chatgpt-api: Triggering recycle (preview mode disabled).
2:32:12 PM xbg-my-chatgpt-api: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
2:32:12 PM xbg-my-chatgpt-api: To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
2:32:12 PM xbg-my-chatgpt-api: Writing the artifacts to a squashfs file
2:32:13 PM xbg-my-chatgpt-api: Parallel mksquashfs: Using 1 processor
2:32:13 PM xbg-my-chatgpt-api: Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072.
2:32:27 PM xbg-my-chatgpt-api: Deployment failed.

답변 1

0

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 30. 14:50

ㅠㅠ... 저도 Azure Functions을 이용해 개발중이지만, Output에 Deploy에 실패하는 이유를 좀 자세히 적어줬으면 좋겠습니다....

Deloyment Failed가 발생할 경우.. 제 경험에 의존한 바로는 다음과 같은 원인이 있습니다.
1. requirements.txt에 필요한 의존성이 빠져있을 경우

2. Azure Functions 리소스에 필요한 환경변수가 빠져있을 경우

3. 배포 대상이 될 Azure Function이 실행중인지 확인 (실행중이여야 함)

4. 그냥 VSCode 재시작

5. 재시도하면 해결되는 경우

6. 1~4까지 했을때도 안됐을 경우, 코드를 롤백해가면서 재배포 진행한 뒤, 실패하는 곳을 찾아서 디버깅...

다음과 같은 방식으로 해결했는데, 완전한 해결책을 드리지 못해 죄송합니다..
Deployment Failed가 발생했을 때, 확실한 로그를 찾는 방법을 알아와서 다시 답변 드리겠습니다.

혹시나 해결 된 경우 답글 부탁드립니다.

삼각형님의 프로필 이미지
삼각형
질문자

2024. 07. 30. 18:24

6번을 시도하지는 않았는데 디플로이 실패 문제가 해결되지는 않았습니다. 빈 프로젝트부터 다시 한번 시도해볼께요.

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 30. 18:39

런타임 에러가 발생하는 경우이나, 해당 경우를 발견하지 못한 경우 Deployment Failed가 발생하기도 합니다.
제 코드를 Github에 공유하는것도 준비해보겠습니다. 명확한 해결책을 드리지 못해 죄송합니다 ㅠㅠ

삼각형님의 프로필 이미지
삼각형
질문자

2024. 07. 30. 18:40

아닙니다. ㅎㅎ 로컬에선 잘 동작하는데 리모트에서는 잘 안될수도 있는 건가요?

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 30. 19:01

지금 떠오른건데, 로컬에서는 잘 동작하는데, 원격에 올릴 때 라이브러리 버전 문제가 생긴 적이 있습니다.

 

예를 들어, 로컬 venv에는 a 라이브러리가 1.2버전인데, 리모트에 배포할때는 라이브러리를 새로 설치하게 되니 a 라이브러리가 1.3버전으로 설치되었고, 이로 인해 타 라이브러리와 충돌한다던가.. 해서 Deployment Failed가 발생한적이 있었습니다.

 

그래서 제일 확실한건 6번 방법으로 하나하나 롤백하며 확인해보는게 제일 낫다고 생각하긴 합니다 ㅠㅠ

 

다른 경우에는, Azure Functions와 연동되어있는 Storage의 연결 Key 문제가 있습니다.

설명이 어려운데, Azure Functions 내 "AzureWebJobsStorage" 환경변수가 잘못된 경우에도 Deployment Failed 오류가 발생하긴 하나, 해당 환경변수의 경우 Azure Functions 리소스를 생성할 때 자동으로 잡아주므로.. 해당 문제일 확률은 극히 낮다고 생각합니다.

삼각형님의 프로필 이미지
삼각형
질문자

2024. 07. 31. 08:54

저도 AzureWebJobsStorage 관련된 해결법을 살펴봤는데요. 예전에는 스토리지 설정을 따로 해줬어야했더라고요. 지금은 아예 선택할 수 없고요. 그래서 그 문제는 아니라고 생각했습니다.

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 31. 09:15

금일 내로 해결이 안되시면, Github를 통해 제 프로젝트 코드 공유 드리겠습니다.

삼각형님의 프로필 이미지
삼각형
질문자

2024. 07. 31. 11:45

음... 뭔가 제 Azure에 문제가 있나 봅니다. 아무것도 안한 프로젝트도 배포가 안되네요;

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 31. 12:47

혹시 Azure Functions 리소스 삭제 후 재생성도 해보셨을까요?

삼각형님의 프로필 이미지
삼각형
질문자

2024. 07. 31. 13:00

네네 그랬는데도 안되네요. ㅎㅎ Azure 쪽에 기술 지원을 요청해봐야겠어요.

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 31. 13:03

ㅠㅠ 도움을 드리지 못해 죄송합니다...

삼각형님의 프로필 이미지
삼각형
질문자

2024. 07. 31. 14:47

ㅎㅎ 괜찮습니다! 강의 너무 재미있었어요.

정동형님의 프로필 이미지
정동형
지식공유자

2024. 07. 31. 16:55

헉 그렇게 느껴지셨다면 정말 다행이네요!! 좋은 후기 남겨주셔서 감사합니다!! 완강 고생하셨습니다!!!!!