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' }
],
Related
"Failed to connect to all addresses" occurs while adding TLS certs to envoy.yaml, full error:
code: 14,
metadata: Metadata { _internal_repr: {}, flags: 0 },
details: 'failed to connect to all addresses'
Envoy config (Envoy is running on port 50000, and itemService on 50052):
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
"#type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
common_tls_context:
tls_certificates:
- certificate_chain:
filename: server.cert
private_key:
filename: server.key
Client code Nodejs - (NextJS on server side - getServerSideProps)
options = {
key: readFileSync("certs/client.key"),
cert: readFileSync("certs/ca.crt"),
csr: readFileSync("certs/client.crt"),
};
const creds = credentials.createSsl(
options.cert,
options.key,
options.csr
);
grpcServer.servicesList.itemsService = new ItemsServiceClient(
"localhost:50000",
creds,
{
"grpc.ssl_target_name_override": "localhost",
"grpc.default_authority": "localhost",
}
);
Request works normally when removing TLS certs from envoy.yaml.
Error I get from grpcurl tool: Failed to dial target host "localhost:50000" x509: certificate relies on legacy Common Name field, use SANs instead.
When I set GODEBUG=x509ignoreCN=0, seems like error stays same.
After some efforts the HTTP server started and status report showed that
node.js server was successfully reached. For testing my Drupal site I hit
a random url and waited for it to reflect on my dblog at the same time (as
demonstrated in the video). It failed. The backend showed the error - The
channel "watchdog_dblog" doesn't exist.
Here, the port used was 8888 (as per the video). It was changed to 8080
and then this error did not show up, but the drupal site still did not
auto-refresh.
The nodejs.config.js file currently:
settings = {
scheme: 'http',
port: 8080,
host: 'localhost',
resource: '/socket.io',
serviceKey: 'mytest1',
backend: {
port: 80,
host: 'drupal8',
scheme: 'http',
basePath: '',
messagePath: '/nodejs/message'
},
debug: true,
sslKeyPath: '',
sslCertPath: '',
sslCAPath: '',
baseAuthPath: '/nodejs/',
publishUrl: 'publish',
kickUserUrl: 'user/kick/:uid',
logoutUserUrl: 'user/logout/:authtoken',
addUserToChannelUrl: 'user/channel/add/:channel/:uid',
removeUserFromChannelUrl: 'user/channel/remove/:channel/:uid',
addChannelUrl: 'channel/add/:channel',
removeChannelUrl: 'channel/remove/:channel',
setUserPresenceListUrl: 'user/presence-list/:uid/:uidList',
addAuthTokenToChannelUrl: 'authtoken/channel/add/:channel/:uid',
removeAuthTokenFromChannelUrl: 'authtoken/channel/remove/:channel/:uid',
toggleDebugUrl: 'debug/toggle',
contentTokenUrl: 'content/token',
publishMessageToContentChannelUrl: 'content/token/message',
extensions: [],
clientsCanWriteToChannels: true,
clientsCanWriteToClients: true,
transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling'],
jsMinification: true,
jsEtag: true,
logLevel: 1
};
I did not see socket.io while looking at the page source and inspect
element network. After that the node.js config module was enabled but the
service key field was non-editable. I then created a file nodejs.config.js
in modules/nodejs and copied the configuration there. Socket.io showed up
with the path localhost:8080//socket.io/socket.io.js. Even if I change the
port to 8888, the socket path/port remains the same.
This is the error now cleanupSocket: Cleaning up after socket id
C0I_r38wIbcT1LbtAAAD, uid undefined
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"
}
I'm attempting to save form submissions to a DynamoDB table, however, I'm running into issues connecting locally. I'm running DynamoDB locally for now, but I would later like to move it back to a normal DDB instance accessible from Elastic Beanstalk.
I've downloaded and unzipped dynamodb-local into a directory and ran the java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
command, ensuring that I'm in the appropriate directory. When I run the command I get this:
Initializing DynamoDB Local with the following configuration:
Port: 8000
InMemory: false
DbPath: null
SharedDb: true
shouldDelayTransientStatuses: false
CorsParams: *
At this point I attempt to submit a form to my POST endpoint in app.js, but I get this repeating error in the terminal I'm running DynamoDB local in:
Jan 12, 2019 1:24:25 PM com.almworks.sqlite4java.Internal log
WARNING: [sqlite] cannot open DB[1]:
com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: C:\cygwin64\home\Administrator\dynamodb_local_latest\DynamoDBLocal_lib\sqlite4java-win32-x64.dll: Access is denied
Jan 12, 2019 1:24:25 PM com.almworks.sqlite4java.Internal log
SEVERE: [sqlite] SQLiteQueue[shared-local-instance.db]: error running job queue
com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: C:\cygwin64\home\Administrator\dynamodb_local_latest\DynamoDBLocal_lib\sqlite4java-win32-x64.dll: Access is denied
at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:97)
at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1441)
at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282)
at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:293)
at com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464)
at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641)
at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)
at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)
at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: C:\cygwin64\home\Administrator\dynamodb_local_latest\DynamoDBLocal_lib\sqlite4java-win32-x64.dll: Access is denied
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.load0(Unknown Source)
at java.base/java.lang.System.load(Unknown Source)
at com.almworks.sqlite4java.Internal.tryLoadFromPath(Internal.java:340)
at com.almworks.sqlite4java.Internal.loadLibraryX(Internal.java:117)
at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:95)
... 9 more
In the terminal that I'm running the cluster of Node workers I'm getting the following error output from each worker (8) and then a DDB error:
Failed to create table in DB.
{ Error: connect ECONNREFUSED 127.0.0.1:8000
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:14)
message: 'connect ECONNREFUSED 127.0.0.1:8000',
code: 'NetworkingError',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 8000,
region: 'us-west-2',
hostname: 'localhost',
retryable: true,
time: 2019-01-12T20:31:00.742Z }
DDB Error: NetworkingError: connect ECONNREFUSED 127.0.0.1:8000
I promise I'm finishing this up. Here's my code for creating the DDB table (I pass const ddb = new AWS.DynamoDB() as the parameter from app.js):
const AWS = require('aws-sdk');
function createDDBTable(ddb, tableName) {
// console.log('ddb:\n',ddb);
const tableParams = {
AttributeDefinitions: [
{
AttributeName: 'email',
AttributeType: 'S'
},
{
AttributeName: 'id',
AttributeType: 'S'
}
],
KeySchema: [
{
AttributeName: 'email',
KeyType: 'HASH'
},
{
AttributeName: 'id',
KeyType: 'RANGE'
}
],
ProvisionedThroughput: {
ReadCapacityUnits: 8,
WriteCapacityUnits: 8
},
TableName: tableName,
StreamSpecification: {
StreamEnabled: false
}
};
ddb.createTable(tableParams, (err, data) => {
if(err) console.error('Failed to create table in DB.\n', err);
else console.log('Success creating table!', data);
})
}
module.exports = createDDBTable;
I'm at a loss for where I'm going wrong. All of my validation and endpoints work, however, when it comes time to create a table my code keeps me stumbling through errors. I also have a feeling I may need to adjust my options.config file a bit, but I'm not sure how to format that. Thanks in advance for any help! I tried to be thorough about my issue, but let me know if I can expand on anything else.
instead of http://localhost:port use your computer IP. it will work.
ex: http://xxx.yy.zz.aaa:port <--your computer IP
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/"