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

Deployment fails #30

Closed
kevinkuszyk opened this issue Apr 28, 2016 · 29 comments · Fixed by #34
Closed

Deployment fails #30

kevinkuszyk opened this issue Apr 28, 2016 · 29 comments · Fixed by #34

Comments

@kevinkuszyk
Copy link
Contributor

kevinkuszyk commented Apr 28, 2016

I just tried a couple of deploys, but both times it failed:

image

Are the any logs so I can try to help find a fix?

These are the screenshots from the Azure Portal:

image

image

@mtaanquist
Copy link

I am experiencing the same.

@bricin
Copy link

bricin commented May 3, 2016

Seems like it's getting worse... the primary dialog gets stuck on Step 1.

image

@kevinkuszyk
Copy link
Contributor Author

@davidebbo any chance you could have a look at this?

@davidebbo
Copy link
Contributor

Try looking at the Microsoft.Resources/deployments for the resource group in https://resources.azure.com/

@davidebbo
Copy link
Contributor

Other thing to try: after the failure, go to Portal under Deployment Source for the site, and look at the deployment log

@simoneriksson100
Copy link

I am getting the same failure error attempting to deploy. When looking at the deploy logs in Publishing -> Deploy source it shows the failure reason as "REASON 🔧 Update to Node v4". The log is attached.
azure_deploy_failure_04052016.txt

@davidebbo
Copy link
Contributor

Seems the errors all start with:

Selected npm version 3.5.1
npm ERR! fetch failed https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-2.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect EACCES 23.235.47.162:443 - Local (undefined:undefined)

I wonder if something changed on npm that messes it up. I'm guessing that trying to run npm install manually in site\wwwroot from Kudu console would fail in the same way?

@simoneriksson100
Copy link

I will do a bit more debugging in a little while, but it seems changing to http instead of https for the registry.npmjs.org fetches resolves the issue.

@felixrieseberg
Copy link
Owner

@davidebbo: Any reason why Web Apps wouldn't be able to establish a connection to npm? I don't think there's anything we can do from the repo here, is there?

@davidebbo
Copy link
Contributor

I can't think of any. We need to isolate this further. e.g.

  • when going to Kudu Console, does it completely fail to talk to the npm server even when doing a simple curl to those uri?
  • does it happen everywhere or just in some locations?

@kevinkuszyk
Copy link
Contributor Author

curl works for me in the Kudo Console:

image

but not npm install

image

Let me know if there's any more I can do my end to help identify the issue.

@davidebbo
Copy link
Contributor

davidebbo commented May 4, 2016

What if you directly try to install those same packages in Kudu Console? e.g. npm install -g wrappy. If that works, could there be anything special in the way npm runs in the context of the Ghost repo?

@kevinkuszyk
Copy link
Contributor Author

Well, that's odd:

image

I don't know enough about npm or how the Azure Web App machines are setup to know why that worked but npm install doesn't. Any ideas?

@davidebbo
Copy link
Contributor

I think it has to do with exceeding some connection quota in the sandbox. I need to dig deeper. Are you all seeing this on Free/Shared sites? In theory, this should not happen in Basic/Standard sites.

@mtaanquist
Copy link

mtaanquist commented May 4, 2016

I attempted to set up the Ghost install on a Free-tier, but I can try it out on a higher tier later. 

@mtaanquist
Copy link

Just tried to spin it up on a Basic tier, and that seemed to work correctly.

@davidebbo
Copy link
Contributor

Yes, here is the deal:

  • in Free/Shared mode, the sandbox caps the number of concurrent socket connections to 250, which normally is a lot. No cap in Basic/Standard.
  • but npm can go really crazy with opened connections, and in some cases can blow that cap, leading to connection failures

This appears to be a known issue with npm. e.g. read the more recent comments from npm/npm#7200, with people complaining about it (not on Azure).

I don't know why this only started to affect Ghost now, but I'd guess the number of dependencies might have increased and put it over the edge :(

@kevinkuszyk
Copy link
Contributor Author

Thanks @davidebbo - thats fixed it for me too.

A brand new deploy to a basic plan worked, and scaling my free plan up to basic for the deploy and then back down to free also worked.

@cicorias
Copy link
Contributor

Not sure what is going on, but I just did a Standard w/ Medium size worker and got this.. Sits on building for quite some time until it finally failed.

Omitting next output lines...
The iisnode.yml file explicitly sets nodeProcessCommandLine. Automatic node.js version selection is turned off.
Selected npm version 3.5.1
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.1
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.1
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.1
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET

...
ailed exitCode=1, command="D:\Program Files (x86)\nodejs\4.2.3\node.exe" "D:\Program Files (x86)\npm\3.5.1\node_modules\npm\bin\npm-cli.js" install --production
An error has occurred during web site deployment.
npm ERR! Windows_NT 6.2.9200\r\nnpm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! node v4.2.3\r\nnpm ERR! npm  v3.5.1\r\nnpm ERR! code ECONNRESET\r\nnpm ERR! errno ECONNRESET\r\nnpm ERR! syscall read\r\n\r\nnpm ERR! network read ECONNRESET\r\nnpm ERR! network This is most likely not a problem with npm itself\r\nnpm ERR! network and is related to network connectivity.\r\nnpm ERR! network In most cases you are behind a proxy or have bad network settings.\r\nnpm ERR! network \r\nnpm ERR! network If you are behind a proxy, please make sure that the\r\nnpm ERR! network 'proxy' config is set properly.  See: 'npm help config'\r\nnpm ERR! Windows_NT 6.2.9200\r\nnpm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! node v4.2.3\r\nnpm ERR! npm  v3.5.1\r\nnpm ERR! code ECONNRESET\r\nnpm ERR! errno ECONNRESET\r\nnpm ERR! syscall read\r\n\r\nnpm ERR! network read ECONNRESET\r\nnpm ERR! network This is most likely not a problem with npm itself\r\nnpm ERR! network and is related to network connectivity.\r\nnpm ERR! network In most cases you are behind a proxy or have bad network settings.\r\nnpm ERR! network \r\nnpm ERR! network If you are behind a proxy, please make sure that the\r\nnpm ERR! network 'proxy' config is set properly.  See: 'npm help config'\r\nnpm ERR! Windows_NT 6.2.9200\r\nnpm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! node v4.2.3\r\nnpm ERR! npm  v3.5.1\r\nnpm ERR! code ECONNRESET\r\nnpm ERR! errno ECONNRESET\r\nnpm ERR! syscall read\r\n\r\nnpm ERR! network read ECONNRESET\r\nnpm ERR! network This is most likely not a problem with npm itself\r\nnpm ERR! network and is related to network connectivity.\r\nnpm ERR! network In most cases you are behind a proxy or have bad network settings.\r\nnpm ERR! network \r\nnpm ERR! network If you are behind a proxy, please make sure that the\r\nnpm ERR! network 'proxy' config is set properly.  See: 'npm help config'\r\nnpm ERR! Windows_NT 6.2.9200\r\nnpm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! node v4.2.3\r\nnpm ERR! npm  v3.5.1\r\n\r\nnpm ERR! Callback called more than once.\r\nnpm ERR! \r\nnpm ERR! If you need help, you may report this error at:\r\nnpm ERR!     <https://github.com/npm/npm/issues>\r\n\r\nnpm ERR! Please include the following file with any support request:\r\nnpm ERR!     D:\home\site\wwwroot\npm-debug.log\r\nC:\Program Files (x86)\SiteExtensions\Kudu\54.50506.2209\bin\scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

@davidebbo
Copy link
Contributor

@cicorias That looks like a very separate issue, discussed on npm/registry#10. People are seeing this on EC2 and other places. It seems for that one upgrading npm is the answer. Also, I'm not sure those errors are actually harmful.

Back to the EACCES issue, we are looking at raising the limit, which should help. Look for a change around the end of the month.

@cicorias
Copy link
Contributor

@davidebbo - ok - seems that others have been able to get passed that issue with a different version of node - 4.4.x - i'll try that with the IIS yaml and see how it goes, not sure what versions are on the box buy I'll poke around.. Then i'll try an update to npm as well per that npm/registry#10

Just so you know this was failing direct from the "Deploy to Azure" button integration. But, once that failed via Kudu console an npm install went just "fine" - however there were already some packages there it seemed.

If it's still an issue i'll open another issue.

@davidebbo
Copy link
Contributor

Someone else reporting this here. @felixrieseberg any chance to upgrade so it uses newer npm?

@felixrieseberg
Copy link
Owner

Ghost supports the Node LTS release (so we're stuck with the latest LTS for now), but I set the npm version manually to the latest available on Azure (3.8.6).

@davidebbo: That too is a few versions behind the latest available (3.8.9 is the latest patch, 3.9.1 the latest minor). This is a total off-topic, but let me know if we should build you a little script that just shovels all available versions into the image!

@cicorias
Copy link
Contributor

there are npm versions in "d:\program files (x86)\npm

03/06/2016  01:54 PM    <DIR>          2.1.17
03/06/2016  01:58 PM    <DIR>          2.11.2
03/06/2016  01:55 PM    <DIR>          2.14.12
03/06/2016  01:58 PM    <DIR>          2.14.2
03/10/2016  07:55 PM    <DIR>          2.14.20
03/06/2016  01:58 PM    <DIR>          2.14.3
03/06/2016  01:58 PM    <DIR>          2.14.4
04/01/2016  04:27 PM    <DIR>          2.15.1
03/06/2016  01:59 PM    <DIR>          2.5.1
03/06/2016  01:59 PM    <DIR>          2.7.4
03/06/2016  01:54 PM    <DIR>          2.7.6
03/06/2016  01:58 PM    <DIR>          2.9.1
03/06/2016  01:53 PM    <DIR>          3.1.0
03/06/2016  01:56 PM    <DIR>          3.3.12
03/06/2016  01:53 PM    <DIR>          3.3.6
03/06/2016  01:57 PM    <DIR>          3.3.9
03/06/2016  01:55 PM    <DIR>          3.5.1
03/06/2016  01:53 PM    <DIR>          3.5.3
03/06/2016  01:54 PM    <DIR>          3.6.0
03/10/2016  07:55 PM    <DIR>          3.7.3
04/01/2016  04:27 PM    <DIR>          3.8.3
04/29/2016  08:27 PM    <DIR>          3.8.6

@felixrieseberg
Copy link
Owner

Yes, exactly, please notice how 3.8.6 is the last available one ;-)

@cicorias
Copy link
Contributor

also, instead of updating or specifying the node version in the iisnode.yaml file, why isn't the package.json updated to reflect preference but with the higher versions first?

  "engines": {
    "node": " ^4.2.0 || ~0.12.0  || ~0.10.0",
    "npm": "3.8.6"
  },

@felixrieseberg
Copy link
Owner

I'd like to change the original Ghost files as little as possible - the only reason I'm locking down the Node version at all is to ensure that pre-gyp (on the free tier) is able to find binaries for sqlite3 (which usually takes a while after a Node release).

This is basically a long flowchart of "if we could [...] then we wouldn't have to [...]" 🏄

@davidebbo
Copy link
Contributor

One problem I found is that Kudu doesn't support the caret syntax (e.g. ^4.2.0), because it's using an ancient semver.js from days where the syntax didn't exist. I think that's at least partially the root of some issues. I'll look into fixing that.

@davidebbo
Copy link
Contributor

This should be solved by this PR: #34. You can try it before it gets merged on my fork: https://github.com/davidebbo-test/Ghost-Azure

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

Successfully merging a pull request may close this issue.

7 participants