Closed Sobieck closed 5 years ago
@sanchitmehta mind taking a look at this?
We ended up solving this problem by simply building the node app in a linux instance of appveyor and zipping it using bash. Everything unzips and deploys correctly now.
I have the exact same problem. This has made deployments unreliable.
I use powershell on Windows to zip and deploy to a linux instance, and I keep getting the error:
{
"log_time": "2019-11-05T11:48:36.5265008Z",
"id": "",
"message": "Copying file: 'assets\\libraries\\styles\\toastify.min.css'",
"type": 0,
"details_url": null
},
{
"log_time": "2019-11-05T11:48:36.5403084Z",
"id": "",
"message": "Error: EINVAL: invalid argument, open '/home/site/wwwroot/assets\\libraries\\js\\toastify-js.js'",
"type": 0,
"details_url": null
},
{
"log_time": "2019-11-05T11:48:36.5725687Z",
"id": "",
"message": "\\n/opt/Kudu/Scripts/starter.sh kudusync -v 50 -f /tmp/zipdeploy/extracted -t /home/site/wwwroot -n /home/site/deployments/5dfd905a2b95475dbbf671b7b600095d/manifest -p /opt/Kudu/Scripts/firstDeploymentManifest -i \".git;.hg;.deployment;.deploy.sh\"",
"type": 2,
"details_url": null
}
@sarathkcm This is because PowerShell uses backward slash to encode the zip files. This used to previously work since we used .NET based Kudu on Mono which could interepret backward slashes. Typically, we recommend using a cross platform archive to zip the app to be deployed on Kudu on Linux which uses cross-platform forward slashes to encode the zip. One of the possible libraries you could use is 7zip .
@sanchitmehta It works with 7-zip. Thank you.
@sarathkcm This is because PowerShell uses backward slash to encode the zip files. This used to previously work since we used .NET based Kudu on Mono which could interepret backward slashes. Typically, we recommend using a cross platform archive to zip the app to be deployed on Kudu on Linux which uses cross-platform forward slashes to encode the zip. One of the possible libraries you could use is 7zip .
Thank you very much !! This saved me tons of time debugging
We've been using zip deploy on linux for months successfully. There has been no change in how our pipeline works. Our last successful deploy with this pipeline was 10/15/2019. I believe the first time my build failed was 10/18/2019. I’m not sure though. All our changes lately have been very minor.
We build the node application on a windows instance in appveyor. It is zipped up using powershell and then deployed using zip deploy to a linux app service.
For some reason when kudu unzips the deployment zip it uses windows
\
for directories. Then the kudu deployment script attempts to copy those files into thewwwroot
folder and it can't. Here are the logs:Here is an image of the extracted folder:
The files not in directories copy to the
wwwroot
folder. The first file that is in a directory fails. I removed all the mapping files and type definitions while I was trying to figure this out. It just failed at the first.js
file in a directory.wwwroot
after deployment failed:I was able to deploy by stopping the node service, I used kudu bash to copy the zip file to the
wwwroot
folder from the/tmp/zipdeploy
folder, then unzip the zipfile using the ‘unzip’ command, and then restarting the service. This worked, but it isn’t ideal.