[英]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?这里可能有什么问题?
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这里要确保三件事
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.