Skip to content
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

Issues with KuduSync on App Service #36

Open
jamiehs opened this issue Apr 1, 2019 · 4 comments
Open

Issues with KuduSync on App Service #36

jamiehs opened this issue Apr 1, 2019 · 4 comments

Comments

@jamiehs
Copy link

jamiehs commented Apr 1, 2019

Hey all,
I'm having an issue with KuduSync and some of our slots on Azure App service (Linux).

We have a Jenkins job that builds the project (static site from a React stack) and once this is built, it zips the essential files (the HTML, JS bundles, and other static assets) before being sent to App Service using the zip deploy API. From here it is deployed to an Express server that handles authentication and some other aspects.

The main thing that's happening is that the deploy is failing with the error: "An unknown error has occurred. Check the diagnostic log for details." this leads to a log that simply fails during KuduSync.

The symptom that we are seeing is that files will just be missing from the slot, and in some cases they are non-critical files like styles and fonts. It's not the same files each time either... It looks like a recursive copy failed partway through.

Something else that’s worth noting…
Our files in our builds are fingerprinted. Each time a file is modified, a hash is appended to the filename like this: main.eff568f.js it ensures that caching is invalidated if the contents of the file change.
In the KuduSync documentation, it says: “…will only copy changed files and delete files that don't exist in the destination but only if they were part of the previous deployment.”

This is concerning to me because it implies that fingerprinted files will never be deleted as they are not part of the previous deployment, and are not changed either. Fingerprinted files from the last deployment are at risk of being orphaned; (although ideally all files would be cleaned before a new deployment is copied into the web root). We originally tried to code around this issue, but we were unable to successfully run rm -rf on the directories in question prior to KuduSync due to some sort of permissions or folder depth limitation.

What would you suggest for completely cleaning the destination before "syncing" the new files into the App Service?

Are there any known limitations with KuduSync and the App Service (Linux) flavor?

@shrishrirang
Copy link
Contributor

Check the -x or --ignoreManifest option. You can find more details about it by running kudusync -h.

@jamiehs
Copy link
Author

jamiehs commented Apr 2, 2019

@shrishrirang This is a great start, thank you.

I'm now seeing a strange issue when attempting to ignore the node_modules folder. I've added it to the command like this, but none of these variants seem to be the correct form.

"$KUDU_SYNC_CMD" -v 50000 --ignoreManifest -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh;node_modules/*"

# these don't seem to work in the ignore list:
node_modules
node_modules/ <-- this causes things to hang until SCM_COMMAND_IDLE_TIMEOUT is reached
node_modules/*

Any ideas?

@shrishrirang
Copy link
Contributor

Doesn't kudusync -x -i "node_modules" ... work? Can you try to narrow it down by creating sample source and destination directories?

@ian-a-anderson
Copy link

I'm seeing Kudu sync failures during deployment to Linux App Service as well. I have an open ticket with MS Azure support, and they are indicating that whatever is happening is causing the Docker Container to restart - which kills the deployment. Not sure what exactly is causing the issue itself. Our Zip file has a lot of files (>10,000) since it's a WordPress site... maybe that's a factor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants