【应用服务 App Service】App Service使用Git部署时,遇见500错误

简介: 【应用服务 App Service】App Service使用Git部署时,遇见500错误

问题描述

Azure App Service在部署的时候支持多种方式,如Zip,VS 2019, VS Code,或者是Git部署,当使用Git部署遇见500错误时,可以通过其他的部署方式来验证是否也同样不可以成功。也可以直接登录到Kudu站点,拖拽文件的方式部署站点。

如以下图片就是在使用Git部署时候遇见的错误:

由于这里的错误信息只是返回500,而没有跟多详细的错误日志,所以可以通过 git log -p 命令打印出全部日志。查看是否有可以定位错误的信息,在这次的500错误中,git 日志中没有任何错误描述。

所以针对以上的问题,需要换一种方式来发布文件。查看是否可以发布成功。

最终解决

在后期的继续分析中,发现是App Service的磁盘空间已被占满,出现了OnErrorRequest System.IO.IOException: There is not enough space on the disk的信息,这下就非常明确是磁盘空间不够,解决办法就是清理文件或者是把App Service的定价层升级。得到更多的存储空间。

 

如果想了解更多关于App Service 文件系统,可以查看github文档:https://github.com/projectkudu/kudu/wiki/Understanding-the-Azure-App-Service-file-system

Understanding the Azure App Service file system

There are three main types of files that an Azure Web App can deal with

Persisted files

This is what you can view as your web site's files. They follow a structure described here. They are rooted in d:\home, which can also be found using the %HOME% environment variable. For App Service on Linux and Web app for Containers, persistent storage is rooted in /home.

These files are persistent, meaning that you can rely on them staying there until you do something to change them. Also, they are shared between all instances of your site (when you scale it up to multiple instances). Internally, the way this works is that they are stored in Azure Storage instead of living on the local file system.

Free and Shared sites get 1GB of space, Basic sites get 10GB, and Standard sites get 50GB. See more details on the Web App Pricing page.

Temporary files

A number of common Windows locations are using temporary storage on the local machine. For instance

  • %APPDATA% points to something like D:\local\AppData.
  • %TMP% goes to D:\local\Temp.

Unlike Persisted files, these files are not shared among site instances. Also, you cannot rely on them staying there. For instance, if you restart a web app, you'll find that all of these folders get reset to their original state.

For Free, Shared and Consumption (Functions) sites, there is a 500MB limit for all these locations together (i.e. not per-folder).

For Standard and Basic sites, the limit is higher and differs depending on the SKU. The limit applies to all sites in the same App Service Plan. For instance, if you have 10 sites in S2 App Service Plan, those sites (and their scm sites) will have a combined limit of 15 GB. See limit for other SKU below.

SKU Family B1/S1/etc. B2/S2/etc. B3/S3/etc.
Basic, Standard, Premium 11 GB 15 GB 58 GB
PremiumV2, Isolated 21 GB 61 GB 140 GB

Another important note is that the Main site and the scm site do not share temp files. So if you write some files there from your site, you will not see them from Kudu Console (and vice versa). You can make them use the same temp space if you disable separation (via WEBSITE_DISABLE_SCM_SEPARATION). But note that this is a legacy flag, and its use is not recommended/supported.

You can check your limit and usage in portal by going to "Diagnose and solve problems" section of your App Service blade, selecting "Best Practices", "Best Practices for Availability, Performance", and then "Temp File Usage On Workers". Please note that the displayed usage and limits are per worker, and are aggregated across all apps in the same app service plan.

Machine level read-only files

The Web App is able to access many standard Windows locations like %ProgramFiles% and %windir%. These files can never be modified by the Web App.

相关文章
|
7天前
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
31 11
|
8天前
|
JavaScript C++ 容器
【Azure Bot Service】部署NodeJS ChatBot代码到App Service中无法自动启动
2024-11-12T12:22:40.366223350Z Error: Cannot find module 'dotenv' 2024-11-12T12:40:12.538120729Z Error: Cannot find module 'restify' 2024-11-12T12:48:13.348529900Z Error: Cannot find module 'lodash'
32 11
|
7天前
|
开发框架 监控 .NET
【Azure App Service】部署在App Service上的.NET应用内存消耗不能超过2GB的情况分析
x64 dotnet runtime is not installed on the app service by default. Since we had the app service running in x64, it was proxying the request to a 32 bit dotnet process which was throwing an OutOfMemoryException with requests >100MB. It worked on the IaaS servers because we had the x64 runtime install
|
5天前
|
Java 开发工具 Windows
【Azure App Service】在App Service中调用Stroage SDK上传文件时遇见 System.OutOfMemoryException
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
|
6天前
|
安全 Apache 开发工具
【Azure App Service】在App Service上关于OpenSSH的CVE2024-6387漏洞解答
CVE2024-6387 是远程访问漏洞,攻击者通过不安全的OpenSSh版本可以进行远程代码执行。CVE-2024-6387漏洞攻击仅应用于OpenSSH服务器,而App Service Runtime中并未使用OpenSSH,不会被远程方式攻击,所以OpenSSH并不会对应用造成安全风险。同时,如果App Service的系统为Windows,不会受远程漏洞影响!
|
30天前
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
451 7
|
30天前
|
小程序 JavaScript 前端开发
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
500 1
|
16天前
|
小程序 数据挖掘 UED
开发1个上门家政小程序APP系统,都有哪些功能?
在快节奏的现代生活中,家政服务已成为许多家庭的必需品。针对传统家政服务存在的问题,如服务质量不稳定、价格不透明等,我们历时两年开发了一套全新的上门家政系统。该系统通过完善信用体系、提供奖励机制、优化复购体验、多渠道推广和多样化盈利模式,解决了私单、复购、推广和盈利四大痛点,全面提升了服务质量和用户体验,旨在成为家政行业的领导者。
|
1月前
|
JavaScript 前端开发 小程序
uniapp一个人开发APP关键步骤和考虑因素
uniapp一个人开发APP关键步骤和考虑因素
121 1
uniapp一个人开发APP关键步骤和考虑因素
|
30天前
|
JavaScript 前端开发 UED
Vue与uni-app开发中通过@font-face巧妙引入自定义字体
Vue与uni-app开发中通过@font-face巧妙引入自定义字体
70 9