I am running ca query in JCLI which is giving huge output
jira --action getIssueList --user ColdBear --password Eskimo jira --server http://Cold.bear.com:8080 --file "E:\temp\Test.csv" --search "Project=Colder AND createdDate >= 2013-04-02 AND createdDate <= 2013-04-10" --outputFormat 999 -v >>err2c.log
Error file is also huge
I have tried formats 200 and 998 but not all fields are coming(some are custom)
Issue Type
Key
Summary
Description
Assignee
Reporter
Priority
Status
Resolution
Created
Resolved
User Impacted
Updated
Root Cause
Linked Issues
Can i Choose specific Fields
You can choose specific fields like this:
--columns "key,2,custom1,custom2"
Source: https://bobswift.atlassian.net/wiki/display/JCLI/Examples
Related
I am using vsql.exe on an external Vertica database for which I don't have any administrative access. I use some views with simple SELECT+FROM+WHERE queries.
These queries 90% of the time work just fine, but some times, randomly, I get this error:
ERROR 3326: Execution time exceeded run time cap of 00:00:45
The strange thing is that this error can happen way after those 45 seconds, even after 3 minutes. I've been told this is related to having different resource pools, but anyway I don't want to dig into that.
The problem is that when this occurs, vsql.exe returns errorlevel 0 and there is (apparently almost) no way to know this failed.
The output of the query is stored in a csv file. When it succeeds, it ends with (#### rows). But when it fails with this error, it just stops at any point of the csv, and its resulting size is around half of what's expected. This is of course not what you would expect when an error occurs, like no output or an empty one.
If there is a connection error or if the query has syntax errors, the errorlevel is not 0, so in those cases it behaves as expected.
I've tried many things, like increasing the timeout or adding -v ON_ERROR_STOP=ON to the vsql.exe parameters, but none of that helped.
I've googled a lot and found many people having this error, but the solutions are mostly related to increasing the timeouts, not related to the errorlevel returned.
Any help will be greatly appreciated.
TL;DR: how can I detect an error 3326 in a batch file like this?
#echo off
vsql.exe -h <hostname> -U <user> -w <pwd> -o output.cs -Ac "SELECT ....;"
echo %errorlevel% is always 0
if errorlevel 1 echo Error!! But this is never displayed.
Now that's really unexpected to me. I don't have Windows available just now, but trying on my Mac - at first just triggering a deliberate error:
$ vsql -h zbook -d sbx -U dbadmin -w $VSQL_PASSWORD -v ON_ERROR_STOP=ON -Ac "select * from foobarfoo"
ERROR 4566: Relation "foobarfoo" does not exist
$ echo $?
1
With ON_ERROR_STOP set to ON, this should be the behaviour everywhere.
Could you try what I did above through Windows, just with echo %ERRORLEVEL% instead of echo $?, just from the Windows command prompt and not in a batch file?
Next test: I run on resource pool general in my little test database, so I temporarily modify it to a runtime cap of 30 sec, run a silly query that will take over 30 seconds with ON_ERROR_STOP set to ON, collect the value returned by vsql and set the runtime cap of general back to NONE. I also have the %VSQL_* % env variables set so I don't have to repeat them all the time:
rem Windows way to set environment variables for vsql:
set VSQL_HOST=zbook
set VSQL_DATABASE=sbx
set VSQL_USER=dbadmin
set VSQL_PASSWORD=***masked***
Now for the test (backslashes, in Linux/MacOs escape a new line, which enables you to "word wrap" a shell command. Use the caret (^) in Windows for that):
marco ~/1/Vertica/supp $ # set a runtime cap
marco ~/1/Vertica/supp $ vsql -i -c \
"alter resource pool general runtimecap '00:00:30'"
ALTER RESOURCE POOL
Time: First fetch (0 rows): 116.326 ms. All rows formatted: 116.730 ms
marco ~/1/Vertica/supp $ vsql -v ON_ERROR_STOP=ON -iAc \
"select count(*) from one_million_rows a cross join one_million_rows b"
ERROR 3326: Execution time exceeded run time cap of 00:00:30
marco ~/1/Vertica/supp $ # test the return code
marco ~/1/Vertica/supp $ echo $?
1
marco ~/1/Vertica/supp $ # clear the runtime cap
marco ~/1/Vertica/supp $ vsql -i -c \
"alter resource pool general runtimecap NONE "
ALTER RESOURCE POOL
Time: First fetch (0 rows): 11.148 ms. All rows formatted: 11.383 ms
So it works in my case. Your line:
if errorlevel 1 echo Error!! But this is never displayed.
... never echoes anything because the previous line, with echo will return 0 to the shell, overriding the previous errorlevel.
Try it command by command on your Windows command prompt, and see what happens. Just echo %errorlevel%, without evaluating it.
And I notice that you are trying to export to CSV format. Then, try this:
Format the output unaligned (-A)
set the field separator to comma (-F ',')
remove the footer '(n rows)' (-P footer)
limit the output to 5 rows in the query for test
(I show the output before redirecting to file):
marco ~/1/Vertica/supp $ vsql -A -F ',' -P footer -c "select * from one_million_rows limit 5"
id,id_desc,dob,category,busid,revenue
0,0,1950-01-01,1,====== boss ========,0.000
1,-1,1950-01-02,2,kbv-000001kbv-000001,0.010
2,-2,1950-01-03,3,kbv-000002kbv-000002,0.020
3,-3,1950-01-04,4,kbv-000003kbv-000003,0.030
4,-4,1950-01-05,5,kbv-000004kbv-000004,0.040
Not aligning is much faster than aligning.
Then, as you spend most time in the fetching of the rows (that's because you get a timeout in the middle of an output file write process), try fetching more rows at a time than the default 1000. You will need to play with the value, depending on the network settings at your site until you get your best value:
-v ROWS_AT_A_TIME=10000
Once you're happy with the tested output, try this command (change the SELECT for your needs, of course ....):
marco ~/1/Vertica/supp $ vsql -A -F ',' -P footer \
-v ON_ERROR_STOP=ON -v ROWS_AT_A_TIME=10000 -o one_million_rows.csv \
-c "select * from one_million_rows"
marco ~/1/Vertica/supp $ wc -l one_million_rows.csv
1000001 one_million_rows.csv
The table actually contains one million rows. Note the line count in the file: 1,000,001. That's the title line included, but the footer (1000000 rows) removed.
Is it possible to obtain the Job Description or the Job Parameter Description in run-time or later like the BUILD_ID or JOB_NAME?
I search for plugins or workarounds and nothing.
Thanks.
This would be Tip/workaround
https://<<yourjenkinsdomain>>/job/<<yourjobname>>/configure (will open the configuration of your job)
However
https://<<yourjenkinsdomain>>/job/<<yourjobname>>/config.xml (will give the job configuration in an xml format)
You can download this xml via curl at run time or using jenkins cli and use a grep with -B option to find description per value.
Considering you have copied the with name "config.xml"
cat config.xml | grep -B 1 "description"
Will give you description and build parameter name
Grep command
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines.
Places a line containing a group separator (--) between
contiguous groups of matches. With the -o or --only-matching
option, this has no effect and a warning is given.
Sample output :
cat config.xml | grep -B 1 "description"
<actions/>
<description>Job description : Automation </description>
--
<name>branch</name>
<description>mandatory parameter , used for automation</description>
--
Alternative :
jenkins cli has an option to set value
set-build-description Sets the description of a build.
set-build-parameter Update/set the build parameter of the current build in progress. [deprecated]
you can write a small script and get the values into variables and use them
I'm brand new, fresh and clean with Neo4J. Just downladed and installed the Neo4J Desktop application, working offline. Noticed that the plugins don't get the install button enabled.
Creating a graph DB and trying to install manually the apoc plugin with latest jar file (compatible one), it fails to get loaded apparently.
Using NEO4J Desktop 1.1.17 offline + server 3.5.2 + APOC 3.5.0.2 jar in plugins folder
I've followed the online doc and updated neo4j conf auhtorizing things in there.
dbms.security.procedures.unrestricted=apoc.*
dbms.security.procedures.whitelist=apoc.*
Restarted things but still with no success. What Am I doing wrong in here ?
Seems quite a basic issue but as there is no stupid question...
Thanks for your feedbacks
Best regards
Any hint.
I have neo4j server (not desktop) version 3.5.4.
I downloaded apoc 3.5.0.3 which if memory serves was a zip archive. After unzipping, I copied the one jar into my plugins directory.
I modified the config file as you indicated. I used commas to separate the entries.
I did not update the whitelist parameter which remains commented out in my config file.
Next I restarted neo4j and the apoc procedures seem to work.
Have a look at my transcript below for the details of my setup:
gmc#linux-ihon:/usr/local/neo4j-community-3.5.4> ls -l plugins
total 14808
-rw-r--r-- 1 gmc users 13695353 Apr 18 09:51 apoc-3.5.0.3-all.jar
-rw-r--r-- 1 gmc users 1459334 Apr 11 00:34 graph-algorithms-algo-3.5.4.0.jar
-rw-r--r-- 1 gmc users 2217 Apr 3 18:09 README.txt
gmc#linux-ihon:/usr/local/neo4j-community-3.5.4> grep whitelist conf/neo4j.conf
#dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*
gmc#linux-ihon:/usr/local/neo4j-community-3.5.4> grep unrestricted conf/neo4j.conf
#dbms.security.procedures.unrestricted=my.extensions.example,my.procedures.*
dbms.security.procedures.unrestricted=apoc.*,algo.*
gmc#linux-ihon:~> cypher-shell --username neo4j
password: ****
Connected to Neo4j 3.5.4 at bolt://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j> call apoc.help("apoc.help");
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| type | name | text | signature | roles | writes |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "procedure" | "apoc.help" | "Provides descriptions of available procedures. To narrow the results, supply a search string. To also search in the description text, append + to the end of the search string." | "apoc.help(proc :: STRING?) :: (type :: STRING?, name :: STRING?, text :: STRING?, signature :: STRING?, roles :: LIST? OF STRING?, writes :: BOOLEAN?)" | NULL | NULL |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row available after 31 ms, consumed after another 1 ms
neo4j>
FWIW, the graph algorithms procedures also work.
It is possible that you have two installations and modified the non-running one???
I'm using open source version of InfluxDB on Windows with default settings. I tried 1.6.4 and 1.7.1.
When I specify any retention policy then default, the data is not stored.
For test purposes I've created two identical retention policies - default and non_default:
show retention policies
name duration shardGroupDuration replicaN default
---- -------- ------------------ -------- -------
default 168h0m0s 24h0m0s 1 true
non_default 168h0m0s 24h0m0s 1 false
When I'm posting data with the non_default retention policy nothing happens. The server returns a success but there is no data in metrics.
$ curl -i -XPOST " http://influx1:8086/write?db=test&rp=non_default" --data-binary 'TestViaHttp,mytag=a myfield=90'
When I'm posting data with default retention policy it is inserted successfully.
$ curl -i -XPOST " http://influx1:8086/write?db=test&rp=default" --data-binary 'TestViaHttp,mytag=a myfield=90'
Does anyone have an idea how to fix this?
Figured out, that you should specify retention policy in select statement.
SELECT * FROM "non_default"."TestViaHttp"
Looks like retention policies are similar to schemas in MS SQL.
I am playing with hyperledger-fabric v.1.0 - actually a newbie. How can I check the chain height ? Is there a command or something that I can use to "ask" about the blockchain height? Thanks in advance.
Well, you have a few options of how you can do it:
You can leverage peer cli command line tool to obtain latest available block by running
peer channel fetch newest -o ordererIP:7050 -c mychannel last.block
Next you can leverage configtxlator to decode content of the block as following:
curl -X POST --data-binary #last.block http://localhost:7059/protolator/decode/common.Block
(note you need to start configtxlator first)
Alternative path assumes you are going to use one of available SDK's to invoke QSCC (Query System ChainCode) with GetChainInfo command. This will return you back following structure:
type BlockchainInfo struct {
Height uint64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=currentBlockHash,proto3" json:"currentBlockHash,omitempty"`
PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"`
}
Which has information about current ledger height.
Another alternative.
Using the cli peer command line (for example docker exec -it cli bash) you can do:
peer channel getinfo -c mychannel
It seems that I found something - maybe cumbersome, but better than nothing:
Command:
docker logs -f peer0.org1.example.com 2>&1 | grep blockNo
Check for the "latest" line in the output, something like:
2017-07-18 19:40:39.586 UTC [historyleveldb] Commit -> DEBU b75b Channel [mychannel]: Updates committed to history database for blockNo [34]
So, if I am not wrong, in this case the block height is: 34
Thanks
you can use blockchain-explorer (UI tool)
https://github.com/hyperledger/blockchain-explorer
You should also be able to use the fabric CORE API (JSON/REST).
See the docs for the Blockchain GET/chain operation at;
https://github.com/hyperledger-archives/fabric/blob/master/docs/API/CoreAPI.md#rest-api