Reseting password for Azure Linux ARM VM gives ERROR - linux

I am resetting the password of a Linux(Redhat) VM in ARM Azure. Using following command.
I am getting a error as below ...
PS C:\WINDOWS\system32> azure vm reset-access rgname vmname -u hadoop -p redhat#123
info:
Executing command vm reset-access
+ Looking up the VM "hadoop"
+ Installing extension "VMAccessForLinux", VM: "hadoop"
error: Long running operation failed with error: 'VM has reported a failure when processing extension 'VMAccessForLinu
x'. Error message: "Enable failed.".'.
info: Error information has been recorded to C:\Users\Amitkumar.patil.azure\azure.err
error: vm reset-access command failed
Error File Contains
2016-05-05T09:21:14.934Z:
{ [Error: Long running operation failed with error: 'VM has reported a failure when processing extension 'VMAccessForLinux'. Error message: "Enable failed.".'.]
stack: [Getter/Setter],
request:
{ rawResponse: false,
queryString: {},
method: 'GET',
headers: { 'user-agent': 'WindowsAzureXplatCLI/0.9.15' },
url: 'https://management.azure.com/subscriptions/75706c1b-8db8-49f6-8295-1c36c0b4e0c3/providers/Microsoft.Compute/locations/eastus/operations/72d61126-96e0-407d-a28e-b724d7efee6e?api-version=2015-06-15' },
response:
{ body: '{\r\n "operationId": "72d61126-96e0-407d-a28e-b724d7efee6e",\r\n "startTime": "2016-05-05T09:19:40.0598247+00:00",\r\n "endTime": "2016-05-05T09:20:59.4442674+00:00",\r\n "status": "Failed",\r\n "error": {\r\n "code": "VMExtensionProvisioningError",\r\n "message": "VM has reported a failure when processing extension \'VMAccessForLinux\'. Error message: \\"Enable failed.\\"."\r\n }\r\n}',
headers:
{ 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-length': '378',
'content-type': 'application/json; charset=utf-8',
expires: '-1',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-ms-served-by': '0309f20e-ba97-4cfa-a387-af57e4db0559_131067724814019554',
'x-ms-request-id': '4e2f8f12-06e7-4b8c-b76e-0e9706c7b490',
server: 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0',
'x-ms-ratelimit-remaining-subscription-reads': '14851',
'x-ms-correlation-request-id': 'a0e647c1-afda-4f0f-a02c-bc3cf0bced14',
'x-ms-routing-request-id': 'NORTHCENTRALUS:20160505T092114Z:a0e647c1-afda-4f0f-a02c-bc3cf0bced14',
date: 'Thu, 05 May 2016 09:21:14 GMT',
connection: 'close' },
statusCode: 200 },
message: 'Long running operation failed with error: \'VM has reported a failure when processing extension \'VMAccessForLinux\'. Error message: "Enable failed.".\'.',
code: 'VMExtensionProvisioningError',
body:
{ operationId: '72d61126-96e0-407d-a28e-b724d7efee6e',
startTime: '2016-05-05T09:19:40.0598247+00:00',
endTime: '2016-05-05T09:20:59.4442674+00:00',
status: 'Failed',
error:
{ code: 'VMExtensionProvisioningError',
message: 'VM has reported a failure when processing extension \'VMAccessForLinux\'. Error message: "Enable failed.".' } },
__frame:
{ name: 'createOrUpdateVMExtension__18',
line: 248,
file: 'C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI\\lib\\commands\\arm\\vm\\virtualMachine.js',
prev:
{ name: '_createOrUpdateExtension__38',
line: 1400,
file: 'C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI\\lib\\commands\\arm\\vm\\vmClient.js',
prev: [Object],
calls: 1,
active: false,
offset: 9,
col: 19 },
calls: 0,
active: false,
offset: 4,
col: 88 },
rawStack: [Getter] }
Error: Long running operation failed with error: 'VM has reported a failure when processing extension 'VMAccessForLinux'. Error message: "Enable failed.".'.
<<< async stack >>>
at createOrUpdateVMExtension__18 (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\arm\vm\virtualMachine.js:252:89)
at _createOrUpdateExtension__38 (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\arm\vm\vmClient.js:1409:20)
at setExtension__24 (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\arm\vm\vmClient.js:979:10)
at __26 (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\commands\arm\vm\vm.js:555:18)
<<< raw stack >>>
at PollingState.getCloudError (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\lib\pollingState.js:119:15)
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\lib\azureServiceClient.js:133:38
at Object.async.whilst (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\node_modules\async\lib\async.js:621:13)
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\node_modules\async\lib\async.js:617:23
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\lib\azureServiceClient.js:109:20
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\lib\azureServiceClient.js:231:5
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\lib\azureServiceClient.js:399:12
at retryCallback (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\node_modules\ms-rest\lib\filters\exponentialRetryPolicyFilter.js:140:9)
at handleRedirect (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\node_modules\ms-rest-azure\node_modules\ms-rest\lib\filters\redirectFilter.js:36:9)
at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\lib\util\utils.js:482:7

If I had to guess, I'd say that the 'azure vm reset-access' command has a bug. As the error message suggests, though, under the hood, it's just using the VMAccessForLinux extension, so you can use that directly to bypass the bug.
In Azure CLI 2.0, the command looks like:
az vm extension set -g YOUR_RESOURCE_GROUP_NAME --vm-name YOUR_LINUX_VM_NAME --publisher Microsoft.OSTCExtensions --name VMAccessForLinux --protected-settings '{"reset_ssh": true, "username": "YOUR_USERNAME", "password": "YOUR_NEW_PASSWORD"}'
It's been a while since I used Azure CLI 1.0, but If I recall correctly, it has an equivalent azure vm extension set command that takes the same parameters.
Hope this helps! For more examples of different configs (changing ssh keys and the like), check out this blog post:
https://negatblog.wordpress.com/2018/07/03/changing-admin-credentials-of-vms-and-scale-sets/

Related

Yarn: Error An unexpected error occurred: Request failed \"404 Not Found\

I´ve got an issue when I run my program with Yarn.
error An unexpected error occurred: "https://npm.pkg.github.com/download/{.../packagename}: Request failed \"404 Not Found\"".
I cloned a GitHub-Repo and installed NodeJS, npm, and Yarn.
I also create a personal access token at GitHub. And configured the registry with:
npm login --registry=https://npm.pkg.github.com
Username: USERNAME
Password: TOKEN
Email: PUBLIC-EMAIL-ADDRESS
info yarn config
{
'version-tag-prefix': 'v',
'version-git-tag': true,
'version-commit-hooks': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'bin-links': true,
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.yarnpkg.com',
'strict-ssl': false,
'user-agent': 'yarn/1.22.4 npm/? node/v13.8.0 darwin x64',
lastUpdateCheck: 1585820467684
}
info npm config
{
'//npm.pkg.github.com/:_authToken': `{TOKEN}`,
'always-auth': true,
`# { VALUE }:registry`: 'https://npm.pkg.github.com/'
}
Environment
Node Version: 13.8.0
npm Version: 6.13.6
Yarn Version: 1.22.4

Azure CLI hangs when deleting blobs

I'm using the Azure CLI to delete multiple blobs (in this case there's only 3 to delete), by specifying a pattern:
az storage blob delete-batch --connection-string myAzureBlobConnectionString -s my-container --pattern clients/client_name/*
This hangs and sees to get stuck in some kind of loop, I've tried adding --debug onto the end and it appears to be entering a never ending cycle of requests:
x-ms-client-request-id:16144555-a87c-11e9-bf86-sd391bc3b6f9
x-ms-date:Wed, 17 Jul 2019 10:17:12 GMT
x-ms-version:2018-11-09
/fsonss7393djamxomaa/mycontainer
comp:list
marker:2!152!XJJ4HDHKANnmLWUIWUDCN75DSDS89DXNNAKNK3NNINI4NKLNXLNLA88NSAMOXA
yOCE5OTk5LTEyLTMxVDIzOjU5OjU5Ljk5OTk5OTlaIQ--
restype:container
azure.multiapi.storage.v2018_11_09.common.storageclient : Client-Request-ID=446db2f0-d87e-11e9-ac19-jj324kc3b6f9 Outgoin
g request: Method=GET, Path=/mycontainer, Query={'restype': 'container', 'comp': 'list', 'prefix': None, 'delimiter
': None, 'marker': '2!152!MDAwMDY4IWNsaXASADYnJpc3RvbG9sZHZpYyOKD87986xlcy8wYWY3YTllYi02MzUyLTRmMmUtODE3MaSDXXZTdkYmYzOT
cuanBnITAwMDAyOCE5DADATEyLTMxVDIzOjUDD8223HKjk5OTk5OTlaIQ--', 'maxresults': None, 'include': None, 'timeout': None}, Head
ers={'x-ms-version': '2018-11-09', 'User-Agent': 'Azure-Storage/2.0.0-2.0.1 (Python CPython 3.6.6; Windows 2008ServerR2)
AZURECLI/2.0.68', 'x-ms-client-request-id': '1664324-a87c-1fsfs-bf86-ee291b5252f9', 'x-ms-date': 'Wed, 17 Jul 2019 10:1
9:14 GMT', 'Authorization': 'REDACTED'}.
urllib3.connectionpool : https://fsonss7393djamxomaa.blob.core.windows.net:443 "GET /mycontainer?restype=contain
er&comp=list&marker=2%21452%21MDXAXMDY4IWNsaWVudHMvYnJpc3RvbG9sZHZpYySnsns8sWY3YTllYi02MzUyLTRDASXXDE3MS01YzJmZTdkYm
YzOTcuanBnFFSFSAyOXASAOTk5LTEyLTMxGSGSOjU4535Ljk5OTk5OTlaIQ-- HTTP/1.1" 200 None
azure.multiapi.storage.v2018_11_09.common.storageclient : Client-Request-ID=544db2f0-a88c-23x9-ac19-jkjd89bc3b6f9 Receivi
ng Response: Server-Timestamp=Wed, 17 Jul 2019 10:19:14 GMT, Server-Request-ID=44fsfs2-701e-004e-2589-3cae723232000, HTT
P Status Code=200, Message=OK, Headers={'transfer-encoding': 'chunked', 'content-type': 'application/xml', 'server': 'Wi
ndows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id': '4a43c59b2-701e-44c-2989-3cdsd70000000', 'x-ms-version':
'2018-11-09', 'date': 'Wed, 17 Jul 2019 10:19:14 GMT'}.
azure.multiapi.storage.v2018_11_09.common._auth : String_to_sign=GET
It loops these requests over and over. Running an az storage list with a prefix returns the 3 files immediately.
Any ideas?
I think there is a minor error in your cli code: the container name is incorrect(means it does not have the path clients/client_name).
In your cli code, the container name is my-container. But in the debug info, I can see the container name is mycontainer which is not consistent with the name in your cli code.
Please make sure you specify the correct container name in your cli code, and which does contain the path clients/client_name.
I test the code at my side with a container, which does not have the path clients/client_name, and the same error with you. But if test with a container which has the path clients/client_name, then it deletes all the blobs inside it.
Otherwise, you should check cli version with az --version, the latest version is 2.0.69

Nodejs app using Mailjet throwing a confusing error

I'm building an app using Mailjet, and using their connection example.
app.get('/send',function(req,res){
...
var request = mailjet
.post("send")
.request({
<request stuff, email details>
});
request
.on('success', function (response, body) {
<handle response>
})
.on('error', function (err, response) {
<handle error>
});
Getting this error:
Unhandled rejection Error: Unsuccessful
at /home/ubuntu/workspace/node_modules/node-mailjet/mailjet-client.js:203:23
When I go to the Mailjet client and ask it to log the error, it tells me:
{ [Error: Unauthorized]
original: null,
...
Anyone have an idea of where I should start troubleshooting?
Update: saw this in the error output:
header:
{ server: 'nginx',
date: 'Thu, 02 Mar 2017 14:04:11 GMT',
'content-type': 'text/html',
'content-length': '20',
connection: 'close',
'www-authenticate': 'Basic realm="Provide an apiKey and secretKey"',
vary: 'Accept-Encoding',
'content-encoding': 'gzip' },
So it's not eating my API key and secret. Can anyone tell me how to set those as environmental variables in Cloud9?
You can set environment variables in ~/.profile. Files outside of the workspace directory /home/ubuntu/workspace aren't accessible for read-only users so people won't be able to see them.
In the terminal, you can do for example:
$> echo "export MAILJET_PUBLIC=foo" >> ~/.profile
$> echo "export MAILJET_SECRET=bar" >> ~/.profile
Then, you'll be able to access those variables in Node when using the connect method:
const mailjet = require ('node-mailjet')
.connect(process.env.MAILJET_PUBLIC, process.env.MAILJET_SECRET)
The runners (from the "run" button) and the terminal will evaluate ~/.profile and make the environment variable available to your app.

Error 301 when running WebPageTest

i would like to use gulp-sitespeedio#0.0.8 to test my website with webpagetest.
But I get an error on my console and I dont know why. Find anybody my fault?
[20:16:26] Starting 'webpagetest:build'...
[20:16:26] Analyze your site’s web performance
info: OS: 'darwin 15.6.0', Node.js: 'v5.1.0', sitespeed.io: '3.5.0', PhantomJS: '1.9.8', java: '1.8.0_31', browsertime: '0.9.4'
info: Using configured web perf budget {"wpt":{"requests":60,"bytesIn":1000000,"SpeedIndex":1000}}
info: Will analyze 2 pages
info: Running WebPageTest http://www.sitespeed.io pollResults=10, timeout=800, firstViewOnly=false, runs=9, private=true, aftRenderingTime=true, location=Dulles:Firefox, connectivity=3G, video=true
info: Running WebPageTest http://www.sitespeed.io/faq/ pollResults=10, timeout=800, firstViewOnly=false, runs=9, private=true, aftRenderingTime=true, location=Dulles:Firefox, connectivity=3G, video=true
error: WebPageTest couldn't fetch info for url http://www.sitespeed.io{ [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
error: Error running WebPageTest: { [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
error: WebPageTest couldn't fetch info for url http://www.sitespeed.io/faq/{ [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
error: Error running WebPageTest: { [WPTAPIError: Moved Permanently] name: 'WPTAPIError', code: 301, message: 'Moved Permanently' }
/Users/.../node_modules/sitespeed.io/lib/util/util.js:279
return pageData.webpagetest.wpt[0].response.data.testUrl;
^
TypeError: Cannot read property 'response' of undefined
at Object.module.exports.getURLFromPageData (/Users/.../node_modules/sitespeed.io/lib/util/util.js:279:43)
at Object.exports.processPage (/Users/.../node_modules/sitespeed.io/lib/collectors/assetsByTiming.js:25:21)
at /Users/.../node_modules/sitespeed.io/lib/collector.js:126:7
at Array.forEach (native)
at Collector.collectPageData (/Users/.../node_modules/sitespeed.io/lib/collector.js:125:19)
at processAnalysisResults (/Users/.../node_modules/sitespeed.io/lib/analyze/analyzer.js:171:14)
at /Users/.../node_modules/sitespeed.io/lib/analyze/analyzer.js:68:7
at /Users/.../node_modules/async/lib/async.js:254:17
at /Users/.../node_modules/async/lib/async.js:157:25
at /Users/.../node_modules/async/lib/async.js:251:21
at Object.queue.drain (/Users/.../node_modules/sitespeed.io/lib/analyze/webpagetest.js:63:11)
at next (/Users/.../node_modules/async/lib/async.js:804:31)
at /Users/.../node_modules/async/lib/async.js:32:16
at /Users/.../node_modules/sitespeed.io/lib/analyze/webpagetest.js:127:14
at WebPageTest.testCallback (/Users/.../node_modules/webpagetest/lib/webpagetest.js:346:14)
at callbackYield (/Users/.../node_modules/webpagetest/lib/webpagetest.js:138:14)
And here is my configuration. It is exact your example.
var gulp = require( "gulp" ),
sitespeedio = require( "gulp-sitespeedio" );
gulp.task( "webpagetest:build", sitespeedio( {
urls: ["http://www.sitespeed.io", "http://www.sitespeed.io/faq/"],
noYslow: true,
wptKey: "SECRET_KEY",
wptHost: "www.webpagetest.org",
no: 9,
wptConfig: {
location: "Dulles:Firefox",
connectivity: "3G",
timeout: 800
},
budget: {
wpt: {
requests: 60,
bytesIn: 1000000,
SpeedIndex: 1000
}
}
} ) );
node-version: v5.1.0
npm-version: v3.3.12
gulp-version: CLI v3.9.0 // LOCAL 3.9.1
Thanks for any help...
The wptHost should use a https connection:
wptHost: "https://www.webpagetest.org/"

Create azure hdinsight by node.js command line interface report "Cannot call method 'filter' of undefined"

I'v created a hdinsight cluster config and then create cluster by command 'azure hdinsight cluster create --config myhdinsightconf', but reported
info: Executing command hdinsight cluster create
/error: Cannot call method 'filter' of undefined
info: Error information has been recorded to azure.err
error: hdinsight cluster create command failed
azure.err files
Wed Mar 05 2014 10:47:34 GMT+0800 (CST):
{ [TypeError: Cannot call method 'filter' of undefined]
stack: [Getter/Setter],
__frame:
{ name: 'getCluster__2',
line: 176,
file: '/usr/local/lib/node_modules/azure-cli/lib/commands/hdinsight._js',
prev:
{ name: 'createClusterCommand__1',
line: 253,
file: '/usr/local/lib/node_modules/azure-cli/lib/commands/hdinsight._js',
prev: undefined,
active: false,
offset: 41,
col: 19 },
active: true,
offset: 1,
col: 17 },
rawStack: [Getter] }
TypeError: Cannot call method 'filter' of undefined
at ___ (/usr/local/lib/node_modules/azure-cli/lib/commands/hdinsight._js:183:40)
at ___ (/usr/local/lib/node_modules/azure-cli/node_modules/streamline/lib/callbacks/runtime.js:85:13)
at ___ (/usr/local/lib/node_modules/azure-cli/lib/commands/hdinsight._js:196:16)
at ___ (/usr/local/lib/node_modules/azure-cli/node_modules/streamline/lib/callbacks/runtime.js:85:13)
at finalCallback (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/hdinsight/hdinsightservice.js:403:7)
at /usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/azure-common/lib/services/serviceclient.js:693:11
at /usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/hdinsight/hdinsightservice.js:406:5
at Request.processResponseCallback [as _callback] (/usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/azure-common/lib/services/serviceclient.js:219:13)
at Request.self.callback (/usr/local/lib/node_modules/azure-cli/node_modules/azure/node_modules/request/request.js:129:22)
at Request.EventEmitter.emit (events.js:98:17)
at getCluster__2 (/usr/local/lib/node_modules/azure-cli/lib/commands/hdinsight._js:177:17)
at createClusterCommand__1 (/usr/local/lib/node_modules/azure-cli/lib/commands/hdinsight._js:294:19)
node -v
v0.10.26
Same error is reported when create without config file. Any idea?
The error report is not precise totally. I tried on management portal, hdinsight is not available for the zone of my config, and there are at least 10 character password length limit. The error was gone when I fixed these problems.

Resources