Navigation Menu

Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Fresh installation of latest version of Azure-CLI breaks #2102

Closed
gkgupta opened this issue Sep 15, 2015 · 9 comments
Closed

Fresh installation of latest version of Azure-CLI breaks #2102

gkgupta opened this issue Sep 15, 2015 · 9 comments
Labels

Comments

@gkgupta
Copy link

gkgupta commented Sep 15, 2015

I was doing setup on a new machine and installed latest azure-cli:
sudo npm install azure-cli -g

And it is giving error while executing:

azure storage blob download -a <STORAGE> -k <KEY> <STORAGE_CONTAINER> <BLOB_NAME>
info:    Executing command storage blob download
error:   Cannot read property 'substr' of null
info:    Error information has been recorded to /root/.azure/azure.err
error:   storage blob download command failed
@gkgupta
Copy link
Author

gkgupta commented Sep 15, 2015

Error details

Tue Sep 15 2015 05:44:01 GMT+0000 (UTC):
{ [TypeError: Cannot read property 'substr' of null] __frame: undefined, rawStack: [Getter] }
TypeError: Cannot read property 'substr' of null
    at Object.exports.stringStartsWith (/usr/lib/node_modules/azure-cli/lib/util/utilsCore.js:67:16)
    at Object.exports.isIP (/usr/lib/node_modules/azure-cli/lib/util/validation.js:38:17)
    at getStorageServiceEndpointSuffix (/usr/lib/node_modules/azure-cli/lib/util/storage.util._js:1139:18)
    at getFullConnectionString (/usr/lib/node_modules/azure-cli/lib/util/storage.util._js:1148:24)
    at adjustConnectionStringWithEnvironment (/usr/lib/node_modules/azure-cli/lib/util/storage.util._js:1196:10)
    at getStorageServiceSettings (/usr/lib/node_modules/azure-cli/lib/util/storage.util._js:1088:24)
    at StorageUtil.getBlobService (/usr/lib/node_modules/azure-cli/lib/util/storage.util._js:139:25)
    at Object.StorageUtil.getServiceClient (/usr/lib/node_modules/azure-cli/lib/util/storage.util._js:522:27)
    at getBlobServiceClient (/usr/lib/node_modules/azure-cli/lib/commands/storage/storage.blob._js:67:37)
    at __$listAzureBlob (/usr/lib/node_modules/azure-cli/lib/commands/storage/storage.blob._js:813:21)

@ChoOo7
Copy link

ChoOo7 commented Sep 15, 2015

I have the same issue.
Do you have any workaround ?

@yugangw-msft
Copy link
Contributor

@yaxia please investigate. #2103 is the same issue

@ChoOo7
Copy link

ChoOo7 commented Sep 15, 2015

Tested with node 0.10.25 and 0.12.0
from a fresh
git clone https://github.com/Azure/azure-xplat-cli.git

Still have the issue

@yaxia
Copy link
Member

yaxia commented Sep 15, 2015

I am sorry that it's an issue in the code. To work around, would you please try one of the following:

  • Instead of the account name and key, use the connection string with the service endpoint, e.g.:
azure storage blob download <STORAGE_CONTAINER> <BLOB_NAME>
-c 'DefaultEndpointsProtocol=https;BlobEndpoint=https://<ACCOUNT_NAME>.blob.core.windows.net/;AccountName=<ACCOUNT_NAME>;AccountKey=<KEY>'
  • Call "azure login" before using the storage commands.

yaxia added a commit to wastoresh/azure-xplat-cli that referenced this issue Sep 15, 2015
yugangw-msft added a commit that referenced this issue Sep 17, 2015
@yugangw-msft
Copy link
Contributor

fixed

@gkgupta
Copy link
Author

gkgupta commented Sep 18, 2015

This is still breaking when I do a fresh install via npm. And even when I do a fresh install of an older version like 0.9.7 or 0.9.8. My application uses this extensively and we have automated deployment setup which installs nodejs and azure-cli and invokes the same via shell scripts.
So can you please release this fix as well.

@devigned
Copy link
Member

@gkgupta can you try with npm install github:azure/azure-xplat-cli#a2de47095? I don't think this fix has hit npm yet.

@gkgupta
Copy link
Author

gkgupta commented Sep 24, 2015

@devigned thanks a lot. This issue is breaking installs of previous version of azure-cli as well. Thus breaking our automate fresh installation scripts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants