I just downloaded Couchbase for OS X (community edition) and started it up. That part went well. Then I started up the command line shell, cbq, and tried to run commands according to their docs:
http://developer.couchbase.com/documentation/server/current/tools/cbq-shell.html#topic_bzd_zwr_w5
I can successfully run things like:
select * from `beer-sample` limit 1;
...but I cannot run the metacommands like:
\HELP;
\ECHO hello;
Those all come back with an error response:
cbq> \HELP;
{
"requestID": "a52b8f2f-bef3-4d6f-83a8-f839ad1a87bb",
"errors": [
{
"code": 3000,
"msg": "Input was not a statement."
}
],
"status": "fatal",
"metrics": {
"elapsedTime": "401.285µs",
"executionTime": "347.522µs",
"resultCount": 0,
"resultSize": 0,
"errorCount": 1
}
}
and
cbq> \ECHO hello;
{
"requestID": "0ec331ca-9f74-409f-b904-6d9543af73da",
"errors": [
{
"code": 3000,
"msg": "syntax error - at hello"
}
],
"status": "fatal",
"metrics": {
"elapsedTime": "492.399µs",
"executionTime": "431.839µs",
"resultCount": 0,
"resultSize": 0,
"errorCount": 1
}
}
What am I doing wrong here?
It seems to work for me...
cbq> \help;
Help information for all shell commands.
\ALIAS [ name value ]
\CONNECT url
\COPYRIGHT
\DISCONNECT
\ECHO args ...
\HELP [ args ... ]
\POP [ parameter ]
\PUSH [ parameter value ]
\QUIT
\EXIT
\REDIRECT OFF | filename
\SET [ parameter value ]
\SOURCE filename
\UNALIAS name ...
\UNSET parameter
\VERSION
Related
I have the following code which I'm trying to read in CMake.
{
"demo": [
{
"name": "foo0",
"url": "url1",
"verify_ssl": true
},
{
"name": "foo1",
"url": "url1",
"verify_ssl": true
},
{
"name": "foo2",
"url": "url2",
"verify_ssl": true
}
]
}
I'm trying to access a member from the list above, for example demo[0].name without success, what I'm doing wrong?
file(READ "${CONAN_CACHE}/demo.json" MY_JSON_STRING)
string(JSON CUR_NAME GET ${MY_JSON_STRING} demo[0].name)
One at a time.
string(JSON CUR_NAME GET ${MY_JSON_STRING} demo 0 name)
I am using the ArcGIS for Javascript library 4.22 and I am trying to run some code when tiles cannot be fetched correctly by ArcGIS. The library prints error messages in the console, but I would like to have some other side effects.
How could I do that?
I tried with mapView.on and mapView.watch, but there seems to be no event for the error mapview-query-error, which occurs when the client's internet connection drops, for example.
The error message printed by the library:
[esri.views.2d.layers.features.sources.FeatureSource]
{
"name": "mapview-query-error",
"message": "Encountered error when fetching tile",
"details": {
"tile": {
"key": {
"level": 11,
"row": 723,
"col": 1088,
"world": 0
},
"bounds": [
1252344.271421019,
5870363.772302989,
1271912.1506620161,
5889931.65154399
],
"objectIds": {},
"tileInfoView": { /* omitted */ },
"resolution": 38.21851414257816,
"scale": 144447.63857215698,
"level": 11
},
"error": {
"name": "request:server",
"message": "Failed to fetch",
"details": {
"url": "https://services3.arcgis.com/5IQdSrlG6nfbU9TA/arcgis/rest/services/polygons_001265302111/FeatureServer/0/query",
"requestOptions": {
"query": {
"f": "pbf",
"geometry": "1252344.271421019,5870363.772302989,1271912.1506620161,5889931.65154399",
"maxRecordCountFactor": 4,
"resultOffset": 0,
"resultRecordCount": 8000,
"where": "1=1",
"orderByFields": "ObjectId",
"outFields": "*",
"outSR": 102100,
"quantizationParameters": "{\"extent\":{\"xmin\":1252344.271421019,\"ymin\":5870363.772302989,\"xmax\":1271912.1506620161,\"ymax\":5889931.65154399},\"mode\":\"view\",\"originPosition\":\"upperLeft\",\"tolerance\":38.21851414257816}",
"resultType": "tile",
"spatialRel": "esriSpatialRelIntersects",
"geometryType": "esriGeometryEnvelope",
"inSR": 102100,
"token": "AAPKd857e307032a45ee8190f767169c0d9fP8O1gtVoioRGqLEiMJhZwpnuVFIE0O7CT73pFJq_yoetIoTGP7VD4jJTSQ05QyNA"
},
"responseType": "array-buffer",
"signal": {}
},
"ssl": false,
"httpStatus": 0,
"raw": {
"stack": "TypeError: Failed to fetch\n at $ (http://localhost:3000/static/js/bundle.js:242159:23)\n at z (http://localhost:3000/static/js/bundle.js:242262:22)\n at async C (http://localhost:3000/static/js/bundle.js:242015:13)\n at async request (http://localhost:3000/static/js/bundle.js:221849:15)",
"message": "Failed to fetch"
}
}
}
}
}
I am trying to implement the BlockCypher Ethereum API following the docs here:
https://www.blockcypher.com/dev/ethereum/#transaction-api
I am using the Test Network /beth/test, rather than /eth/main.
I successfully created 2 addresses and called the faucet to fill one address with some 1000000000000000000 wei.
But then I can’t seem to be able to send a valid transaction…
Here are all (test) info:
ADDRESS 1
{
"private": "42eb005cbebd33f55b821864fcdc0755876317345ac9d8ad2bf94d734f78395f",
"public": "04c7238abb2e99c50ef3e4fabe21dbf2701f9dc60de24b40e743e84745984957ba7059a3e0b38c226b3580a95ed0e154fba407d089f5c02f90aa5797ead7fc190e",
"address": "7a9373010ce86d8fcd7dd46588d351cddabe7ce8"
}
ADDRESS 2
{
"private": "4a62456df43b89244d349948008064cfe1279ef3a632823f30b371ac54f879a1",
"public": "046c01b338e3c5224aa70fa302fefa5c9767d0f79aa16327e703d01924e894809460b22ab52974706543682d8e16063fd6cbd302b052762a3be5d7720efc4d2fa9",
"address": "73befec27510c64c303d82191eaf276a94603090"
}
Address 2 contains 1000000000000000000 wei, and I am trying to send 1200000000000000 wei to Address 1.
I use the New Transaction method, I send this:
{"inputs":[{"addresses": ["73befec27510c64c303d82191eaf276a94603090"]}],"outputs":[{"addresses": ["7a9373010ce86d8fcd7dd46588d351cddabe7ce8"], "value": 1200000000000000}]}
And I get this response:
{
"tx": {
"block_height": -1,
"block_index": 0,
"hash": "4e875a673e59f0b2d16123659b3a72a8d818a7cb832c5ed1a4bbf8f5b0a4ee87",
"addresses": [
"73befec27510c64c303d82191eaf276a94603090"
],
"total": 1200000000000000,
"fees": 21000000000000,
"size": 43,
"gas_limit": 21000,
"gas_price": 1000000000,
"received": "2018-05-27T13:51:23.247159854Z",
"ver": 0,
"double_spend": false,
"vin_sz": 1,
"vout_sz": 1,
"inputs": [
{
"sequence": 0,
"addresses": [
"73befec27510c64c303d82191eaf276a94603090"
]
}
],
"outputs": [
{
"value": 1200000000000000,
"addresses": [
"7a9373010ce86d8fcd7dd46588d351cddabe7ce8"
]
}
]
},
"tosign": [
"8b765bd6c2065f612eb00aa55c50759049779cff50151395aefc5a3dafa5cc10"
]
}
Then I use Signer with the ToSign from the New Transaction response, and a Hex-Encoded Private Key of Address 2:
signer 8b765bd6c2065f612eb00aa55c50759049779cff50151395aefc5a3dafa5cc10 34613632343536646634336238393234346433343939343830303830363463666531323739656633613633323832336633306233373161633534663837396131
I get this signature:
30440220644db87755b0a8620e7e52bd64977c79350c0989afd587090be13a8f76efbf3a0220463eb6351c839b086f5874f6a125ec4723fb30eb26a6a831600cb4d3034cd9d3
So then I try the Send Transaction method of BlockCypher, here’s my request:
{
"tx": {
"block_height": -1,
"block_index": 0,
"hash": "4e875a673e59f0b2d16123659b3a72a8d818a7cb832c5ed1a4bbf8f5b0a4ee87",
"addresses": [
"73befec27510c64c303d82191eaf276a94603090"
],
"total": 1200000000000000,
"fees": 21000000000000,
"size": 43,
"gas_limit": 21000,
"gas_price": 1000000000,
"received": "2018-05-27T13:51:23.247159854Z",
"ver": 0,
"double_spend": false,
"vin_sz": 1,
"vout_sz": 1,
"inputs": [
{
"sequence": 0,
"addresses": [
"73befec27510c64c303d82191eaf276a94603090"
]
}
],
"outputs": [
{
"value": 1200000000000000,
"addresses": [
"7a9373010ce86d8fcd7dd46588d351cddabe7ce8"
]
}
]
},
"tosign": [
"8b765bd6c2065f612eb00aa55c50759049779cff50151395aefc5a3dafa5cc10"
],
"pubkeys": ["046c01b338e3c5224aa70fa302fefa5c9767d0f79aa16327e703d01924e894809460b22ab52974706543682d8e16063fd6cbd302b052762a3be5d7720efc4d2fa9"],
"signatures": ["30440220644db87755b0a8620e7e52bd64977c79350c0989afd587090be13a8f76efbf3a0220463eb6351c839b086f5874f6a125ec4723fb30eb26a6a831600cb4d3034cd9d3"]
}
And I get back this error:
"Address 0xF6A14d976c86bDbe050cA9426aD491d750be33B1 computed from signature differs from provided one 73befec27510c64c303d82191eaf276a94603090."
Any idea of what am I doing wrong?
I tried several things already, read a few similar issues online, but still no luck.
I also tried the Raw Transaction method of BlockCypher, and also no luck there..
I am not clear what it means as “raw hex-encoded transaction”, I tried to send the Hex-Encoded input I sent to New Transaction:
{"inputs":[{"addresses": ["73befec27510c64c303d82191eaf276a94603090"]}],"outputs":[{"addresses": ["7a9373010ce86d8fcd7dd46588d351cddabe7ce8"], "value": 1200000000000000}]}
So I sent to https://api.blockcypher.com/v1/beth/test/txs/push?token=[mytoken] this:
{"tx":"22696E70757473223A5B7B22616464726573736573223A205B2237336265666563323735313063363463333033643832313931656166323736613934363033303930225D7D5D2C226F757470757473223A5B7B22616464726573736573223A205B2237613933373330313063653836643866636437646434363538386433353163646461626537636538225D2C202276616C7565223A20313230303030303030303030303030307D5D"}
But I get the error:
“rlp: expected input list for types.TxData”.
Please, any help is very much appreciated!
The private key you're passing to the signer tool is not correct. As Address 2 is the sender in your example, you should be using its private key instead, which is 4a62456df43b89244d349948008064cfe1279ef3a632823f30b371ac54f879a1.
I am sending my jenkins logs to logstash with following config:
redis {
host => "localhost"
key => "logstash"
data_type => "list"
codec => json
}
This works as smooth as expected, now i see follwoing message in KIBANA:
{
"_index": "logstash-2015.12.18",
"_type": "logs",
"_id": "AVG1BN5LXZBIbp7HE4xN",
"_score": null,
"_source": {
"data": {
"id": "965",
"projectName": "NicePJ",
"displayName": "#965",
"fullDisplayName": "NicePJ",
"url": "job/NIcePJ/965/",
"buildHost": "Jenkins",
"buildLabel": "master",
"buildNum": 965,
"buildDuration": 1,
"rootProjectName": "NicePJ",
"rootProjectDisplayName": "#965",
"rootBuildNum": 965,
"buildVariables": {
"target_SUT": "0201",
"report_warnings": "false",
"product": "Ours",
"testsuite": "Exciting_stuff5",
"qft_version": "current",
"target_task": "t324",
"branch": "test",
"testcase": "",
"revision": "HEAD",
"node": "hsqs960",
"client": "Desktop",
"run_specific_test": "false",
"user": "xxxxx"
}
},
"message": [
"A This is a message XYZ"
],
"source": "jenkins",
"source_host": "http://serverXL:8080/",
"#timestamp": "2015-12-18T12:16:02.000Z",
"#version": 1
},
"fields": {
"#timestamp": [
1450440962000
]
},
"sort": [
1450440962000
]
}
Now i want to filter the message field for certain messages, but i cant get it work. How can i filter the message field and how can i access the buildHost field to use it in an if statement in the pipeline?
Following i tried after many examples:
if[data][buildHost]== "jenkins"
{
grok
{
match => { "message[0]" => "\[exec\]\s*\<%{GREEDYDATA:test}\s*\[%{GREEDYDATA:result}\]" }
}
}
But this is just not working at all, please help me out.
Conditional
The == compares simple string and case sensitive, so "jenkins" will not match as your data shows ("buildHost": "Jenkins",):
if[data][buildHost]== "jenkins"
But following does:
if[data][buildHost]== "Jenkins"
If you need match both, you can either use || or regex =~.
Grok
The grok is a filter to parse message with regex pattern. You can test your regex pattern with
online grok debugger
Kibana dev tools's grok debugger
I am trying to publish cucumber reports as results through Jenkins.
I am using Selenium + Protractor to run my tests. This produces a Json file which when read through Jenkins "publish cucumber reports as results" utility, gives the following error:
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getFileName' in class net.masterthought.cucumber.json.Feature
threw exception java.lang.NullPointerException at
templates/pages/featureOverview.vm[line 360, column 73]
Following is the snapshot of my Json file:
[
{
"description": "1: As a user I want to make sure that the log in button available in the page loaded.",
"assertions": [
{
"passed": true
},
{
"passed": true
}
],
"duration": 3094516706
},
{
"description": "2: As a user with correct username and incorrect password, user should be shown error message.",
"assertions": [
{
"passed": true
},
{
"passed": true
}
],
"duration": 694093948
},
{
"description": "3: As a user with incorrect username and correct password, user should be shown error message.",
"assertions": [
{
"passed": true
},
{
"passed": true
},
{
"passed": true
}
],
"duration": 1577337485
},
{
"description": "4: As a user I want to sign in to the Space Planner Platform directly from a URL using my Self Serve Login details.",
"assertions": [
{
"passed": true
},
{
"passed": true
},
{
"passed": true
}
],
"duration": 2090233702
}
]