Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Emulator Won't Launch When Using Node.js + Socket.io

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).

like image 713
redhotvengeance Avatar asked Apr 09 '26 15:04

redhotvengeance


2 Answers

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.

like image 133
bitsprint Avatar answered Apr 11 '26 05:04

bitsprint


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.

like image 31
Neil Mackenzie Avatar answered Apr 11 '26 03:04

Neil Mackenzie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!