Home > OS >  Azure App Service .net6 Deploy - Error: EISDIR: illegal operation on a directory, open '/home/s
Azure App Service .net6 Deploy - Error: EISDIR: illegal operation on a directory, open '/home/s

Time:11-16

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:

...
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
  • I tried to restart the app
  • the app is in Central US region

EDIT: Previously the path to licence file was: /home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE/LICENSE new file was without the LICENSE dir. So when the new version of app arrived it tried to update the LICENSE file, which was actually a directory. Removing LICENSE/LICENSE helped.

CodePudding user response:

  • On Linux, it's important that any bash deployment scripts that get run have Unix line endings (LF) and not Windows line endings (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.

  • If something seems off with your deployment script, you can always use the Kudu console to delete the contents of /home/site/deployments/tools.

  • This is the directory where Kudu caches kuduscript-generated deployment scripts. 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.

  • The easiest and fastest resolution for what you are currently seeing is to specify engines.node in your package.json.

Error: EISDIR: illegal operation on a directory, open '/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE'

EISDIR stands for "Error, Is Directory". This means that NPM is trying to do something to a file but it is a directory. In your case, NPM is trying to "read" a file which is a directory. 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).
  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".

Note: You are giving Read, Write and Execute permissions to every one on that file.

  • Related