Azure Web App node.js deployment failure - azure

I am trying to deploy a node.js application as Web App via git continuous deployment. The deployment fails with errors like below
remote: npm ERR! fetch failed https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz
remote: npm ERR! fetch failed https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz
remote: npm ERR! fetch failed https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz
remote: npm ERR! fetch failed https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz
remote: npm ERR! fetch failed https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz
Any one know whats causing this ?

Are you using any systems that could be affected by the DDoS attack today? I also have had deploy errors today because of these attacks. I am using a combination of GitHub, Heroku, and Codeship, and I am sure Azure being a microsoft product / US based could also be experiencing problems.
http://www.cnbc.com/2016/10/21/major-websites-across-east-coast-knocked-out-in-apparent-ddos-attack.html

Related

Heroku Build Failure for Discord.js bot

I have been coding a bot using discord.js, visual studio code, and node.js, and I have been trying to host it on Heroku. However, the log in my Heroku project claim that my build is failing, and it is giving the following message when I view the build log of the failure:
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> #discordjs/opus#0.5.0 install /tmp/build_0229f43f/node_modules/#discordjs/opus
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! #discordjs/opus#0.5.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the #discordjs/opus#0.5.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.q9Do7/_logs/2021-04-19T19_49_08_993Z-debug.log
-----> Build failed
Also, the more recent changes that I have made to my bot, like adding aliases to commands and changing the ping of my announce command, don't apply when I run the bot off of Heroku, but do work when I run the bot locally, and I think that the build failure may be the reason behind this. I may be wrong, but I am still relatively new to coding Discord bots. How can I fix the build failure?
I've been searching for a solution to this problem all day.
I finally found it:
While hosting your bot on heroku you can use "discord-music-player" instead of #discordjs/opus or opusscript. Tell me if it worked for you!
#discordjs/opus is not allowed on Heroku afaik.
Use opusscript instead if you really need to use music.
But as devs mentioned, #discordjs/opus is much better peformance wise so I recommend searching for another hosting solution if you want the audio streaming functionalities.
Prebuild detected (node_modules already exists) you need to hide your node_modules using .gitignore in your folder project

Heroku gives me webpack and node js error on push

Heroku gives me errors suddenly,
It worked fine for about a month with same settings, yesterday after editing some minor things in the project and uploading to git it gave me error when pushing to heroku master:
Creating an optimized production build...
Failed to compile.
./src/sections/welcome/welcome.css
Error: Didn't get a result from child compiler
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ghvinieri#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ghvinieri#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.KO8no/_logs/2019-03-20T10_43_07_497Z-debug.log
-----> Change to Node.js build process
Heroku has begun executing the "build" script defined in package.json
during Node.js builds.
Read more: https://devcenter.heroku.com/changelog-items/1573
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I tried putting node version in package.json, deleting package.json, node_modules are included in gitigonre, even tried to copy repo from heroku master which contained older code that works on heroku right now, then editing it and uploading; it still gives error, it makes no sense to me. it works on heroku right now with the same settings though when I upload with a minor change it gives errors. could anyone help me with this? Im stuck, looked up all possible solutions none of them work.

Jenkins deployment

I am getting the below mentioned error when i am trying to build my app through Jenkins.
remote: npm ERR! code EINTEGRITY
remote: npm ERR! sha512-d7r5njiOKUND9m1FbjCtIzYGUD7hl9sdyvbH3OsDqR3aW+XB7qmZPQ+uQWBNYh+h8Zm9G6e2eDJjx0evOTe9xQ== integrity checksum failed when using sha512: wanted sha512-d7r5njiOKUND9m1FbjCtIzYGUD7hl9sdyvbH3OsDqR3aW+XB7qmZPQ+uQWBNYh+h8Zm9G6e2eDJjx0evOTe9xQ== but got sha512-gXvGMnj54hIhBsUUrFBgXzhCe84xaGpMACqvW4ViF4j0n2xXO+IwWPPkal17FUvVrzd82sXqFAWDGXdasEFGrw==. (1163 bytes)
How to solve this issue?
Thanks
I'm having this problem as well (angular 7 npm 5.6). When I manually run npm install on our CI server, everything is fine. When Jenkins builds automatically on the the same server, I get the EINTEGRITY error.

Installing Node.js modules from file system on Azure Websites

I have a Node.js app running as an Azure Website and doing my deployments using Git. The app requires a module that's private (i.e. written by me, no relevance to anyone else and thus not available in NPM) and common to my other projects. Let's say the module is located in ./lib/mymodule and it has its own dependencies in its package.json file. The problem is I cannot figure out how to have Azure install the dependencies of my own module. I would like to avoid having to add my node_modules directory under version control (currently .gitignor'd) or having to add the module's dependencies as my app's dependencies (which is ugly and a bit inconvenient).
It's trivial to get this working on my local dev environment. The first thing I did was simply include my own module as a local dependency in my package.json as described in https://docs.npmjs.com/files/package.json (see section "Local Paths"). A simple npm install would now install my own module nice and easy. Since I know that Azure runs npm install every time I deploy a new version, I figured this is all I need. Turns out I was wrong: local paths in package.json dependencies section were only introduced in NPM 2.0.0 and Azure is running NPM 1.4.x, so the deployment obviously failed. Ok then, can I run a different version of NPM in Azure? In theory, yes, but practice seems to be something else. I tried out https://github.com/glennblock/azure-node-runtime-selector but to no avail. Here's some of the deployment output:
remote: Handling node.js deployment.
remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
remote: ............
remote: node version: 0.11.14
remote: ..............
remote: 2.1.18
remote: npm version: 1.4.6
remote: An error has occured during web site deployment.
remote: npm failed
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
Apparently it fails to install any NPM version >= 2.0.0.
Ok then, this is not so bad, I figured. I can work with an older version of NPM, I just need to run another npm install to install my own module, as NPM documentation hints. So I took the local dependency away from my package.json and simply run npm install ./lib/mymodule. Nice and easy... on my local. I dug up instructions how to run custom commands on deployment in Azure: just run azure site deploymentscript --node and edit deploy.sh it creates. Just to ensure the custom deployment script works at all, I made one deployment without editing anything. Worked ok. Then I added a line in deploy.sh (around line 111):
# 3. Install npm packages
if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then
cd "$DEPLOYMENT_TARGET"
eval $NPM_CMD install --production
eval $NPM_CMD install ./lib/mymodule #This line added by me
exitWithMessageOnError "npm failed"
cd - > /dev/null
fi
Nope. This is what I get:
remote: Installing npm packages...
remote: npm ERR! addLocal Could not install ./lib/mymodule
remote: An error has occurred during web site deployment.
remote: npm ERR! Error: ENOENT, stat 'd:\home\site\wwwroot\lib\mymodule'
remote: npm failed
...snip...
remote:
remote: npm ERR! System Windows_NT 6.2.9200
remote: npm ERR! command "d:\\Program Files (x86)\\nodejs\\0.10.28\\node.exe" "D:\\Program Files(x86)\\npm\\1.4.9\\node_modules\\npm\\bin\\npm-cli.js" "install" "./lib/mymodule"
remote: npm ERR! cwd d:\home\site\wwwroot
remote: npm ERR! node -v v0.10.28
remote: npm ERR! npm -v 1.4.9
remote: npm ERR! path d:\home\site\wwwroot\lib\mymodule
remote: npm ERR! code ENOENT
remote: npm ERR! errno 34
remote: npm
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
This is where I got stuck. I tried playing around with the path, guessing that Windows is mangling it somehow, but haven't found a working solution yet. The weird thing is that ./lib/mymodule would seem to resolve to d:\home\site\wwwroot\lib\mymodule which look just fine to me and DOES exist, at least after deployment when I FTP'd in to take a look.
I would appreciate any and all help in either getting NPM 2.x.x working or my making custom deployment go through. Or maybe there's an alternative to managing my local modules I haven't thought of? And if all else fails, maybe I'll just commit my node_modules or manage my dependencies manually. I've already used way too much time to resolve what first seemed like a trivial issue. :)
Azure WebSites team will be shipping support for npm 2.1.17 out-of-the box by end of the month (Jan'15). Hope this will help you unblock you.

Azure Website: Kudu fails to install

I started to run into this problem yesterday. Deploys fail when I run:
npm install kudusync -g
with the following error:
Error: SSL Error: CERT_UNTRUSTED
From some searches it appears that one of Kudu's dependencies is self-signed or unsigned. It seems like I can disable SSL checks for Node -- but that seems like a dangerous option and not recommended. Is anyone aware of any other workarounds?
The output in azure is as follows:
remote: npm http GET https://registry.npmjs.org/kudusync[K
remote: ......[K
remote: npm http GET https://registry.npmjs.org/kudusync[K
remote: .......................................................[K
remote: npm http GET https://registry.npmjs.org/kudusync[K
remote: npm ERR! Error: SSL Error: CERT_UNTRUSTED[K
remote: npm ERR! at ClientRequest. (d:\Program Files (x86)\nodejs\node_modules\npm\node_modules\request\main.js:440:26)[K
remote: An error has occurred during web site deployment.[K
The break most likely refers to this change npm made.
Do you have a custom deployment script, or the standard script? With custom, your options are:
use a newer version of npm
run npm config set strict-ssl false before running npm
if your custom script has a reference to KUDU_SYNC_COMMAND, rename that to KUDU_SYNC_CMD

Resources