简体   繁体   English

Azure App Service .net6 部署 - 错误:EISDIR:对目录进行非法操作,打开“/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE”

[英]Azure App Service .net6 Deploy - Error: EISDIR: illegal operation on a directory, open '/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE'

I updated my Asp.net core Blazor WebAssembly app to .net 6. Everything is fine, but the deploy from github actions doesn't work and throws this error:我将我的 Asp.net 核心 Blazor WebAssembly 应用程序更新为 .net 6. 一切都很好,但是从 github 操作部署不起作用并抛出此错误:

...
Copying file: 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.dll'
Copying file: 'Microsoft.AspNetCore.Authentication.JwtBearer.dll'
Omitting next output lines...
Error: EISDIR: illegal operation on a directory, open '/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE'
An error has occurred during web site deployment.
Kudu Sync failed
\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

What could be a problem here?这里可能有什么问题?

  • app works on local应用程序适用于本地
  • I updated the azure app to .net6 in configuration我在配置中将 azure 应用更新为 .net6
  • I tried to restart the app我试图重新启动应用程序
  • the app is in Central US region该应用程序位于美国中部地区

EDIT/SOLUTION :编辑/解决方案

Previously the path to licence file was: /home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE/LICENSE new file was without the LICENSE dir.以前许可证文件的路径是: /home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE/LICENSE新文件没有LICENSE目录。 So when the new version of app arrived it tried to update the LICENSE file, which was actually a directory.因此,当新版本的应用程序到达时,它会尝试更新 LICENSE 文件,该文件实际上是一个目录。 Removing LICENSE/LICENSE helped.删除LICENSE/LICENSE帮助。

I ended up deleting the contents of /home/site/wwwroot/ to resolve this as well.我最终也删除了 /home/site/wwwroot/ 的内容来解决这个问题。 I also needed to update the configuration to .NET 6 in the site's configuration and redeploy before my site started working.我还需要将站点配置中的配置更新为 .NET 6,并在我的站点开始工作之前重新部署。

  • On Linux, it's important that any bash deployment scripts that get run have Unix line endings (LF) and not Windows line endings (CRLF).在 Linux 上,任何运行的 bash 部署脚本都必须具有 Unix 行尾 (LF) 而不是 Windows 行尾 (CRLF),这一点很重要。

  • Kuduscript will generate scripts with platform-appropriate line endings, but if those scripts are modified, or if you provide your own custom deployment scripts , it's important to make sure that your editor doesn't change the line endings. Kuduscript 将生成带有适合平台的行尾的脚本,但如果这些脚本被修改,或者如果您提供自己的自定义部署脚本,请务必确保您的编辑器不会更改行尾。

  • If something seems off with your deployment script, you can always use the Kudu console to delete the contents of /home/site/deployments/tools.如果您的部署脚本出现问题,您可以随时使用 Kudu 控制台删除 /home/site/deployments/tools 的内容。

  • This is the directory where Kudu caches kuduscript-generated deployment scripts.这是 Kudu 缓存 kuduscript 生成的部署脚本的目录。 On the next deployment, the script will be regenerated.在下一次部署时,将重新生成脚本。

  • The error you're currently seeing is a Kudu issue with running node/npm for deployments.您当前看到的错误是运行 node/npm 进行部署的 Kudu 问题。

  • The easiest and fastest resolution for what you are currently seeing is to specify engines.node in your package.json.您当前看到的最简单和最快的解决方法是在 package.json 中指定engine.node

Error: EISDIR: illegal operation on a directory, open '/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE'错误:EISDIR:对目录进行非法操作,打开“/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE”

EISDIR stands for " Error, Is Directory ". EISDIR代表“错误,是目录”。 This means that NPM is trying to do something to a file but it is a directory .这意味着 NPM 试图对一个文件做一些事情,但它是一个目录 In your case, NPM is trying to " read " a file which is a directory.在您的情况下,NPM 试图“读取”一个目录文件。 Since the operation cannot be done the error is thrown.由于操作无法完成,因此抛出错误。

Three things to make sure here这里要确保三件事

  1. Make sure the file exists.确保文件存在。 If it does not, you need to create it.如果没有,您需要创建它。 (If NPM depends on any specific information in the file, you will need to have that information there). (如果 NPM 依赖于文件中的任何特定信息,您将需要在那里拥有该信息)。
  2. Make sure it is in fact a file and not a directory.确保它实际上是一个文件而不是目录。
  3. It has the right permissions.它具有正确的权限。 You can change the file to have all permissions with "sudo chmod 777 FILE_NAME".您可以使用“sudo chmod 777 FILE_NAME”将文件更改为具有所有权限。

Note : You are giving Read, Write and Execute permissions to every one on that file.注意:您正在为该文件的每个人授予读取、写入和执行权限。

The underlying issue seems to be updating Microsoft.AspNetCore.Identity.UI from version 5.* to version 6+.根本问题似乎是将 Microsoft.AspNetCore.Identity.UI 从版本 5.* 更新到版本 6+。 What worked for me was just reverting Microsoft.AspNetCore.Identity.UI to 5.0.17.对我有用的只是将 Microsoft.AspNetCore.Identity.UI 恢复到 5.0.17。

Hopefully there is a permanent fix in the package that will allow keep希望包中有一个永久修复程序,允许保留

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序“D:\home\site\wwwroot\”在检测到 app_offline.htm 后被回收 - ASP.NET - Application 'D:\home\site\wwwroot\' was recycled after detecting app_offline.htm - ASP.NET 如何在web.config中引用wwwroot路径文件-Azure应用服务 - How to refer wwwroot path files in web.config - Azure App service 如何在不知道构建配置的情况下将.net核心应用程序的bin目录中的EXE复制到wwwroot中? - How to copy an EXE from a .net core app's bin directory into wwwroot without knowing the build configuration? 更新到 Asp.Net Core 3 的 Identity 项目提供了 wwwroot 文件夹 - Identity project updated to Asp.Net Core 3 gives wwwroot folder “wwwroot”文件夹中的某些文件未在 ASP.NET 核心 web 部署中发布 - Some files in "wwwroot" folder are not published in ASP.NET Core web deploy Azure AD B2C 和常规 (SQL) Identity.Net6 - Azure AD B2C and regular (SQL) Identity .Net6 使用 ajax dot net 6 core 将文件上传到 wwwroot - upload file to wwwroot with ajax dot net 6 core wwwroot中的vNext / .NET5 config.json - vNext / .NET5 config.json in wwwroot 将 .NET 核心 MVC 应用程序部署到 IIS,应用程序正在运行,但未加载 wwwroot 中的 Static 文件 - Deployed .NET Core MVC Application to IIS, App is running, but Static files in wwwroot are not being loaded 列出 wwwroot static 图像时出现错误 - Error accrued when list wwwroot static images
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM