Jim Buck
Jim Buck

Reputation: 2444

Azure not publishing Node.js App correctly

TL;DR

Explained:

I have an account on Windows Azure where I have used both Websites and Cloud Services. I moved my website to a cloud service to be able to use custom domains.

Since moving, I use Azure cmdlets to publish my Node.js webserver. Before publishing worked fine, usually taking between 5 and 10 minutes to complete. Once published, the website contains the most recent content.

My problem is that now, publishing takes less than 2 minutes, no errors are thrown, and the content is not updated. Why is my app not publishing it's content?

Below is my publishing output:

PS C:\Projects\Azure\CloudServices\jwbsite\JWB> ls

    Directory: C:\Projects\Azure\CloudServices\jwbsite\JWB

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          9/8/2012  10:22 AM            bin
d----         9/12/2012   3:30 PM            controllers
d----         9/11/2012   1:16 PM            data
d----         9/12/2012   4:00 PM            extensions
d----         9/10/2012   2:37 PM            models
d----         9/12/2012   2:45 PM            node_modules
d----         9/12/2012   3:23 PM            public
d----          9/8/2012  10:28 AM            views
-a---         9/25/2012   3:44 PM        411 package.json
-a---         9/13/2012  11:14 AM        224 robots.txt
-a---         9/17/2012   2:45 PM        605 routes.js
-a---         9/17/2012  10:59 AM       1902 server.js
-a---         8/25/2012   1:28 PM       3251 Web.cloud.config
-a---         8/25/2012   1:28 PM       3251 Web.config

PS C:\Projects\Azure\CloudServices\jwbsite\JWB> Publish-AzureServiceProject

Publishing  to Windows Azure. This may take several minutes...

4:27:17 PM - Preparing runtime deployment for service 'jwbsite'
4:27:20 PM - Preparing deployment for jwbsite with Subscription ID: ABCDEFGH-IJKL-MNOP-QRST-UVWXYZ012345...
4:27:21 PM - Connecting...
4:27:27 PM - Verifying storage account 'jwbsite'...
4:27:27 PM - Uploading Package...
4:27:39 PM - Upgrading...
4:27:50 PM - Created Deployment ID: ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE.
4:27:50 PM - Starting...
4:27:50 PM - Initializing...
4:27:51 PM - Instance JWB_IN_0 of role JWB is ready.
4:27:51 PM - Instance JWB_IN_1 of role JWB is ready.
4:27:51 PM - Instance JWB_IN_2 of role JWB is ready.
4:27:51 PM - Instance JWB_IN_3 of role JWB is ready.
4:27:52 PM - Created Website URL: http://jwbsite.cloudapp.net.
4:27:52 PM - Complete.

PS C:\Projects\Azure\CloudServices\jwbsite\JWB>

Let me know, I appreciate the help.

Upvotes: 1

Views: 866

Answers (2)

Namila
Namila

Reputation: 754

I had the same issue, and I use this module to make my paths shorter https://www.npmjs.com/package/flatten-packages It fixed the problem

Upvotes: 0

Jim Buck
Jim Buck

Reputation: 2444

In case anyone else is having this problem or Google is sending your here, I did find the cause of the error.

CHECK YOUR FILENAME/PATH LENGTHS!

If the filenames are too long then the package will not be uploaded to Azure. I found this out by trying to publish to the emulation of Azure, which gave me the correct errors. I'm not sure why it doesn't give the errors when pushing to the real Azure instance.

Node.js Note:

The main source for filenames/paths that are too long are the modules. When installing modules through NPM, the module will install it's dependencies that aren't present at the time. Be sure to look through your module file structure and try to slim it down(I'm working on a script to balance it for you).

The Azure support team were extremely helpful in trying to get to the bottom of this confusing problem, they worked with me for almost 2 months to get my site back up and running.

If you are having the same or similar issue, try deploying to the local emulation of Azure and see what errors you get back.

I feel stupid for getting this error, but hopefully my stupid can help avoid someone else's.

Upvotes: 2

Related Questions