3

I'm using the Windows Azure SDK for Node.js and run into an extremely odd roadblock.

I can test Azure Node.js apps locally using the Windows Azure Emulator fine, until I install Socket.io. Then the emulator refuses to start, spitting out:

Creating local package...
Starting Emulator...
Start-AzureEmulator : An unexpected failure occurred.  Details:
The compute emulator had a error: Can't locate service model..
At line:1 char:20
+ Start-AzureEmulator <<<<  -Launch
    + CategoryInfo          : CloseError: (:) [Start-AzureEmulator], InvalidOperationException
    + FullyQualifiedErrorId : AzureDeploymentCmdlets.Cmdlet.StartAzureEmulatorCommand

Odd thing is, I can deploy the same code/project to Azure, and it runs fine. Only the emulator refuses to work.

What is also odd is that I can't replicate this on a different computer. It seems to only be an issue on my main work box. I've tried npm cache clear to get a fresh install of Socket.io. I've uninstalled and re-installed the Azure SDK, Azure Emulators, and Azure Node.js tools. Nothing has fixed the issue.

Any ideas? It is getting mighty frustrating to only be able to test after a 10-15 minute deploy to the cloud.

UPDATE:
I should clarify that this scenario is happening with only a worker role (no web roles).

redhotvengeance
  • 27,446
  • 10
  • 49
  • 54

5 Answers5

3

On a hunch (because I think I may have had a similar error elsewhere in the past), I shortened the name of my project directory which resolved the issue.

I've a feeling it may be to do with the length of the path to the project files in the filesystem. I know TFS has similar issues. I usually try to keep all my projects in C:\Dev and not have too many nested directories or long project names.

There may be other reasons for seeing this error, but this resolved the issue in my case.

bitsprint
  • 897
  • 1
  • 11
  • 19
  • I've been following the cloud-services-nodejs-chat-app-socketio Azure tutorial, had this problem and moving to a shorter directory path also worked for me. My original path had no spaces and was about 25 characters longer (including \ separators). Bugs like this shouldn't happen any more... who is in charge of this? :) – spxl Aug 11 '14 at 15:31
  • I've since discovered that this is a limitation in windows, see http://stackoverflow.com/questions/1880321/why-does-the-260-character-path-length-limit-exist-in-windows – bitsprint Apr 30 '15 at 15:56
1

Are you using the Express framework in a web role? I ran into a permissions problem (which this may well be another symptom of) with the basic sample of using the Express framework with node.js in a web role in the emulator.

This is caused by a packaging bug. The workaround is to delete the server.js.logs directory from the web role. You can then turn off IISNode logging using the loggingEnabled parameter.

Neil Mackenzie
  • 2,817
  • 14
  • 11
  • This may work for web roles and Express, but not worker roles and socket.io, which is what I'm trying to run in the Azure Emulator. – redhotvengeance Feb 17 '12 at 23:28
0

This issue appears to have been fixed with the release of the Windows Azure SDK for Node.js - August 2012 (Version: 0.6.2). This can be installed via Web Platform Installer 4.0.

redhotvengeance
  • 27,446
  • 10
  • 49
  • 54
0

We have a fix on the way for this in our next SDK update which will be shortly.

Glenn Block
  • 8,463
  • 1
  • 32
  • 34
  • So I'm not out of my mind. That's nice to know. Would there happen to be any workarounds right now? – redhotvengeance Feb 15 '12 at 00:34
  • Hey Glenn, I just grabbed the latest release of tools (from the big Azure update last week) and I'm still having the same issue. Make a new project: `New-AzureServiceProject test`, `Add-AzureNodeWorkerRole`, navigate into WorkerRole1, `npm install socket.io`, `Start-AzureEmulator -Launch`, and it spits out the same error from the question. Do you know if there is any planned fix for this? – redhotvengeance Jun 14 '12 at 00:18
  • Try moving your app folder to a shorter path as suggested by bitsprint. Worked for me. – spxl Aug 11 '14 at 15:34
-2

"Would there happen to be any workarounds right now?"

I realise I have minimal reputation on StackOverflow but my earlier post did contain the phrase "The workaround." (And thanks to Glenn and his team for getting me there, on another forum.)

Neil Mackenzie
  • 2,817
  • 14
  • 11
  • Sorry, but no. I'm not even using a web role - I'm using only a worker role, since IIS 7 doesn't play nice with web sockets. So I have no Web.config files, nor a server.js.logs. So your workaround won't work for me, thus why I didn't mark it as an answer. This secondary answer you posted is not an answer at all. Answers should not be used as comments or complaints. – redhotvengeance Feb 17 '12 at 23:26