Deleting a bad changelog in Liquibase

1 – Identify the change set you need to remove (to run again)

<changeSet author=“me” id=“2.1.0-x-table”>
<sqlFile path=“/mycustomsql.sql”
relativeToChangelogFile=false” stripComments=“true” />

2 – As your db instance owner, remove the change log entry
[db2inst1@db myfolder]$ db2 “DELETE from myschema.DATABASECHANGELOG WHERE ID = ‘2.1.0-x-table'”
DB20000I The SQL command completed successfully.

3 – Confirm the change log is removed
[db2inst1@db myfolder]$ db2 “select * from myschema.DATABASECHANGELOG WHERE ID = ‘2.1.0-x-table’”

Logging using PQS lower than 4.6

To logging PQS, you can log using NGINX as a proxy that records the HTTP Request Body and the timing.

On your Centos/RHEL machine, switch to root privileges
sudo -s

Add nginx.repo

Install nginx packages, and you can setup a proxy
yum install nginx.x86_64 -y

Create the nginx configuration so you have a log_format that outputs the body ($request_body) and time ($request_time)

Create the default server configuration, and set the proxy_pass to point to your PQS/phoenix query server

Reload nginx
nginx -s reload

Tail the log file to see the data called.
[root@data-com-4 pbastide]# tail -f /var/log/nginx/request-body.log

Logging using PQS 4.7 and Higher

1 – Drop this into /tmp and chmod 755 on the file
In practice, I’d probably put it in /opt/phoenix/config or /etc/hbase/phoenix

2 – Edit the (/opt/phoenix/bin/ )
Around line 128 (hopefully not changed much from 4.7 to 4.8), add this
" -Dlog4j.configuration=file:///tmp/" + \

3 – Restart phoenix
/opt/phoenix/bin/ stop
/opt/phoenix/bin/ start

4 – scan the file
grep -i XYZ.dim /tmp/phoenix-query.log

2017-01-05 13:40:39,227 [qtp-1461017990-33 - /] TRACE org.apache.calcite.avatica.remote.ProtobufTranslationImpl - Serializing response 'results { connection_id: "0deb2c47-53e5-4846-b22b-ba3faa0bc37a" statement_id: 1 own_statement: true signature { columns { searchable: true display_size: 32 label: "ID" column_name: "ID" precision: 32 table_name: "XYZ.DIM" read_only: true column_class_name: "java.lang.String" type { id: 12 name: "VARCHAR" rep: STRING } } sql: "select ID from XYZ.DIM WHERE VLD_TO_TS IS NULL LIMIT 1" cursor_factory { style: LIST } } first_frame { done: true rows { value { scalar_value { type: STRING string_value: "00025a56f1084f0584a50f7cf9dc4bfc" } } } } update_count: 18446744073709551615 metadata { server_address: "" } } metadata { server_address: "" }'

You can then correlated on connection_id and analyze the log file for data.

Hamcrest Matchers Issue

I’ve been using Rest-Assured as a simple Integration Test tool for the last few months, and suddenly I started seeing this issue.

java.lang.SecurityException: class "org.hamcrest.Matchers"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(
at java.lang.ClassLoader.preDefineClass(
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at com.test.restassured.TestCode.testaCreateTenant(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.RunBefores.evaluate(
at org.junit.runners.ParentRunner.runLeaf(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

I wiped my .m2 repository of org.hamcrest.Matchers jar files, and rebuilt the maven repository (mvn clean package install -DskipTests).   The problem remained.

I ran across a simple for my code (on the rest-assured site thanks to johanhaleby)

I changed the code to

import static org.hamcrest.CoreMatchers.equalsTo;

Now the code passes the tests without a problem

CURL and LDAPS – How to Search and Debug

I hit an issue where I needed to Search LDAP from a machine I didn’t have access to install new RPMs on. I found this cool article on CURL and LDAP Search. I had to make some minor modifications to get it to work with a secure connection (–insecure ldaps:// and 636). I also added -v to diagnosis some connection problems.

curl "ldaps://,objectClass?sub?(objectClass=)" -u "cn=user1,ou=test_org3,o=dr,DC=IBM.COM" --insecure -v
Enter host password for user 'cn=user1,ou=test_org3,o=dr,DC=IBM.COM':
* Trying
* Connected to ( port 636 (#0)
* LDAP local: LDAP Vendor = OpenLDAP ; LDAP Version = 20428
* LDAP local: ldaps://,objectClass?sub?(objectClass=
* LDAP local: trying to establish encrypted connection
objectClass: domain
objectClass: top

DN: o=dr,
objectClass: organization
objectClass: top

DN: ou=test_org3,o=dr,
objectClass: organizationalunit
objectClass: top

You can then find the userids you need quickly. I left them off the output intentionally.

If you see connected, but no results, I suggest changing to the top level of the ldap, and using this string – ldaps://,objectClass?sub?(objectClass=*)