azure-xplat-cli icon indicating copy to clipboard operation
azure-xplat-cli copied to clipboard

Cannot connect to Service Fabric cluster

Open vmakhaev opened this issue 8 years ago • 20 comments

CLI Version: 0.10.2 OS Type: Mac Installation via: npm

Mode: both ARM and ASM

Environment: AzureCloud

Description: azure servicefabric cluster connect http://myfabricendpoint.eastus.cloudapp.azure.com:19000 command doesn't connect to Service Fabric cluster

But I can connect to the same cluster from Windows Power Shell.

Steps to reproduce:

  1. Create empty Service Fabric Cluster and get it client endpoint
  2. Run azure servicefabric cluster connect http://myfabricendpoint.eastus.cloudapp.azure.com:19000

Error stack trace:

2016-11-16T11:52:18.390Z: 'Error connecting to the cluster http://myfabricendpoint.eastus.cloudapp.azure.com:19000/. Please check the connection.' undefined

vmakhaev avatar Nov 16 '16 11:11 vmakhaev

Can you confirm you have at least node v4 or greater installed?

masnider avatar Nov 16 '16 21:11 masnider

node v6.9.1 npm 3.10.8

vmakhaev avatar Nov 16 '16 21:11 vmakhaev

You'll need to use port 19080.

azure servicefabric cluster connect http://myfabricendpoint.eastus.cloudapp.azure.com:19080.

However, not all CLI commands (CLI support is in preview) will work against a Windows cluster. Please use PS on Windows to connect to a Windows cluster for the best experience.

mani-ramaswamy avatar Nov 16 '16 21:11 mani-ramaswamy

I thought that 19080 is port for ui. Howbeit it does not work too.

So as I understand to use linux tools, I need to run Service Fabric on Linux. Got it.

vmakhaev avatar Nov 17 '16 07:11 vmakhaev

CLI uses the same REST end point as SFX (the browser UI). WHile you can use CLI against Windows, it will be better supported in connecting to Windows clusters with upcoming releases on Windows.

mani-ramaswamy avatar Nov 17 '16 13:11 mani-ramaswamy

azure servicefabric cluster connect http://myfabricendpoint.eastus.cloudapp.azure.com:19080 does not work too.

'Error connecting to the cluster http://myfabricendpoint.eastus.cloudapp.azure.com:19080/. Please check the connection.' undefined

Is it expected that it does not work? Why issue is closed?

vmakhaev avatar Nov 17 '16 13:11 vmakhaev

I should have been clearer. Yes, it will only work on the next release of the runtime for connecting to Windows clusters. It doesn't work with the current version.

mani-ramaswamy avatar Nov 17 '16 19:11 mani-ramaswamy

Has that working version been released?

tvjames avatar Jan 24 '17 00:01 tvjames

So, correct me if I am wrong. Does this mean that the connection to an Azure servicefabric cluster is not working at all? Any planned dates to make that work?

It is quite surprising that this cli with the full set of commands to manage the servicefabric cluster are available.... if the one to connect to the cluster does not work at all.

JoseFMP avatar Apr 21 '17 09:04 JoseFMP

So, I can connect. The help of the command is totally misleading.

Connect cluster, Example: azure servicefabric cluster connect --connection-endpoint http://127.0.0.1:19080

It is not obvious to figure out you need to omit the --connection-endpoint word to connect to your cluster. But works.

JoseFMP avatar Apr 24 '17 01:04 JoseFMP

Funny... trying the same thing in a different machine now pops the error:

error: Cannot open the servicefabric config file. Please connect to the cluster by invoking the cluster connect command.

Same commands succeeded in one machine but fail in another

JoseFMP avatar Apr 26 '17 01:04 JoseFMP

You cannot connect to a secure cluster on Windows with the CLI. You can connect to Windows unsecure clusters or Linux secure/unsecure clusters. When you copy paste, the dashes sometimes get replaced by other characters. Please try by typing it out out instead of copying.

mani-ramaswamy avatar Apr 26 '17 15:04 mani-ramaswamy

Thank you for your support Mani.

I double checked that. Indeed I tried both azure servicefabric cluster connect --connection-endpoint http://myclusterCoolCluster.com:19080

and

azure servicefabric cluster connect http://myclusterCoolCluster.com:19080

Still that horrible error poping-up. error: Cannot open the servicefabric config file. Please connect to the cluster by invoking the cluster connect command.

Do you have an idea what can it mean? Is there such a file? If so I can easily check if it is really there, permissions are correct etc. Must be a problem from the environment because in the other machine it is working fine. But with that scarce error message I am stuck figuring out the problem.

JoseFMP avatar Apr 27 '17 02:04 JoseFMP

Seems like the CLI didn’t get installed right. Can you try going through the install steps again, and see if you’re running into issues/errors there? Jeffrey – any ideas?

From: Jose [email protected] Reply-To: Azure/azure-xplat-cli [email protected] Date: Wednesday, April 26, 2017 at 7:25 PM To: Azure/azure-xplat-cli [email protected] Cc: Subramanian Ramaswamy [email protected], Assign [email protected] Subject: Re: [Azure/azure-xplat-cli] Cannot connect to Service Fabric cluster (#3320)

Thank you for your support Mani.

I double checked that. Indeed I tried both azure servicefabric cluster connect --connection-endpoint http://myclusterCoolCluster.com:19080

and

azure servicefabric cluster connect http://myclusterCoolCluster.com:19080

Still that horrible error poping-up. error: Cannot open the servicefabric config file. Please connect to the cluster by invoking the cluster connect command.

Do you have an idea what can it mean? Is there such a file? If so I can easily check if it is really there, permissions are correct etc. Must be a problem from the environment because in the other machine it is working fine. But with that scarce error message I am stuck figuring out the problem.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-xplat-cli%2Fissues%2F3320%23issuecomment-297593593&data=02%7C01%7Csubramar%40microsoft.com%7C2166773877024291079908d48d14ae11%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636288567335608327&sdata=sgeSMu5Q7%2Fy%2Bk%2FATrFsuJZg%2FXPqQTWjIptxAmM18m%2BU%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKy6rg0HBKZ2p0wo-wPq5yxAlVuXzhR8ks5rz_ycgaJpZM4Kzw_R&data=02%7C01%7Csubramar%40microsoft.com%7C2166773877024291079908d48d14ae11%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636288567335608327&sdata=zXLWOIXivjV9lEv%2FKzK606vJRnpBlhcn5O5sWgkXeSU%3D&reserved=0.

mani-ramaswamy avatar Apr 27 '17 02:04 mani-ramaswamy

Hello Mani, Thank you for your answer.

I repeated the installation few times. I tried a few times using npm directly, and a few times by using curl and get the repo. Tried also installing global/non-global.

Still same message. Is there a way I can get a more explicit log message?

JoseFMP avatar Apr 27 '17 02:04 JoseFMP

Hello Mani,

Today I felt really angry about this nor working so I debugged a little bit. I added some simple logging messages and found out what the problem is.

It comes down to a library missing:

Exception: TypeError: Object #<Object> has no method 'access' In file serviceFabricUtils._js

exports.isFileExist = function (filePath, _) { try { fs.access(filePath, fs.F_OK, _); return true; } catch (e) { console.log('Exception checking if file exists. File: ' + filePath); console.log('Exception: ' + e); return false; } };

JoseFMP avatar May 01 '17 04:05 JoseFMP

It is likely that you are using a deprecated version of node. Could you upgrade and try again?

msjeffreychen avatar May 01 '17 17:05 msjeffreychen

You can do node --version to find out the version of node you are on. MEanwhile, Jose in a few weeks, the CLI 2.0 (python based) will have SF support as well.

mani-ramaswamy avatar May 01 '17 17:05 mani-ramaswamy

Hello Mani & Jeffrey,

Thank you a lot for your feedback. Indeed that was the problem.

Shouldn't there be a small check of the version of node used, and at least give a warning if too old, if not preventing from executing the command at all?

I was using a really old version but no warning, nothing. Ended up on a error message totally misleading.

Cannot wait to use CLI 2.0! It will expose some python API for servicefabric ?!

JoseFMP avatar May 04 '17 01:05 JoseFMP

The CLI framework could add such check and warning. It is not a service fabric command issue specifically.

msjeffreychen avatar May 04 '17 01:05 msjeffreychen