New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zip deploy fails randomly on node_modules files for Linux web app #2946
Comments
@michimune this is npm on Linux - could you help investigate this? |
I'm also facing this issue. Even i modified the deployment script to delete whole folder using this command " rm -rf /home/site/wwwroot/node_modules " Then i tried to ls from .bin folder: Anyway to solve this? this is npm on Linux - could you help investigate this? |
Try mounting a storage file share from a Storage account and see how it goes. |
How can i do that? No Storage account is associated with App service. I tried to check the /etc/fstab. But i can't check that from Kudu's bash. |
Open Azure portal, find the web app and go to its application settings.
Inside application settings, scroll to the bottom and you will see an
option to mount storage.
…On Tue 19 Mar, 2019, 9:21 AM Satheeshkumar Ravichandran, < ***@***.***> wrote:
Try mounting a storage file share from a Storage account and see how it
goes.
How can i do that? No Storage account is associated with App service. I
tried to check the /etc/fstab. But i can't check that from Kudu's bash.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2946 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGqYI0VeLNq2MaJVBKAP2lScCPcJM-iMks5vYF61gaJpZM4b2sK_>
.
|
i don't see any mounted partition there. Sorry but Why do you want to mount Storage Account? |
I fixed this issue by increasing the Instance Count to 2 and after few mins i reverted back to 1. So old instance got removed and new one stayed. Now the same deployment script is working fine. |
Didn't try the instance count hack. We ended up going for Windows Web app. |
I'm getting this error all of a sudden: ENOENT: no such file or directory, stat '/home/site/wwwroot/node_modules/.bin/npm' |
I second this thread, any idea on how to solve this issue? |
@rramachand21, could you help triage this? |
Also experiencing this. Different node module but same problem.
|
@suwatch, we will investigate this. |
I also have this problem: Error: ENOENT: no such file or directory, stat '/home/site/wwwroot/bundle/programs/server/node_modules/.bin/js-yaml' |
@AltarBeastiful @ivan133 @BrotherDonkey @ethubert @blueelvis : did it work before and is a recent problem, if yes since when did you start getting this problem? Could you please share your App Names so that we can investigate further ? Alternatively, you could skip the local/pipeline build and add this App Setting SCM_DO_BUILD_DURING_DEPLOYMENT= true and Kudu will build the artifacts |
@sanchitmehta - This has been happening since quite some time. The seems to arise because of so many files in an npm/php based project. When projects with less number of files is deployed using Zip-deployed, it doesn't happen. Seems like some sort of locking is done. We used to build locally and then push but it still used to fail. I don't have access to the website now as it was with an earlier client. |
I'm pretty sure it's connected with symlinks that are used in npm modules |
@ivan133 i'm also suspecting the same. Because when i tried to delete whole folder, except symlink everything get deleted. Also when i changed the App Service Plan from Standard to Premium i can able to delete those symlink files without any issue. |
I'm also facing similar issue. I'm trying to deploy standard generated strapi.io project from Azure DevOps to Azure Web App. It's node.js app.
What I found already:
|
I don't think this is the underlying issue, but my particular version of this problem was solved through the following steps:
It did not work if |
I am having this exact same issue, and none of the suggestions are working for me. I suspect it has to do with Symlinks as well, but I can't confirm that. |
We are investigating this issue and we would reply soon. @Laureian are you using App service on Linux? we recently optimized the npm install times(via Kudu) on Linux platform. Have you tried Kudu Builds recently? |
Yup, I was using App Service on Linux. For now, I switched to Web App for Containers and it's working fine. |
@sanchitmehta Any update on the investigation of this? I encountered this issue last week and can't seem to find a resolution. Switching to the Windows App Service isn't an option for my current project, unfortunately. |
I'm also waiting for an update as this is a blocker for Kudu Web apps. :( |
Context : I had to create a CI/CD pipeline for a project. The deployment failed on a linux machine on Azure.
Hope this helps anyone having problems with it |
I was having a similar problem with a PHP project that is using composer:
I had to remove the folders with symlinks from the zip package:
|
@nshumoogum WEBSITES_RUN_FROM_PACKAGE should be WEBSITE_RUN_FROM_PACKAGE |
@ustun - i am embarrassed, yes this worked for me; i should have double checked the variable name Thanks everyone who tried to help me :) |
this fixed my Python Flask issue
|
I was having the same issue ( |
@sanchitmehta - We are noticing similar error related to a missing module during the app startup - after using zip deploy option. The same version of code works fine in one environment, but gives an error related to a missing module in other. Per your recommendation , setting "WEBSITE_RUN_FROM_PACKAGE=1" helped fix the issue. But this makes the FS read only. Following up with you to see if the team has identified the root cause for the issue with zip deploy and possible timeline for fix rollout. Thanks for your help. |
@sanchitmehta - We are too now experiencing the (no such file or directory, open '/home/site/wwwroot/node_modules/.bin/xxx ) error. I have tried everything, recreated the Linux App, added WEBSITE_RUN_FROM_PACKAGE=1 into app settings, but nothing fixes the issue. Any ideas ? This is also not intermittant it seems to be every time ? Thanks John |
@nitinmb have you got any further in solving ? After i added the setting "WEBSITE_RUN_FROM_PACKAGE=1" I too get a missing module error ? |
Update pipeline with App Service Linux deployment recommendation for Zip Deploy. See projectkudu/kudu#2946
I am having a similar issue when using e.g.
is being linked to
where it should be
consequently, the deploy fails with |
I cleaned up the build artifact to only include packages necessary for production which had the side-affect of fixing this, as we don't need webpack there. But is the above expected behaviour? This is a build that was working previously (at least until it suddenly stopped working which is what led me to this issue) |
Azure Sucks... thats the problem. On AWS people can get work done plain and simple. Microsoft's warped architectures does nothing but hold you back. Maybe we just need a few more layers of crap on top of the other layers of crap to fix it? |
@jbeckton |
I've had so much trouble with Azure App Service on Linux. It's not a great experience setting up a node app there compared to deploying a .net application on a Windows service. I'm kind of upset about how much time I've wasted on this (I usually wouldn't express this on a GitHub issue, but it's a paid product). I'm concerned about what issues I may encounter in the future if setup was this bad. For this specific problem I encountered, I managed to workaround this after a lot of trial and error. Problem 1: After doing a deploy with symlinks, any deploy I tried after even without symlinks would fail, and web ssh didn't work. Was getting a Problem 2: Since a deploy with symlinks wrecked the server, what could be done to not deploy a zip with symlinks? I used this powershell script in my azure pipeline to do this: # Azure App Service Zip Deploy doesn't handle symlinks so inline
# all of them (https://github.com/projectkudu/kudu/issues/2946)
$links = dir . -recurse -force | ?{$_.LinkType}
foreach ($link in $links) {
# store these before removing the link, otherwise the properties will go to null
$source = $link.Target
$dest = $link.FullName
echo "Removing symbolic link at ${dest}..."
(Get-Item $dest).Delete()
echo "Copying ${source} to ${dest}..."
Copy-Item -Path $source -Destination $dest -Recurse
} |
For people still running into this while trying to deploy a Node app from Github, I thought I'd add the easiest work around I've found. I just created a This way the container will regenerate all of the symlinks before actually running your project. An example startup.sh script follows:
|
We have been working on a new Feature called App Cache. This feature is designed specifically to create a per instance copy of the App - while ensuring the symlinks are created during the extraction. This would also solve the |
Thanks @jake-subvrsive, I ended up with your solution which was indeed the simplest of all that I tried. |
@sanchitmehta Are there any updates on this? Do we still need to rely on the App Cache to get symlinks to work? |
@sanchitmehta Kudu version: When I deployed zip file contains symlinks, extracted symlink will result in a file with one line of content. For example At local or GitHub Action Agent
At Kudulite or Application Container
This file is not executable and cause error like below.
I found that there are BTW, I followed below document and have workaround by using dist/main.js instead of using node_modules/.bin/nest |
Hi If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: This way we can better track and assist you on this case Thanks, Joaquin Vano |
Repro steps.
I'm building a Nodejs 10.14 webservice using Azure Devops and deploying on Azure web app.
It works in local or in Azure container, now i'm trying to deploy it in a classic Web App for the sake of simplicity.
Right now my Zip deploys are flaky, giving me errors 3 out of 4 times, always on node_modules files.
My webservice is a classic express backend. The bcrypt module is the only fancyness in it.
I'm deploying a zip containing all node_modules installed and files built.
Project structures.
The closest boilerplate I could find :
https://github.com/icebob/vue-express-sql-boilerplate
The log/error given by the failure.
~75% of my zip deployments including a node_module ends with an error on a random file:
In the 5 failed deploy i had errors on:
node_modules/.bin/uglifyjs
,node_modules/.bin/sshpk-conv
,node_modules/.bin/escodegen
Debug your Azure website remotely.
My sub is cb539346a and the site name qa***pi
Other informations
I also tried to exclude the node_modules and add
npm install
in my post deployment steps. This doesn't work as bcrypt fails to compile. I didn't try much to make it work as I found documentation indicating the prefered way is to publish the node_modules folder.Right now I find it hard to publish a node app on Azure, is anybody else experiencing this ?
Thanks all !
The text was updated successfully, but these errors were encountered: