我在Microsoft Azure平台上获得了Visual Studio MSDN订阅,因此我决定将我的Heroku应用程序移动到Azure云。
我用NodeJS编写了3个应用程序,用PHP编写了1个应用程序。我正确部署了2/3 nodeJS应用程序但我无法解决第三个问题。每个应用程序都部署在不同的BitBucket git存储库中。 NodeJS的存储库具有相同的配置:
从Azure的角度来看(使用新的Portal)我有一个名为 rankk 的NodeJS应用程序。我使用的服务计划是D1。我可以正确地看到3" app和slot"。我将持续集成设置为指向我的bitBucket存储库以获取 rankk (应用程序名称)应用程序代码。事实是分发总是失败(见下图):
我销毁了Azure网络应用并创建了一个新的同一情况
我销毁了BitBucket git存储库,创建了一个新存储库,在Azure上创建了一个新的Web应用程序并链接它们 - 相同的情况
据我所知,"分发"应用程序代码,但天蓝色的应用程序和git存储库,我认为他们正在看到彼此。
如果我点击失败的细节(见顶部的图片,红旗)我只看到这个东西(见下图):
我没有得到这个:我为什么右边有4个绿旗,左边有1个红旗?
问题的最后信息:应用程序和Web服务器日志都是空的。我认为这意味着没有分发成功>没有派对(=没有应用程序启动)。
- UPDATE 感谢Xiaomin Wu(下面这里),我找到了最后一个有用的日志文件。见下文:
<step title="Incoming Request" date="2016-01-04T21:30:24.268" instance="fa3789" url="/deploy?scmType=BitbucketGit" method="POST" type="request" pid="3700,2,61" Connection="Keep-Alive" Content-Length="74" Expect="100-continue" Host="rankk.scm.azurewebsites.net" User-Agent="Azure-WebSites-Controller/50.0.8598.1705" x-ms-request-id="b6d3869b-b6e1-44a7-b288-3640647d4283" X-SITE-DEPLOYMENT-ID="rankk" >
<step title="FetchHandler" date="2016-01-04T21:30:24.268" >
<step title="Attempting to fetch target branch master" date="2016-01-04T21:30:24.287" />
<!-- duration: 12ms -->
<step title="Assuming git repository at D:\home\site\repository" date="2016-01-04T21:30:24.332" />
<!-- duration: 0ms -->
<step title="Performing fetch based deployment" date="2016-01-04T21:30:24.441" >
<step title="Creating temporary deployment" date="2016-01-04T21:30:24.441" />
<!-- duration: 31ms -->
<step title="LibGit2SharpRepository Fetch" date="2016-01-04T21:30:24.693" />
<!-- duration: 0ms -->
<step title="Warning" date="2016-01-04T21:30:24.693" type="warning" text="LibGit2SharpRepository fallback to git.exe due to Unsupported URL protocol" />
<!-- duration: 16ms -->
<step title="Executing external process" date="2016-01-04T21:30:24.708" type="process" path="git.exe" arguments="remote add -t master external "git@bitbucket.org:sturm20/core.git"" >
<step title="Process dump" date="2016-01-04T21:30:24.740" exitCode="128" type="processOutput" />
<!-- duration: 16ms -->
</step>
<!-- duration: 47ms -->
<step title="Executing external process" date="2016-01-04T21:30:24.756" type="process" path="git.exe" arguments="remote rm external" />
<!-- duration: 143ms -->
<step title="Executing external process" date="2016-01-04T21:30:24.915" type="process" path="git.exe" arguments="remote add -t master external "git@bitbucket.org:sturm20/core.git"" />
<!-- duration: 641ms -->
<step title="Executing external process" date="2016-01-04T21:30:25.555" type="process" path="git.exe" arguments="branch" />
<!-- duration: 47ms -->
<step title="Executing external process" date="2016-01-04T21:30:25.602" type="process" path="git.exe" arguments="fetch external --progress" />
<!-- duration: 4937ms -->
<step title="Executing external process" date="2016-01-04T21:30:30.553" type="process" path="git.exe" arguments="update-ref refs/heads/master external/master" />
<!-- duration: 109ms -->
<step title="Executing external process" date="2016-01-04T21:30:30.678" type="process" path="git.exe" arguments="checkout master --force" />
<!-- duration: 1554ms -->
<step title="Executing external process" date="2016-01-04T21:30:32.231" type="process" path="git.exe" arguments="remote rm external" />
<!-- duration: 94ms -->
<step title="DeploymentManager.Deploy(id)" date="2016-01-04T21:30:32.341" >
<step title="Collecting changeset information" date="2016-01-04T21:30:32.356" />
<!-- duration: 31ms -->
<step title="Updating submodules" date="2016-01-04T21:30:32.403" />
<!-- duration: 47ms -->
<step title="Determining deployment builder" date="2016-01-04T21:30:32.513" >
<step title="Builder is NodeSiteBuilder" date="2016-01-04T21:30:34.617" />
<!-- duration: 0ms -->
</step>
<!-- duration: 2104ms -->
<step title="Copying SSH keys" date="2016-01-04T21:30:34.648" />
<!-- duration: 17ms -->
<step title="Building" date="2016-01-04T21:30:34.665" >
<step title="Generating deployment script" date="2016-01-04T21:30:34.713" >
<step title="Using cached version of the deployment script for command: -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --node --sitePath "D:\home\site\repository"" date="2016-01-04T21:30:34.744" />
<!-- duration: 0ms -->
</step>
<!-- duration: 32ms -->
<step title="Executing external process" date="2016-01-04T21:30:35.304" type="process" path="starter.cmd" arguments=""D:\home\site\deployments\tools\deploy.cmd"" >
<step title="Process dump" date="2016-01-04T21:31:05.444" exitCode="255" type="processOutput" />
<!-- duration: 16ms -->
</step>
<!-- duration: 30156ms -->
<step title="Error occurred" date="2016-01-04T21:31:05.459" type="error" text="npm WARN package.json core@0.0.1 No repository field.
npm WARN package.json core@0.0.1 license should be a valid SPDX license expression
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 32-bit node.lib
gyp ERR! stack at Request.<anonymous> (c:\Program Files (x86)\npm\2.11.2\node_modules\npm\node_modules\node-gyp\lib\install.js:377:20)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at Request.onRequestResponse (c:\Program Files (x86)\npm\2.11.2\node_modules\npm\node_modules\request\request.js:1142:10)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at ClientRequest.emit (events.js:169:7)
gyp ERR! stack at HTTPParser.parserOnIncomingClient (_http_client.js:415:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack at Socket.socketOnData (_http_client.js:305:20)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "c:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\node-expat
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\0.12.6\\node.exe" "D:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! node-expat@2.3.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.9 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\wwwroot\npm-debug.log
C:\Program Files (x86)\SiteExtensions\Kudu\50.41223.1987\bin\scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"" stackTrace=" at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args)
at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args)
at Kudu.Core.Deployment.Generator.ExternalCommandBuilder.RunCommand(DeploymentContext context, String command)" />
<!-- duration: 16ms -->
</step>
<!-- duration: 30952ms -->
<step title="Error occurred" date="2016-01-04T21:31:05.617" type="error" text="npm WARN package.json core@0.0.1 No repository field.
npm WARN package.json core@0.0.1 license should be a valid SPDX license expression
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 32-bit node.lib
gyp ERR! stack at Request.<anonymous> (c:\Program Files (x86)\npm\2.11.2\node_modules\npm\node_modules\node-gyp\lib\install.js:377:20)
gyp ERR! stack at emitOne (events.js:82:20)
gyp ERR! stack at Request.emit (events.js:169:7)
gyp ERR! stack at Request.onRequestResponse (c:\Program Files (x86)\npm\2.11.2\node_modules\npm\node_modules\request\request.js:1142:10)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at ClientRequest.emit (events.js:169:7)
gyp ERR! stack at HTTPParser.parserOnIncomingClient (_http_client.js:415:21)
gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack at Socket.socketOnData (_http_client.js:305:20)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "c:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\node-expat
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\0.12.6\\node.exe" "D:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! node-expat@2.3.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.9 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\wwwroot\npm-debug.log
C:\Program Files (x86)\SiteExtensions\Kudu\50.41223.1987\bin\scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"" stackTrace=" at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args)
at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args)
at Kudu.Core.Deployment.Generator.ExternalCommandBuilder.RunCommand(DeploymentContext context, String command)
at Kudu.Core.Deployment.Generator.GeneratorSiteBuilder.Build(DeploymentContext context)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Kudu.Core.Deployment.DeploymentManager.<Build>d__29.MoveNext()" />
<!-- duration: 0ms -->
</step>
<!-- duration: 33292ms -->
<step title="Cleaning up temp files" date="2016-01-04T21:31:05.633" />
<!-- duration: 16ms -->
<step title="WebHooksManager.PublishEventAsync: PostDeployment" date="2016-01-04T21:31:05.664" />
<!-- duration: 16ms -->
</step>
<!-- duration: 41254ms -->
</step>`enter code here`
<!-- duration: 41443ms -->
<step title="Outgoing response" date="2016-01-04T21:31:05.711" type="response" statusCode="200" statusText="OK" Server="Microsoft-IIS/8.0" Cache-Control="private" X-AspNet-Version="4.0.30319" />
<!-- duration: 0ms -->
</step>
<!-- duration: 41459ms -->
现在:为什么尽管在我的机器上成功构建,但是node-gyp无法在云上构建?我应该向node-expat的所有者询问,但他似乎无法访问(见下面的截图):
- 更新第二次 如下面的答案所示,我的Azure应用程序上运行的节点版本是0.6.x.在我的package.json上有0.12.6。 0.12.6可用于 D:\ Program Files(x86)\ node&gt; ls 我将它设置在应用程序变量上。问题解决了,但改变了。现在我得到了:
<step title="Error occurred" date="2016-01-09T23:39:01.588" type="error" text="npm WARN package.json core@0.0.1 No description
npm WARN package.json core@0.0.1 No repository field.
npm WARN package.json core@0.0.1 No README data
npm WARN package.json core@0.0.1 No license field.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Program Files (x86)\npm\2.11.2\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "c:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\node-expat
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\0.12.6\\node.exe" "D:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! node-expat@2.3.12 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.12 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\wwwroot\npm-debug.log
C:\Program Files (x86)\SiteExtensions\Kudu\51.50108.2013\bin\scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"" stackTrace=" at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args)
at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args)
at Kudu.Core.Deployment.Generator.ExternalCommandBuilder.RunCommand(DeploymentContext context, String command, String message)" />
<!-- duration: 0ms -->
</step>
<!-- duration: 19761ms -->
<step title="Error occurred" date="2016-01-09T23:39:01.681" type="error" text="npm WARN package.json core@0.0.1 No description
npm WARN package.json core@0.0.1 No repository field.
npm WARN package.json core@0.0.1 No README data
npm WARN package.json core@0.0.1 No license field.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (c:\Program Files (x86)\npm\2.11.2\node_modules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "c:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\home\site\wwwroot\node_modules\node-expat
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\0.12.6\\node.exe" "D:\\Program Files (x86)\\npm\\2.11.2\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! node-expat@2.3.12 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.12 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\home\site\wwwroot\npm-debug.log
C:\Program Files (x86)\SiteExtensions\Kudu\51.50108.2013\bin\scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"" stackTrace=" at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args)
at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args)
at Kudu.Core.Deployment.Generator.ExternalCommandBuilder.RunCommand(DeploymentContext context, String command, String message)
at Kudu.Core.Deployment.Generator.GeneratorSiteBuilder.Build(DeploymentContext context)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Kudu.Core.Deployment.DeploymentManager.<Build>d__29.MoveNext()" />
<!-- duration: 0ms -->
</step>
答案 0 :(得分:2)
我认为根本原因是Azure App Service环境有更高版本的节点,而Francesco有一个非常旧版本的节点。
转到https://{your site name}.scm.azurewebsites.net/DebugConsole
并导航至D:\Program Files (x86)\nodejs
,查看所有可用的nodejs。并按npm version
或node -v
要选择特定的nodejs版本,请通过应用程序设置
定义环境变量导航到您的网站 - &gt;所有设置 - &gt;应用程序设置 - &gt;应用设置
键:WEBSITE_NODE_DEFAULT_VERSION,值:{version}
答案 1 :(得分:0)