Error 301 when running WebPageTest - node.js

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/"

Related

How can I debug "Build failed: Too many concurrent builds" error when only one function is being deployed via Google Cloud Function?

I'm currently trying to deploy a function via the console. I have added variables, package specs, and service account credentials.
When I hit deploy, the status was in build with the spinning wheel for about ten minutes before coming back with a build failed icon.
When I went to the logs I am seeing the following:
status: {
code: 8
message: "Build failed: Too many concurrent builds, please stagger your deployments."
}
with severity: ERROR under resource.
There are several other cloud functions that are already deployed and active; they were deployed some time ago and are not currently being redeployed.
I have attempted to redeploy the function in question but that resulted in a timeout after 60 seconds.
Full logs below:
{
protoPayload: {
#type: "type.googleapis.com/google.cloud.audit.AuditLog"
status: {
code: 8
message: "Build failed: Too many concurrent builds, please stagger your deployments."
}
authenticationInfo: {
principalEmail: "user#user"
}
serviceName: "cloudfunctions.googleapis.com"
methodName: "google.cloud.functions.v1.CloudFunctionsService.CreateFunction"
resourceName: "projects/resource_name"
}
insertId: "-n11hqacqvq"
resource: {
type: "cloud_function"
labels: {3}
}
timestamp: "2021-02-18T22:16:56.681559Z"
severity: "ERROR"
logName: "projects/.../logs/cloudaudit.googleapis.com%2Factivity"
operation: {
id: "operations/..."
producer: "cloudfunctions.googleapis.com"
last: true
}
receiveTimestamp: "2021-02-18T22:16:56.858611526Z"
}

How to fix: "EPROTO" Error after upgrading Node's version

The following code works on Node's v10.15.3 version:
const { post } = require('request');
post({
url: 'https://cidadao.sinesp.gov.br/sinesp-cidadao/mobile/consultar-placa/v4',
body: '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<v:Envelope xmlns:v=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <v:Header>\n <b>LGE Nexus 5</b>\n <c>ANDROID</c>\n <d>v4</d>\n <e>4.3.2</e>\n <f>98.193.54.223</f>\n <g>514650d8dba4784ed08b5a029583576361a50bc5</g>\n <h>-3272.3179572637086</h>\n <i>940.839492700698</i>\n <j/>\n <k/>\n <l>2019-05-24 10:24:35</l>\n <m>8797e74f0d6eb7b1ff3dc114d4aa12d3</m>\n </v:Header>\n <v:Body xmlns:n0=\"http://soap.ws.placa.service.sinesp.serpro.gov.br/\">\n <n0:getStatus>\n <a>LSU3J43</a>\n </n0:getStatus>\n </v:Body>\n</v:Envelope>',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': 'SinespCidadao / 3.0.2.1 CFNetwork / 758.2.8 Darwin / 15.0.0',
Host: 'cidadao.sinesp.gov.br'
},
}, (err, httpResponse, body) => {
if (err) return console.error(err);
console.log(JSON.stringify(httpResponse));
});
But after upgrading to v12.2.0 or above I got the following error:
Error: write EPROTO 17432:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:c:\ws\deps\openssl\openssl\ssl\statem\statem_lib.c:1922:
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:83:16) {
errno: 'EPROTO',
code: 'EPROTO',
syscall: 'write'
}
How can I fix it?
As the same code works on Node.js v10.15.3, but not work on v12.2.0, and the error message indicates "unsupported protocol", the most possible root cause of this issue is: the minimal supported TLS version in Node.js 10 is TLSv1.0, but since v11.4.0, it is raised to TLSv1.2 (tls.DEFAULT_MIN_VERSION). I suspect the certificate of cidadao.sinesp.gov.br is signed with TLSv1.0, which works on Node.js v10.15.3, but not on v12.2.0.
To make Node.js accept TLSv1.0, you can lauch Node.js process with --tls-min-v1.0 option.
I made an experiment and it works well:
BTW, the certificate of cidadao.sinesp.gov.br is invalid now. It has been expired since May 2018 -- as the OP mentioned, the request should be sent from Brazil (or through proxy node in Brazil).

Error when trying to use CanvasJS via RequireJS

I'm trying to use CanvasJS inside my project. I'm using RequireJS to manage the modules, and have this in the main script:
define(['domReady',"canvasjs","common-functions"], function(domReady,CanvasJS) {
domReady(function () {
window.CanvasJS = CanvasJS;
init_page_select();
});
});
This is what I have in my requireJS config file for the path:
"paths": {
// other stuff here
"canvasjs": "node_modules/canvasjs/dist/canvasjs.min"
},
I can see the canvasjs.min.js file being grabbed fine - but then I get this weird error:
ReferenceError: intToHexColorString is not defined[Learn More] canvasjs.min.js:7:7042
[33]</n.prototype.render https://www.test.org/2018/js/lib/node_modules/canvasjs/dist/canvasjs.min.js:7:7042
[28]</n.prototype.render https://www.test.org/2018/js/lib/node_modules/canvasjs/dist/canvasjs.min.js:5:14150
n/this.render https://www.test.org/2018/js/lib/node_modules/canvasjs/dist/canvasjs.min.js:8:17771
init_page_select https://www.test.org/2018/js/lib/spot_view_stats.js:83:2
<anonymous> https://www.test.org/2018/js/lib/spot_view_stats.js:4:3
domReady https://www.test.org/2018/js/lib/domready.js:105:13
<anonymous> https://www.test.org/2018/js/lib/spot_view_stats.js:2:2
execCb https://www.test.org/2018/js/lib/require.js:5:12859
check https://www.test.org/2018/js/lib/require.js:5:6575
enable/</< https://www.test.org/2018/js/lib/require.js:5:9031
bind/< https://www.test.org/2018/js/lib/require.js:5:812
emit/< https://www.test.org/2018/js/lib/require.js:5:9497
each https://www.test.org/2018/js/lib/require.js:5:289
emit https://www.test.org/2018/js/lib/require.js:5:9465
check https://www.test.org/2018/js/lib/require.js:5:7169
enable/</< https://www.test.org/2018/js/lib/require.js:5:9031
bind/< https://www.test.org/2018/js/lib/require.js:5:812
emit/< https://www.test.org/2018/js/lib/require.js:5:9497
each https://www.test.org/2018/js/lib/require.js:5:289
emit https://www.test.org/2018/js/lib/require.js:5:9465
check https://www.test.org/2018/js/lib/require.js:5:7169
enable https://www.test.org/2018/js/lib/require.js:5:9358
init https://www.test.org/2018/js/lib/require.js:5:5716
h https://www.test.org/2018/js/lib/require.js:5:4287
completeLoad https://www.test.org/2018/js/lib/require.js:5:12090
onScriptLoad https://www.test.org/2018/js/lib/require.js:5:13014
I'm invoking it with:
var chart = new CanvasJS.Chart("thegraph",
{
title:{
text: impressionText
},
theme: "theme2",
axisX: {
valueFormatString: "MMM-DD-YYYY",
labelAngle: -50
},
axisY:{
valueFormatString: "#0",
title: impressionText
},
data: [
{
type: "line",
showInLegend: true,
legendText: legendText,
dataPoints: dataPoints
}
]
});
chart.render();
Interestingly, if I tell it to load canvasjs.js instead of canvasjs.min.js, I get another error:
ReferenceError: intToHexColorString is not defined[Learn More]
OK so the problem seemed to be my version. For some reason "npm install canvasjs" was installing 1.8.1, but 2.2 was out. As per their request, I updated it to 2.2 and it sorted the problem. It seems weird npm is running such an outdated version though

Spookyjs error with Child terminated with non-zero exit code 3221225477

all
I can run spookyjs program without a problem.
However, if it runs over long period of time, e.g. 24 hours or 48 hours, continuously the program stops with this message. Anyone got a clue for this error?
It could be other environment issue as spookyjs log seems fine.
{ [Error: Child terminated with non-zero exit code 3221225477]
details: { code: 3221225477, signal: null } }
Setting:
var spooky = new Spooky({
child: {
transport: 'http'
},
casper: {
logLevel: 'debug',
verbose: true,
"ssl-protocol": "any", //added for phantomjs ssl-protocol error
clientScripts: [
'../lib/jquery-2.2.3.min.js',
]
},
child: {
port: 10010,
bufferSize: 32 * 1024 // 32KB
}
}
...
My working environments:
node: v0.12.4
casperjs: 1.1.0-beta5
phantomjs: 1.9.7
npm: 2.10.1
os: windows 10

Regarding the error occurred in my test case in nodeload.js script

I have designed an app using elastic search. And when Iam trying to write the test case using node load.js. I have got a problem that when I increase the number users I was getting the warning that "WARN: Error during HTTP request: Error: ECONNREFUSED, Could not contact DNS servers" and Iam unable rectify the problem so please help me in solving this error.
nl.run({
name: "test",
host: 'localhost',
port: 9200,
//path: '/my_river/page/_search?q=sweden',
numUsers: 2000, //Increased my num of user**
timeLimit: 180,
targetRps: 500,
stats: [
'result-codes',
{ name: 'latency', percentiles: [0.9, 0.99] },
'concurrency',
'rps',
'uniques',
{ name: 'http-errors', successCodes: [200,404], log: 'http-errors.log' }
],

Resources