簡體   English   中英

Azure function 部署失敗:“上傳內置內容時 SCM_RUN_FROM_PACKAGE 格式錯誤”

[英]Azure function deployment failed: "Malformed SCM_RUN_FROM_PACKAGE when uploading built content"

我有兩個 Azure 帳戶。 我嘗試將相同的 function 部署到這兩個帳戶(到 function 應用程序)。 部署到第一個帳戶 - 成功,但部署到第二個帳戶 - 失敗。

這兩個帳戶之間唯一的大區別是我無法直接訪問第二個帳戶的 function 應用程序使用的資源組(我可以訪問第一個帳戶的資源組)。 這可能是我無法將程序部署到 2nd 帳戶的 function 應用程序的原因嗎?

在第一個賬號部署function app的output:

14:14:13 <func_name_1>: Starting deployment...
14:14:15 <func_name_1>: Creating zip package...
14:14:16 <func_name_1>: Zip package size: 597 kB
14:14:16 <func_name_1>: Fetching changes.
14:14:17 <func_name_1>: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/4c187dd4-7c93-41fb-939d-e2b4640f0cfe.zip (0.57 MB) to /tmp/zipdeploy/extracted
14:14:20 <func_name_1>: Updating submodules.
14:14:21 <func_name_1>: Preparing deployment for commit id '1a1eb1d0a9'.
14:14:21 <func_name_1>: Repository path is /tmp/zipdeploy/extracted
14:14:21 <func_name_1>: Running oryx build...
14:14:21 <func_name_1>: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.7 -p packagedir=.python_packages/lib/site-packages
14:14:22 <func_name_1>: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
14:14:22 <func_name_1>: You can report issues at https://github.com/Microsoft/Oryx/issues
14:14:22 <func_name_1>: Oryx Version: 0.2.20201015.1, Commit: 1a35fbce482b20b71290f3a837a3469803ce4b44, ReleaseTagName: 20201015.1
14:14:22 <func_name_1>: Build Operation ID: |WfYnvmAN2UQ=.793dc238_
14:14:22 <func_name_1>: Repository Commit : 1a1eb1d0a94943658cbb12b225071125
14:14:22 <func_name_1>: Detecting platforms...
14:14:23 <func_name_1>: Detected following platforms:
14:14:23 <func_name_1>:   python: 3.7.12
14:14:23 <func_name_1>: Version '3.7.12' of platform 'python' is not installed. Generating script to install it...
14:14:23 <func_name_1>: Warning: An outdated version of python was detected (3.7.12). Consider updating.
14:14:23 <func_name_1>: Versions supported by Oryx: https://github.com/microsoft/Oryx
14:14:23 <func_name_1>: Source directory     : /tmp/zipdeploy/extracted
14:14:23 <func_name_1>: Destination directory: /home/site/wwwroot
14:14:23 <func_name_1>: Downloading and extracting 'python' version '3.7.12' to '/tmp/oryx/platforms/python/3.7.12'...
14:14:24 <func_name_1>: Downloaded in 1 sec(s).
14:14:24 <func_name_1>: Verifying checksum...
14:14:24 <func_name_1>: Extracting contents...
14:14:27 <func_name_1>: Done in 4 sec(s).
14:14:28 <func_name_1>: Python Version: /tmp/oryx/platforms/python/3.7.12/bin/python3.7
14:14:28 <func_name_1>: Running pip install...
14:14:55 <func_name_1>: [13:14:55+0000] Successfully built psycopg2
14:14:55 <func_name_1>: [13:14:55+0000] Installing collected packages: azure-functions, numpy, six, python-dateutil, pytz, pandas, chardet, urllib3, idna, certifi, requests, pycparser, cffi, cryptography, PyJWT, msal, sqlalchemy, psycopg2, azure-core, isodate, oauthlib, requests-oauthlib, msrest, azure-storage-blob, pyasn1, pyasn1-modules, cachetools, rsa, google-auth, google-auth-oauthlib, pyarrow, setuptools, pydata-google-auth, protobuf, google-crc32c, google-resumable-media, googleapis-common-protos, grpcio, grpcio-status, google-api-core, proto-plus, pyparsing, packaging, google-cloud-core, google-cloud-bigquery, pandas-gbq
14:15:11 <func_name_1>: [13:15:11+0000] Successfully installed PyJWT-1.7.1 azure-core-1.22.1 azure-functions-1.9.0 azure-storage-blob-12.9.0 cachetools-5.0.0 certifi-2021.10.8 cffi-1.15.0 chardet-3.0.4 cryptography-3.4.6 google-api-core-2.5.0 google-auth-2.6.0 google-auth-oauthlib-0.5.0 google-cloud-bigquery-2.31.0 google-cloud-core-2.2.2 google-crc32c-1.3.0 google-resumable-media-2.3.0 googleapis-common-protos-1.55.0 grpcio-1.44.0 grpcio-status-1.44.0 idna-2.10 isodate-0.6.1 msal-1.8.0 msrest-0.6.21 numpy-1.19.1 oauthlib-3.2.0 packaging-21.3 pandas-1.1.0 pandas-gbq-0.16.0 proto-plus-1.20.3 protobuf-3.19.4 psycopg2-2.8.5 pyarrow-6.0.1 pyasn1-0.4.8 pyasn1-modules-0.2.8 pycparser-2.21 pydata-google-auth-1.3.0 pyparsing-3.0.7 python-dateutil-2.8.2 pytz-2021.3 requests-2.24.0 requests-oauthlib-1.3.1 rsa-4.8 setuptools-60.9.3 six-1.16.0 sqlalchemy-1.3.23 urllib3-1.25.10
14:15:11 <func_name_1>: WARNING: You are using pip version 20.2.3; however, version 22.0.3 is available.
14:15:11 <func_name_1>: You should consider upgrading via the '/tmp/oryx/platforms/python/3.7.12/bin/python3.7 -m pip install --upgrade pip' command.
14:15:11 <func_name_1>: Done in 43 sec(s).
14:15:11 <func_name_1>: Copying files to destination directory '/home/site/wwwroot'...
14:15:15 <func_name_1>: Done in 4 sec(s).
14:15:15 <func_name_1>: Removing existing manifest file
14:15:15 <func_name_1>: Creating a manifest file...
14:15:16 <func_name_1>: Manifest file created.
14:15:16 <func_name_1>: Done in 52 sec(s).
14:15:16 <func_name_1>: Running post deployment command(s)...
14:15:16 <func_name_1>: Triggering recycle (preview mode disabled).
14:15:16 <func_name_1>: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
14:15:16 <func_name_1>: To check our service limit, please visit https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
14:15:16 <func_name_1>: Creating placeholder blob for linux consumption function app...
14:15:16 <func_name_1>: SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-<func_name_1>.zip located
14:15:16 <func_name_1>: Writing the artifacts to a squashfs file
14:15:28 <func_name_1>: Parallel mksquashfs: Using 1 processor
14:15:28 <func_name_1>: Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072.
14:15:31 <func_name_1>: [==================-                                           ] 2800/9135  30%
14:16:02 <func_name_1>: [====================/                                         ] 3000/9135  32%
14:16:07 <func_name_1>: [=============================================================\] 9135/9135 100%
14:16:07 <func_name_1>: Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
14:16:07 <func_name_1>:     compressed data, compressed metadata, compressed fragments, compressed xattrs
14:16:07 <func_name_1>:     duplicates are removed
14:16:07 <func_name_1>: Filesystem size 75358.45 Kbytes (73.59 Mbytes)
14:16:07 <func_name_1>:     29.67% of uncompressed filesystem size (253949.91 Kbytes)
14:16:07 <func_name_1>: Inode table size 84814 bytes (82.83 Kbytes)
14:16:07 <func_name_1>:     29.29% of uncompressed inode table size (289612 bytes)
14:16:07 <func_name_1>: Directory table size 84397 bytes (82.42 Kbytes)
14:16:07 <func_name_1>:     36.16% of uncompressed directory table size (233373 bytes)
14:16:07 <func_name_1>: Number of duplicate files found 521
14:16:07 <func_name_1>: Number of inodes 8873
14:16:07 <func_name_1>: Number of files 8006
14:16:07 <func_name_1>: Number of fragments 773
14:16:07 <func_name_1>: Number of symbolic links  0
14:16:07 <func_name_1>: Number of device nodes 0
14:16:07 <func_name_1>: Number of fifo nodes 0
14:16:07 <func_name_1>: Number of socket nodes 0
14:16:07 <func_name_1>: Number of directories 867
14:16:07 <func_name_1>: Number of ids (unique uids + gids) 1
14:16:07 <func_name_1>: Number of uids 1
14:16:07 <func_name_1>:     root (0)
14:16:07 <func_name_1>: Number of gids 1
14:16:07 <func_name_1>:     root (0)
14:16:07 <func_name_1>: Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app...
14:16:09 <func_name_1>: Resetting all workers for <func_name_1>.azurewebsites.net
14:16:09 <func_name_1>: Deployment successful.
14:16:28 <func_name_1>: Syncing triggers...
14:16:33 <func_name_1>: Querying triggers...
14:16:35 <func_name_1>: No HTTP triggers found.

在2號賬號部署function app的output:

16:38:30 <func_name_2>: Starting deployment...
16:38:33 <func_name_2>: Creating zip package...
16:38:34 <func_name_2>: Zip package size: 597 kB
16:38:35 <func_name_2>: Fetching changes.
16:38:36 <func_name_2>: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/edc7f1e2-d15f-4e62-ad4a-abe9993f4fbe.zip (0.57 MB) to /tmp/zipdeploy/extracted
16:38:38 <func_name_2>: Updating submodules.
16:38:39 <func_name_2>: Preparing deployment for commit id '87613accff'.
16:38:39 <func_name_2>: Repository path is /tmp/zipdeploy/extracted
16:38:39 <func_name_2>: Running oryx build...
16:38:39 <func_name_2>: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.7 -p packagedir=.python_packages/lib/site-packages
16:38:41 <func_name_2>: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
16:38:41 <func_name_2>: You can report issues at https://github.com/Microsoft/Oryx/issues
16:38:41 <func_name_2>: Oryx Version: 0.2.20201015.1, Commit: 1a35fbce482b20b71290f3a837a3469803ce4b44, ReleaseTagName: 20201015.1
16:38:41 <func_name_2>: Build Operation ID: |y5J5WXgD8ag=.a9990db3_
16:38:41 <func_name_2>: Repository Commit : 87613accff174b0189b03a7e7bd5845c
16:38:41 <func_name_2>: Detecting platforms...
16:38:43 <func_name_2>: Detected following platforms:
16:38:43 <func_name_2>:   python: 3.7.12
16:38:43 <func_name_2>: Version '3.7.12' of platform 'python' is not installed. Generating script to install it...
16:38:44 <func_name_2>: Warning: An outdated version of python was detected (3.7.12). Consider updating.
16:38:44 <func_name_2>: Versions supported by Oryx: https://github.com/microsoft/Oryx
16:38:44 <func_name_2>: Source directory     : /tmp/zipdeploy/extracted
16:38:44 <func_name_2>: Destination directory: /home/site/wwwroot
16:38:44 <func_name_2>: Downloading and extracting 'python' version '3.7.12' to '/tmp/oryx/platforms/python/3.7.12'...
16:38:45 <func_name_2>: Downloaded in 1 sec(s).
16:38:45 <func_name_2>: Verifying checksum...
16:38:45 <func_name_2>: Extracting contents...
16:38:51 <func_name_2>: Done in 7 sec(s).
16:38:51 <func_name_2>: Python Version: /tmp/oryx/platforms/python/3.7.12/bin/python3.7
16:38:51 <func_name_2>: Running pip install...
16:39:22 <func_name_2>: [15:39:22+0000] Successfully built psycopg2
16:39:22 <func_name_2>: [15:39:22+0000] Installing collected packages: six, chardet, urllib3, certifi, idna, requests, azure-core, azure-functions, oauthlib, requests-oauthlib, isodate, msrest, pycparser, cffi, cryptography, azure-storage-blob, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, protobuf, googleapis-common-protos, google-api-core, google-auth-oauthlib, pyparsing, packaging, proto-plus, python-dateutil, google-crc32c, google-resumable-media, google-cloud-core, grpcio, google-cloud-bigquery, google-cloud-bigquery-storage, grpcio-status, PyJWT, msal, numpy, pytz, pandas, pyarrow, setuptools, pydata-google-auth, pandas-gbq, psycopg2, SQLAlchemy
16:39:40 <func_name_2>: [15:39:40+0000] Successfully installed PyJWT-1.7.1 SQLAlchemy-1.3.23 azure-core-1.22.1 azure-functions-1.9.0 azure-storage-blob-12.9.0 cachetools-5.0.0 certifi-2021.10.8 cffi-1.15.0 chardet-3.0.4 cryptography-3.4.6 google-api-core-2.5.0 google-auth-2.6.0 google-auth-oauthlib-0.4.6 google-cloud-bigquery-2.31.0 google-cloud-bigquery-storage-2.12.0 google-cloud-core-2.2.2 google-crc32c-1.3.0 google-resumable-media-2.2.1 googleapis-common-protos-1.54.0 grpcio-1.44.0 grpcio-status-1.44.0 idna-2.10 isodate-0.6.1 msal-1.8.0 msrest-0.6.21 numpy-1.19.1 oauthlib-3.2.0 packaging-21.3 pandas-1.1.0 pandas-gbq-0.16.0 proto-plus-1.20.3 protobuf-3.19.4 psycopg2-2.8.5 pyarrow-6.0.1 pyasn1-0.4.8 pyasn1-modules-0.2.8 pycparser-2.21 pydata-google-auth-1.3.0 pyparsing-3.0.7 python-dateutil-2.8.2 pytz-2021.3 requests-2.24.0 requests-oauthlib-1.3.1 rsa-4.8 setuptools-60.9.3 six-1.16.0 urllib3-1.25.10
16:39:40 <func_name_2>: WARNING: You are using pip version 20.2.3; however, version 22.0.3 is available.
16:39:40 <func_name_2>: You should consider upgrading via the '/tmp/oryx/platforms/python/3.7.12/bin/python3.7 -m pip install --upgrade pip' command.
16:39:40 <func_name_2>: Done in 49 sec(s).
16:39:40 <func_name_2>: Copying files to destination directory '/home/site/wwwroot'...
16:39:46 <func_name_2>: Done in 6 sec(s).
16:39:46 <func_name_2>: Removing existing manifest file
16:39:46 <func_name_2>: Creating a manifest file...
16:39:46 <func_name_2>: Manifest file created.
16:39:46 <func_name_2>: Done in 62 sec(s).
16:39:47 <func_name_2>: Running post deployment command(s)...
16:39:50 <func_name_2>: Triggering recycle (preview mode disabled).
16:39:53 <func_name_2>: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
16:39:54 <func_name_2>: To check our service limit, please visit https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
16:39:54 <func_name_2>: Creating placeholder blob for linux consumption function app...
16:39:54 <func_name_2>: Malformed SCM_RUN_FROM_PACKAGE when uploading built content.
16:40:19 <func_name_2>: Deployment failed.

第二個帳戶上的 function 應用程序是在部署過程之前創建的。 我試圖將它部署到同一帳戶上的另一個 function 應用程序 - 同樣的錯誤。

我也嘗試過這里提到的方法。

我在第二個帳戶的 function 應用程序中運行命令:

func azure functionapp publish <func_name_2> --build remote

output 是: --build remote 的輸出 function 應用程序創建於 2 天前。 如果資源組創建日期早於上述2019年8月1日,是否會導致這種情況? (我不知道資源組的創建日期)

然后,我運行了命令:

func azure functionapp publish <func_name_2> --build local

我得到了錯誤: --build local 的輸出 對於我來說,這個錯誤沒有任何意義,因為這個程序部署在第一個帳戶的功能應用程序上。

PS:兩個賬號的function app上的配置是一樣的。

歡迎任何提示如何解決這個問題。

問題出在 function 應用程序創建中。

  • 部署不適用於通過 Azure 門戶創建的 function 應用程序。
  • 部署適用於通過 Visual Studio Code 創建的 function 應用程序。

*兩個選項的參數設置相同。

但我仍然對 function 應用程序創建出現這種差異的原因感興趣。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM