Quantcast
Channel: A Portal to a Portal
Viewing all 1851 articles
Browse latest View live

IBM API Connect - "Unexpected token ILLEGAL"

$
0
0
So I'm continuing my voyage of discovery with IBM API Connect, and had followed this tutorial to create a simple API using Loopback: -


Annoyingly, when I came to test my API, I was seeing this: -


and, via Debug, this: -


This is the Gateway Script that I have: -

Can you see what I can see ?

Yeah, I'm at home to Cap'n Copy Paste :-(

I fixed my code: -

saved the API and republished the product.

Now we have this: -


which is far far better.

So, for the record, the copy/paste from Firefox to Safari had introduced some glitches with regard to the apostrophes ( single quotes ).

This has bitten me before on Mac, but I'm stupid and forgot :-(

For the record, the DataPower logs also showed similar: -




IBM API Connect - Now a Happy Bunny - Was Notworking, Now Networking

$
0
0
As per the past few posts, I've been learning my way around IBM API Connect, and had it nearly working - until about 15 minutes ago when it ALL started working.

Without getting too deep into the What and How, the TL;DR; is this …..

I have three VMs; the API Manager, the Developer Portal and the DataPower Gateway.


I'd moved DataPower onto a different Mac, as it requires 8 GB RAM.

I'd sensibly configured that VM to use Bridged, rather than NAT, networking, in order that the API Manager ( APIM ) could "see" DataPower.

However, I'd left APIM and the Portal using NAT networking on the main Mac, for no other reason that laziness.

That was where things went wrong.

Whilst I could happily add the DataPower Service and Service into the APIM configuration, using the Cloud Management Console, I was hitting a 404 whenever I tried to test my APIs, even though the Endpoint was correctly configured: -


So here's the thing ….

Whilst it's crucial that APIM can see DataPower, it's also quite important that DataPower can see APIM :-)

One thing that gave me a clue was this UI: -


specifically the Information icon.

This NOW shows: -


but had previously reported the Management Load Balancing Addresses as (a) being the old NAT address of APIM itself and (b) as down.

Once I switched to Bridged, and sorted out my IP addresses, making sure that I was using addresses in the same subnet, to avoid the need for messy routing …. things suddenly became better.

I did sketch out the networking topology a few months back : -


so I really should've known better.

Bottom line, whilst APIM needs to "see" DataPower, DataPower also needs "see" APIM

If it helps, this is also a rather useful introduction to the networking requirements: -

Firewall requirements

Java to DB2 via TLS 1.2 - A new one on me

$
0
0
So I've been helping a friend debug and resolve a problem whereby his Java 7 code wasn't connecting to a DB2 database via a TLS 1.2 connection.

To validate this, I setup a DB2 instance to support TLS 1.2: -

As root

echo "db2c_ssl 60007/tcp">> /etc/services

As db2inst1

/home/db2inst1/sqllib/gskit/bin/gsk8capicmd_64 -keydb -create -db /home/db2inst1/keystore.kdb -pw passw0rd -stash

/home/db2inst1/sqllib/gskit/bin/gsk8capicmd_64 -cert -create -db /home/db2inst1/keystore.kdb -pw passw0rd -label "odm.uk.ibm.com" -dn "cn=odm.uk.ibm.com,dc=uk,dc=ibm,dc=com" 

db2 update dbm cfg using SSL_SVR_KEYDB /home/db2inst1/keystore.kdb
db2 update dbm cfg using SSL_SVR_STASH /home/db2inst1/keystore.sth
db2 update dbm cfg using SSL_SVR_LABEL odm.uk.ibm.com
db2 update dbm cfg using SSL_SVCENAME db2c_ssl
db2 update dbm cfg using SSL_VERSIONS TLSV12
db2 update dbm cfg using SSL_CIPHERSPECS TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
db2set DB2COMM=TCPIP,SSL
db2stop
db2start


and then validated what the WAS box was seeing: -

openssl s_client -connect odm.uk.ibm.com:60007</dev/null

New, TLSv1/SSLv3, Cipher is AES256-GCM-SHA384
Server public key is 1024 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : AES256-GCM-SHA384


Having relieved the DB2 self-signed certificate: -

openssl s_client -showcerts -connect odm.uk.ibm.com:60007</dev/null | openssl x509 -outform DER > ~/db2.cer

and created a JKS trust store: -

/opt/ibm/WebSphere/AppServer/java/jre/bin/keytool -import -file ~/db2.cer -keystore ~/davehay.jks -alias DB2 -storepass davehay

I then tested my Java code ( see below ) : -

java -cp /opt/ibm/WebSphere/AppServer/ODMjdbcdrivers/DB2/db2jcc.jar:/home/wasadmin DB2connect_ssl2

Instead of working, this generated a trace file ( as per the code ): -

view /tmp/foobar.trc_sds_1 

which contained: -

...
[jcc] BEGIN TRACE_DIAGNOSTICS
[jcc][Thread:main][SQLException@7807b259] java.sql.SQLException
[jcc][Thread:main][SQLException@7807b259] SQL state  = 08001
[jcc][Thread:main][SQLException@7807b259] Error code = -4499
[jcc][Thread:main][SQLException@7807b259] Message    = [jcc][t4][2030][11211][3.61.65] A communication error occurred during operations on the connection's underlying socket, socket input stream,
or socket output stream.  Error location: T4Agent.sendRequest() - flush (-2).  Message: Received fatal alert: handshake_failure. ERRORCODE=-4499, SQLSTATE=08001
[jcc][Thread:main][SQLException@7807b259] Stack trace follows
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][3.61.65] A communication error occurred during operations on the connection's underlying socket, socket input stream, 
or socket output stream.  Error location: T4Agent.sendRequest() - flush (-2).  Message: Received fatal alert: handshake_failure. ERRORCODE=-4499, SQLSTATE=08001
        at com.ibm.db2.jcc.am.ed.a(ed.java:319)

...

I turned on debugging: -

java -cp /opt/ibm/WebSphere/AppServer/ODMjdbcdrivers/DB2/db2jcc.jar:/home/wasadmin -Djavax.net.debug=ssl DB2connect_ssl2

which told me what I already knew: -

main, WRITE: TLSv1 Handshake, length = 123
main, READ: TLSv1.2 Alert, length = 2
main, RECV TLSv1 ALERT:  fatal, handshake_failure
main, called closeSocket()
main, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Similarly, DB2 told me that things were awry: -

db2diag -f

which returned: -

2017-08-18-19.27.52.683893+060 I48627542E482         LEVEL: Error
PID     : 128279               TID : 140419925010176 PROC : db2sysc 0
INSTANCE: db2inst1             NODE : 000
APPHDL  : 0-24873
HOSTNAME: odm.uk.ibm.com
EDUID   : 23                   EDUNAME: db2agent () 0
FUNCTION: DB2 UDB, common communication, sqlccMapSSLErrorToDB2Error, probe:30
MESSAGE : DIA3604E The SSL function "gsk_secure_soc_init" failed with the 
          return code "402" in "sqlccSSLSocketSetup".


I've seen this before: -



However, this time around the solution was … different.

I experimented with various tweaks to the Java command-line: -

java -cp /opt/ibm/WebSphere/AppServer/ODMjdbcdrivers/DB2/db2jcc.jar:/home/wasadmin -Dcom.ibm.jsse2.overrideDefaultProtocol=TLSv12 DB2connect_ssl2

and: -

java -cp /opt/ibm/WebSphere/AppServer/ODMjdbcdrivers/DB2/db2jcc.jar:/home/wasadmin -Dcom.ibm.jsse2.overrideDefaultProtocol=TLSv12-Dhttps.cipherSuites=TLS_RSA_WITH_AES_256_GCM_SHA384 DB2connect_ssl2

etc. but to no avail.

I'd also verified that my JRE was set to support the stronger export-grade ciphers: -

java -cp /home/wasadmin/ CipherTest

PASSED: Max AES key length OK! - >= 256 (2147483647).

At which point, I was scratching my head ….

… and then I read this: -


which said, in part, this: -

...
3. Identify your JCC driver version by issuing the following command:
java -cp db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -version

4. Determine if you need to update your JCC driver.

• If you use Java 8 and an IBM JDK, the minimum recommended level is 4.18.
• Otherwise, update to version 4.22.29 or higher. This is the version that shipped with DB2 v11.1 FP1.
You can download a new JCC driver here. If you deploy your application in a Bluemix environment, either remove the JCC driver ( db2jcc4.jar) in the application's WebContent/WEB-INF/lib/ folder or else ensure that the driver in this folder is up to date before you build and deploy the application. 
...

Given that I'm using DB2 11.1, as per this: -

db2level 

DB21085I  This instance or install (instance name, where applicable: 
"db2inst1") uses "64" bits and DB2 code release "SQL11012" with level 
identifier "0203010F".
Informational tokens are "DB2 v11.1.2.2", "s1706091900", "DYN1701310100AMD64", 
and Fix Pack "2".
Product is installed at "/opt/ibm/db2/V11.1".

I checked the version of the JDBC driver that I was using ( this was shipped with IBM ODM Rules 8.9, which is what I happen to using for my tests, even though this is ONLY Java to DB2 testing ): -

java -cp /opt/ibm/WebSphere/AppServer/ODMjdbcdrivers/DB2/db2jcc.jar com.ibm.db2.jcc.DB2Jcc -version

IBM DB2 JDBC Universal Driver Architecture 3.61.65

java -cp /opt/ibm/WebSphere/AppServer/ODMjdbcdrivers/DB2/db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -version

IBM Data Server Driver for JDBC and SQLJ 4.11.69

which is below the recommended version 4.22.29.

Therefore, I checked the versions that ship with DB2 itself: -

java -cp /opt/ibm/db2/V11.1/java/db2jcc.jar com.ibm.db2.jcc.DB2Jcc -version

IBM DB2 JDBC Universal Driver Architecture 3.72.30

java -cp /opt/ibm/db2/V11.1/java/db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -version

IBM Data Server Driver for JDBC and SQLJ 4.23.42

so I tested my Java class using this updated driver: -

java -cp /opt/ibm/db2/V11.1/java/db2jcc.jar:/home/wasadmin DB2connect_ssl2

and it returned: -

 Connected to database with type 4 url
000010 CHRISTINE
000020 MICHAEL
000030 SALLY
000050 JOHN
000060 IRVING
000070 EVA
000090 EILEEN
000100 THEODORE
000110 VINCENZO
000120 SEAN
000130 DELORES
000140 HEATHER
000150 BRUCE
000160 ELIZABETH
000170 MASATOSHI
000180 MARILYN
000190 JAMES
000200 DAVID
000210 WILLIAM
000220 JENNIFER
000230 JAMES
000240 SALVATORE
000250 DANIEL
000260 SYBIL
000270 MARIA
000280 ETHEL
000290 JOHN
000300 PHILIP
000310 MAUDE
000320 RAMLAL
000330 WING
000340 JASON
200010 DIAN
200120 GREG
200140 KIM
200170 KIYOSHI
200220 REBA
200240 ROBERT
200280 EILEEN
200310 MICHELLE
200330 HELENA
200340 ROY


The moral of the story - the version of the JDBC driver MAY well be more important than first I had realised.

If you need an updated driver, please go here: -


Final point, here's the Java code that I'm using: -

DB2connect_ssl2.java

import java.lang.*;
import java.sql.*;
import java.io.*;

class DB2connect_ssl2
{
public static void main(String argv[])
{
try
{
Connection con = null;
PreparedStatement pstmt = null;

try
{
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
con = DriverManager.getConnection( "jdbc:db2://odm.uk.ibm.com:60007/SAMPLE" +
              ":user=db2inst1;password=passw0rd;" +
              "sslConnection=true;sslTrustStoreLocation=/home/wasadmin/davehay.jks;sslTrustStorePassword=davehay;" +
              "keepAliveTimeout=10;" +
      "traceDirectory=/tmp;" +
      "traceFile=foobar.trc;" +
      "traceFileAppend=false;" +
      "traceLevel=-1;" );
System.out.println(" Connected to database with type 4 url") ;
}
catch (Throwable e)
{
System.out.println("Connect failed" + e);
}

try
{
pstmt = con.prepareStatement("select * from DB2INST1.EMP");
}
catch (Throwable e)
{
System.out.println("Statement Prepare failed" + e);
}

try
{
ResultSet s = pstmt.executeQuery();

        while (s.next())
{
String v_id = s.getString(1);
String v_stream_id = s.getString(2);
System.out.println( v_id + "" + v_stream_id );
}
s.close();
}
catch (Throwable e)
{
System.out.println("fetch processing failed");
}
con.close();
}
catch (Exception e)
{
System.out.println("Connect failed" + e);
}
}
}


and here's another one: -

JdbcTestDB2.java
 
import java.sql.Connection ;
import java.sql.DriverManager ;
import java.sql.ResultSet ;
import java.sql.Statement ;
import java.sql.SQLException;

import org.omg.CORBA.VersionSpecHelper;

class JdbcTestDB2
{
public static void main (String args[])
{
try
{
Class.forName("com.ibm.db2.jcc.DB2Driver");
}
catch (ClassNotFoundException e)
{
System.err.println (e) ;
System.exit (-1) ;
}
String hostname = "odm.uk.ibm.com";
int port = 60007;
String dbName = "SAMPLE";
String userName = "db2inst1";
String password = "passw0rd";
String sslConnection = "true";

java.util.Properties properties = new java.util.Properties();
properties.put("user",userName);
properties.put("password", password);
properties.put("sslConnection", sslConnection);
properties.put("sslTrustStoreLocation","/home/wasadmin/davehay.jks");
properties.put("sslTrustStorePassword","davehay");

String url = "jdbc:db2://" + hostname + ":" + port + "/" + dbName;
try
{
Connection connection = DriverManager.getConnection(url,properties);

String query = "select EMPNO,FIRSTNME,LASTNAME from DB2INST1.EMPLOYEE" ;

Statement statement = connection.createStatement () ;
ResultSet rs = statement.executeQuery (query) ;

while ( rs.next () )
System.out.println (rs.getString (1) + "" + rs.getString(2) + "" + rs.getString(3)) ;
connection.close () ;
}
catch (java.sql.SQLException e)
{
System.err.println (e) ;
System.exit (-1) ;
}
}
}


Using Sed and Aw to munge JSON

$
0
0
One of my friends had a requirement to pull apart from JSON data, stripping out specific "columns" of data, ideally using standard Unix/Linux commands, again ideally in one single command.

This is with what I came up :-)

So here's an example of the JSON data: -

davehay.json

{
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
"givenName": "Dave",
"familyName": "Hay",
"eddress": "david_hay@uk.ibm.com"
}

and this is the desired output: -

Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com
Hay
david_hay@uk.ibm.com


and this is the script that I developed: -

sed -n '/familyName/,/eddress/p' davehay.json | sed 's/,//' | sed 's/"//g' | awk '{printf "%s\n", $2}'

The way this works is: -

  • The first sed command pulls out everything between the familyName and eddress columns
  • The second sed command strips out the comma ( , ) terminator
  • The third sed command strips out the double quotes ( " )
  • The awk command prints the second column, thus just the data, rather than the column header

If I wanted this: -

Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com
Dave
Hay
david_hay@uk.ibm.com


then I'd adapt the command: -

sed -n '/givenName/,/eddress/p' davehay.json | sed 's/,//' | sed 's/"//g' | awk '{printf "%s\n", $2}'

Like most things, I bet there're a million ways to achieve the same objective :-)

But this'll do for me :-)

IBM Bluemix, Cloud Foundry and IBM Containers - fatal error: unexpected signal during runtime execution

$
0
0
Whilst tinkering with IBM Bluemix, using the underlying Cloud Foundry (CF) and IBM Containers (IC) capabilities, I was looking to update the IC plugin: -

cf ic update

You are using version 0.8.934 of the IBM Containers plug-in.
Version 0.8.1028 of the plug-in is available for you to install.
Run the "cf ic update" command to update your plug-in to the current version.
You can review the documentation to see the changes that are included in the new version.
https://www.ng.bluemix.net/docs/containers/container_cli_reference_cfic_versions.html

To update the IBM Containers plug-in, run the following commands:

cf uninstall-plugin IBM-Containers
cf install-plugin https://static-ice.ng.bluemix.net/ibm-containers-mac


cf uninstall-plugin IBM-Containers

Uninstalling plugin IBM-Containers...
OK
Plugin IBM-Containers successfully uninstalled.



which sadly carped out with: -

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0xb01dfacedebac1e pc=0xfb2b]

runtime stack:
runtime.throw(0xafe400, 0x2a)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/panic.go:547 +0x90
runtime.sigpanic()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/sigpanic_unix.go:12 +0x5a
runtime.unlock(0xf80220)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/lock_sema.go:107 +0x14b
runtime.(*mheap).alloc_m(0xf80220, 0x40, 0xffffff0100000000, 0x3140c38)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/mheap.go:492 +0x314
runtime.(*mheap).alloc.func1()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/mheap.go:502 +0x41
runtime.systemstack(0x700006096dc8)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/asm_amd64.s:307 +0xab
runtime.(*mheap).alloc(0xf80220, 0x40, 0x10100000000, 0x20)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/mheap.go:503 +0x63
runtime.largeAlloc(0x7fe00, 0xc800000001, 0xc8204b9138)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/malloc.go:766 +0xb3
runtime.mallocgc.func3()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/malloc.go:664 +0x33
runtime.systemstack(0xc82001ea00)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/asm_amd64.s:291 +0x79
runtime.mstart()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/proc.go:1051

goroutine 1 [running]:
runtime.systemstack_switch()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/asm_amd64.s:245 fp=0xc8204b8fd0 sp=0xc8204b8fc8
runtime.mallocgc(0x7fe00, 0x77b9c0, 0x1, 0xc82045e120)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/malloc.go:665 +0x9eb fp=0xc8204b90a8 sp=0xc8204b8fd0
runtime.newarray(0x77b9c0, 0x7fe00, 0xc8204b9148)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/malloc.go:798 +0xc9 fp=0xc8204b90e8 sp=0xc8204b90a8
runtime.makeslice(0x7635a0, 0x7fe00, 0x7fe00, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/slice.go:32 +0x165 fp=0xc8204b9138 sp=0xc8204b90e8
bytes.makeSlice(0x7fe00, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.6.3/libexec/src/bytes/buffer.go:198 +0x64 fp=0xc8204b9188 sp=0xc8204b9138
bytes.(*Buffer).ReadFrom(0xc820200770, 0x1168340, 0xc8204a62c0, 0x3fe00, 0x0, 0x0)
/usr/local/Cellar/go/1.6.3/libexec/src/bytes/buffer.go:170 +0xd3 fp=0xc8204b9238 sp=0xc8204b9188
io.copyBuffer(0x1168318, 0xc820200770, 0x1168340, 0xc8204a62c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.6.3/libexec/src/io/io.go:374 +0x180 fp=0xc8204b92f8 sp=0xc8204b9238
io.Copy(0x1168318, 0xc820200770, 0x1168340, 0xc8204a62c0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.6.3/libexec/src/io/io.go:350 +0x64 fp=0xc8204b9350 sp=0xc8204b92f8
github.com/cloudfoundry/cli/utils/words.bindataRead(0xf38860, 0x32927, 0x32927, 0xab0200, 0x1a, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/utils/words/words.go:28 +0x3aa fp=0xc8204b9468 sp=0xc8204b9350
github.com/cloudfoundry/cli/utils/words.utilsWordsDictNounsTxtBytes(0x0, 0x0, 0x0, 0x0, 0x0)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/utils/words/words.go:98 +0x71 fp=0xc8204b94c0 sp=0xc8204b9468
github.com/cloudfoundry/cli/utils/words.utilsWordsDictNounsTxt(0x7793c0, 0x0, 0x0)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/utils/words/words.go:102 +0x39 fp=0xc8204b95e0 sp=0xc8204b94c0
github.com/cloudfoundry/cli/utils/words.Asset(0xab0200, 0x1a, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/utils/words/words.go:118 +0x105 fp=0xc8204b96c8 sp=0xc8204b95e0
github.com/cloudfoundry/cli/utils/words/generator.NewWordGenerator(0x0, 0x0)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/utils/words/generator/generator.go:33 +0x8d fp=0xc8204b97e0 sp=0xc8204b96c8
github.com/cloudfoundry/cli/cf/commandregistry.NewDependency(0x1167258, 0xc82002c010, 0x11ade60, 0xc82047eba0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/cf/commandregistry/dependency.go:142 +0x1bed fp=0xc8204bd6c0 sp=0xc8204b97e0
github.com/cloudfoundry/cli/cf/cmd.Main(0x0, 0x0, 0xc8204a1ad0, 0x3, 0x3)
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/cf/cmd/cmd.go:76 +0x6fc fp=0xc8204bfee0 sp=0xc8204bd6c0
main.main()
/Users/cffadmin/concourse-work-dir/containers/0000118epdt/tmp/build/254d4083/gopath/src/github.com/cloudfoundry/cli/main.go:11 +0x72 fp=0xc8204bff20 sp=0xc8204bfee0
runtime.main()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/proc.go:188 +0x2b0 fp=0xc8204bff70 sp=0xc8204bff20
runtime.goexit()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8204bff78 sp=0xc8204bff70

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/asm_amd64.s:1998 +0x1

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
/usr/local/Cellar/go/1.6.3/libexec/src/runtime/sigqueue.go:116 +0x132
os/signal.loop()
/usr/local/Cellar/go/1.6.3/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
/usr/local/Cellar/go/1.6.3/libexec/src/os/signal/signal_unix.go:28 +0x37

Thankfully common sense prevailed; I wondered if the problem was due to my being logged into Bluemix and IBM Containers, prior to trying the installation.

I'd previously logged into both services: -

cf login —sso
cf ic login

So I logged out: -

cf logout

Logging out…
OK


and redid from start: -

cf install-plugin https://static-ice.ng.bluemix.net/ibm-containers-mac

**Attention: Plugins are binaries written by potentially untrusted authors. Install and use plugins at your own risk.**

Do you want to install the plugin https://static-ice.ng.bluemix.net/ibm-containers-mac? (y or n)> y

Attempting to download binary file from internet address...
10186528 bytes downloaded...
Installing plugin ibm-containers-mac...
OK
Plugin IBM-Containers v0.8.1028 successfully installed.

which is nice :-)

#LoveItWhenAPlanComesTogether


Gosh and Darn it - Kubernetes, kubectl, macOS and IBM Bluemix

$
0
0
So I'm continuing my Voyage O' Discovery with IBM Containers, Bluemix, Kubernetes etc. on my Mac, following tutorials such as this: -


and have got to the part where one sets up kubectl using an environment variable $KUBECONFIG.

Whilst I can "see" my Kubernetes cluster: -

bx cs clusters

OK
Name                ID                                 State    Created                    Workers   Datacenter   
DaveHayK8SCluster   fff102198c534d0096bacd575488c9dd   normal   2017-08-21T09:59:53+0000   1         par01   


the Kubernetes kubectl tool was barfing: -

kubectl version  —short

Client Version: v1.6.4
The connection to the server localhost:8080 was refused - did you specify the right host or port?


I checked the environment variable: -

echo $KUBECONFIG

/Users/davidhay/.bluemix/plugins/container-service/clusters/DaveHayK8SCluster/kube-config-prod-dal10-DaveHayK8SCluster.yml

and then checked the file-system to which it was relating: -

ls /Users/davidhay/.bluemix/plugins/container-service/clusters/

DaveHay

ls /Users/davidhay/.bluemix/plugins/container-service/clusters/DaveHay

ca-prod-dal10-DaveHay.pemkube-config-prod-dal10-DaveHay.yml

so that kinda explains why things weren't a-workin' 

Obviously I had mis-read the instructions which have you do this: -

bx cs cluster-config DaveHayK8SCluster

OK
The configuration for DaveHayK8SCluster was downloaded successfully. Export environment variables to start using Kubernetes.

export KUBECONFIG=/Users/davidhay/.bluemix/plugins/container-service/clusters/DaveHayK8SCluster/kube-config-par01-DaveHayK8SCluster.yml

Following that advice, I did this: -

export KUBECONFIG=/Users/davidhay/.bluemix/plugins/container-service/clusters/DaveHayK8SCluster/kube-config-par01-DaveHayK8SCluster.yml

and, quelle surprise, things started working: -

kubectl version  —short

Client Version: v1.6.4
Server Version: v1.5.6-4+abe34653415733

kubectl cluster-info

Kubernetes master is running at https://158.175.65.170:25305
Heapster is running at https://158.175.65.170:25305/api/v1/proxy/namespaces/kube-system/services/heapster
KubeDNS is running at https://158.175.65.170:25305/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at https://158.175.65.170:25305/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.


Can you say "Doofus" ? I betcha can !

IBM DB2 Express on IBM Containers - PAM says "No"

$
0
0
I'm still journeying the river of discovery with IBM Containers on IBM Bluemix, and was attempting to start / use a DB2 Express image: -

docker run --name db2 -p 50000:50000 -e DB2INST1_PASSWORD=passw0rd -e LICENSE=accept -d registry.eu-gb.bluemix.net/david_hay/db2expressc db2start

fb99173b-c082-4206-8f4f-ada478153bd3

docker logs db2 -f

gNew password: BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
%Changing password for user db2inst1.
8passwd: all authentication tokens updated successfully.
WRetype new password: su: cannot create child process: Resource temporarily unavailable

Thinking that the password may be the problem, I tried something a little more "complex" : -

docker run --name db2 -p 50000:50000 -e DB2INST1_PASSWORD=Qp455w0rd! -e LICENSE=accept -d registry.eu-gb.bluemix.net/david_hay/db2expressc db2start

d0c05c2e-5ca1-45b6-9525-c765eb4ff9df

docker logs db2 -f

%Changing password for user db2inst1.
8passwd: all authentication tokens updated successfully.
eNew password: Retype new password: su: cannot create child process: Resource temporarily unavailable


This led me here: -




all of which indicate issues with the Pluggable Authentication Module (PAM).

so I've created a Docker file: -

vi Dockerfile

FROM registry.eu-gb.bluemix.net/david_hay/db2expressc:latest
RUN sed -i 's/session.*include/session        optional/' /etc/pam.d/su


and then re-created the image: -

Sending build context to Docker daemon  2.048kB
Step 1 : FROM registry.eu-gb.bluemix.net/david_hay/db2expressc:latest
 ---> 7aa154d9b73c
Step 2 : RUN sed -i 's/session.*include/session        optional/' /etc/pam.d/su
 ---> Using cache
 ---> 968890871f71
Successfully built 968890871f71
The push refers to a repository [registry.eu-gb.bluemix.net/david_hay/db2expressc]
285bba8edd34: Pushed 
5f70bf18a086: Pushed 
764bfaf5a76d: Pushed 
536fa091951a: Pushed 
9ee524f5fa90: Layer already exists 
642cadc5a8a2: Pushed 
bd119f2c7d01: Pushed 
d9aa87fe4cc8: Pushed 
ddb56e247f70: Pushed 
64e1da5c6f34: Pushed 
42a77d05e556: Pushed 
331a33188287: Pushed 
c8891592084f: Pushed 
51fe5429de3f: Pushed 
pamfixed: digest: sha256:7016e068cb2d8f3eeeb0c88e4850e82dbe9d39409ff23c7e80fb15bf7c268e44 size: 4479


I then start my container: -

docker run --name db2 -p 50000:50000 -e DB2INST1_PASSWORD=Qp455w0rd! -e LICENSE=accept -d registry.eu-gb.bluemix.net/david_hay/db2expressc:pamfixed db2start

ca37ea7b-0664-4568-8ad8-180bce0bcf04

open a shell to it: -

docker exec -i -t db2 /bin/bash

check DB2 version: -

db2level

DB21085I  This instance or install (instance name, where applicable: 
"db2inst1") uses "64" bits and DB2 code release "SQL10055" with level 
identifier "0606010E".
Informational tokens are "DB2 v10.5.0.5", "s141128", "IP23633", and Fix Pack 
"5".
Product is installed at "/home/db2inst1/sqllib".


and create the SAMPLE database: -

db2sampl

  Creating database "SAMPLE"...
  Connecting to database "SAMPLE"...
  Creating tables and data in schema "DB2INST1"...
  Creating tables with XML columns and XML data in schema "DB2INST1"...

  'db2sampl' processing complete.


and connect to the SAMPLE database

db2 connect to sample

   Database Connection Information

 Database server        = DB2/LINUXX8664 10.5.5
 SQL authorization ID   = DB2INST1
 Local database alias   = SAMPLE

and retrieve some data: -

db2 "select * from employee"

EMPNO  FIRSTNME     MIDINIT LASTNAME        WORKDEPT PHONENO HIREDATE   JOB      EDLEVEL SEX BIRTHDATE  SALARY      BONUS       COMM       
------ ------------ ------- --------------- -------- ------- ---------- -------- ------- --- ---------- ----------- ----------- -----------
000010 CHRISTINE    I       HAAS            A00      3978    01/01/1995 PRES          18 F   08/24/1963   152750.00     1000.00     4220.00
000020 MICHAEL      L       THOMPSON        B01      3476    10/10/2003 MANAGER       18 M   02/02/1978    94250.00      800.00     3300.00
000030 SALLY        A       KWAN            C01      4738    04/05/2005 MANAGER       20 F   05/11/1971    98250.00      800.00     3060.00
000050 JOHN         B       GEYER           E01      6789    08/17/1979 MANAGER       16 M   09/15/1955    80175.00      800.00     3214.00
000060 IRVING       F       STERN           D11      6423    09/14/2003 MANAGER       16 M   07/07/1975    72250.00      500.00     2580.00
000070 EVA          D       PULASKI         D21      7831    09/30/2005 MANAGER       16 F   05/26/2003    96170.00      700.00     2893.00
000090 EILEEN       W       HENDERSON       E11      5498    08/15/2000 MANAGER       16 F   05/15/1971    89750.00      600.00     2380.00
000100 THEODORE     Q       SPENSER         E21      0972    06/19/2000 MANAGER       14 M   12/18/1980    86150.00      500.00     2092.00
000110 VINCENZO     G       LUCCHESSI       A00      3490    05/16/1988 SALESREP      19 M   11/05/1959    66500.00      900.00     3720.00
000120 SEAN                 O'CONNELL       A00      2167    12/05/1993 CLERK         14 M   10/18/1972    49250.00      600.00     2340.00
000130 DELORES      M       QUINTANA        C01      4578    07/28/2001 ANALYST       16 F   09/15/1955    73800.00      500.00     1904.00
000140 HEATHER      A       NICHOLLS        C01      1793    12/15/2006 ANALYST       18 F   01/19/1976    68420.00      600.00     2274.00
000150 BRUCE                ADAMSON         D11      4510    02/12/2002 DESIGNER      16 M   05/17/1977    55280.00      500.00     2022.00
000160 ELIZABETH    R       PIANKA          D11      3782    10/11/2006 DESIGNER      17 F   04/12/1980    62250.00      400.00     1780.00
000170 MASATOSHI    J       YOSHIMURA       D11      2890    09/15/1999 DESIGNER      16 M   01/05/1981    44680.00      500.00     1974.00
000180 MARILYN      S       SCOUTTEN        D11      1682    07/07/2003 DESIGNER      17 F   02/21/1979    51340.00      500.00     1707.00
000190 JAMES        H       WALKER          D11      2986    07/26/2004 DESIGNER      16 M   06/25/1982    50450.00      400.00     1636.00
000200 DAVID                BROWN           D11      4501    03/03/2002 DESIGNER      16 M   05/29/1971    57740.00      600.00     2217.00
000210 WILLIAM      T       JONES           D11      0942    04/11/1998 DESIGNER      17 M   02/23/2003    68270.00      400.00     1462.00
000220 JENNIFER     K       LUTZ            D11      0672    08/29/1998 DESIGNER      18 F   03/19/1978    49840.00      600.00     2387.00
000230 JAMES        J       JEFFERSON       D21      2094    11/21/1996 CLERK         14 M   05/30/1980    42180.00      400.00     1774.00
000240 SALVATORE    M       MARINO          D21      3780    12/05/2004 CLERK         17 M   03/31/2002    48760.00      600.00     2301.00
000250 DANIEL       S       SMITH           D21      0961    10/30/1999 CLERK         15 M   11/12/1969    49180.00      400.00     1534.00
000260 SYBIL        P       JOHNSON         D21      8953    09/11/2005 CLERK         16 F   10/05/1976    47250.00      300.00     1380.00
000270 MARIA        L       PEREZ           D21      9001    09/30/2006 CLERK         15 F   05/26/2003    37380.00      500.00     2190.00
000280 ETHEL        R       SCHNEIDER       E11      8997    03/24/1997 OPERATOR      17 F   03/28/1976    36250.00      500.00     2100.00
000290 JOHN         R       PARKER          E11      4502    05/30/2006 OPERATOR      12 M   07/09/1985    35340.00      300.00     1227.00
000300 PHILIP       X       SMITH           E11      2095    06/19/2002 OPERATOR      14 M   10/27/1976    37750.00      400.00     1420.00
000310 MAUDE        F       SETRIGHT        E11      3332    09/12/1994 OPERATOR      12 F   04/21/1961    35900.00      300.00     1272.00
000320 RAMLAL       V       MEHTA           E21      9990    07/07/1995 FIELDREP      16 M   08/11/1962    39950.00      400.00     1596.00
000330 WING                 LEE             E21      2103    02/23/2006 FIELDREP      14 M   07/18/1971    45370.00      500.00     2030.00
000340 JASON        R       GOUNOT          E21      5698    05/05/1977 FIELDREP      16 M   05/17/1956    43840.00      500.00     1907.00
200010 DIAN         J       HEMMINGER       A00      3978    01/01/1995 SALESREP      18 F   08/14/1973    46500.00     1000.00     4220.00
200120 GREG                 ORLANDO         A00      2167    05/05/2002 CLERK         14 M   10/18/1972    39250.00      600.00     2340.00
200140 KIM          N       NATZ            C01      1793    12/15/2006 ANALYST       18 F   01/19/1976    68420.00      600.00     2274.00
200170 KIYOSHI              YAMAMOTO        D11      2890    09/15/2005 DESIGNER      16 M   01/05/1981    64680.00      500.00     1974.00
200220 REBA         K       JOHN            D11      0672    08/29/2005 DESIGNER      18 F   03/19/1978    69840.00      600.00     2387.00
200240 ROBERT       M       MONTEVERDE      D21      3780    12/05/2004 CLERK         17 M   03/31/1984    37760.00      600.00     2301.00
200280 EILEEN       R       SCHWARTZ        E11      8997    03/24/1997 OPERATOR      17 F   03/28/1966    46250.00      500.00     2100.00
200310 MICHELLE     F       SPRINGER        E11      3332    09/12/1994 OPERATOR      12 F   04/21/1961    35900.00      300.00     1272.00
200330 HELENA               WONG            E21      2103    02/23/2006 FIELDREP      14 F   07/18/1971    35370.00      500.00     2030.00
200340 ROY          R       ALONZO          E21      5698    07/05/1997 FIELDREP      16 M   05/17/1956    31840.00      500.00     1907.00

  42 record(s) selected.


Now to get an IP address and test my Java code ….


Doh, IBM DB2 on the IBM Container Service on IBM Bluemix, remember persistence :-)

$
0
0
Having got DB2 running on the IBM Container Service on IBM Bluemix: -


I was a little perturbed when my Java code failed to work, when connecting from my Mac to the DB2 container: -

java -cp db2jcc4.jar:. JdbcTestDB2 54.23.128.93 50000 SAMPLE db2inst1 Qp455w0rd!

com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-1031, SQLSTATE=58031, SQLERRMC=null, DRIVER=4.23.42

I checked the SQL code: -

db2 ? sql1031

SQL1031N  The database directory cannot be found on the indicated file
      system.


Explanation: 

The system database directory or local database directory could not be
found. A database has not been created or it was not cataloged
correctly.

The command cannot be processed.

User response: 

Verify that the database is created with the correct path specification.
The Catalog Database command has a path parameter which specifies the
directory where the database resides.

sqlcode: -1031

sqlstate: 58031


which made me think: -

db2 list db directory

SQL1031N  The database directory cannot be found on the indicated file system. 
SQLSTATE=58031


and then it hit me ….

I'd previously dropped the running container: -

cf ic stop db2

removed it: -

cf ic rm db2

and started a new one: -

cf ic run --name db2 -p 50000:50000 -e DB2INST1_PASSWORD=Qp455w0rd! -e LICENSE=accept -d registry.eu-gb.bluemix.net/david_hay/db2expressc:pamfixed db2start

and validated it: -

cf ic ps -a

CONTAINER ID        IMAGE                                                       COMMAND             CREATED             STATUS              PORTS               NAMES
3cf533af-c95        registry.eu-gb.bluemix.net/david_hay/db2expressc:pamfixed   "db2start "         50 seconds ago      Running             50000/tcp           db2


and requested an IP address: -

cf ic ip request

OK
IP address "54.23.128.93" was obtained.


and bound the IP address to the container: -

cf ic ip bind 54.23.128.93 db2

OK
The IP address was bound successfully.


So, of course, I no longer had any databases :-)

To mitigate this, I started a shell to the running container: -

cf ic exec -i -t db2 /bin/bash

switched to the db2inst1 user: -

su - db2inst1

and created the SAMPLE database: -

db2sampl

  Creating database "SAMPLE"...
  Connecting to database "SAMPLE"...
  Creating tables and data in schema "DB2INST1"...
  Creating tables with XML columns and XML data in schema "DB2INST1"...

  'db2sampl' processing complete.


and validated that all was well: -

db2 connect to SAMPLE

   Database Connection Information

 Database server        = DB2/LINUXX8664 10.5.5
 SQL authorization ID   = DB2INST1
 Local database alias   = SAMPLE


db2 select "EMPNO,FIRSTNME,LASTNAME from DB2INST1.EMPLOYEE"

EMPNO  FIRSTNME     LASTNAME       
------ ------------ ---------------
000010 CHRISTINE    HAAS           
000020 MICHAEL      THOMPSON       
000030 SALLY        KWAN           
000050 JOHN         GEYER          
000060 IRVING       STERN          
000070 EVA          PULASKI        
000090 EILEEN       HENDERSON      
000100 THEODORE     SPENSER        
000110 VINCENZO     LUCCHESSI      
000120 SEAN         O'CONNELL      
000130 DELORES      QUINTANA       
000140 HEATHER      NICHOLLS       
000150 BRUCE        ADAMSON        
000160 ELIZABETH    PIANKA         
000170 MASATOSHI    YOSHIMURA      
000180 MARILYN      SCOUTTEN       
000190 JAMES        WALKER         
000200 DAVID        BROWN          
000210 WILLIAM      JONES          
000220 JENNIFER     LUTZ           
000230 JAMES        JEFFERSON      
000240 SALVATORE    MARINO         
000250 DANIEL       SMITH          
000260 SYBIL        JOHNSON        
000270 MARIA        PEREZ          
000280 ETHEL        SCHNEIDER      
000290 JOHN         PARKER         
000300 PHILIP       SMITH          
000310 MAUDE        SETRIGHT       
000320 RAMLAL       MEHTA          
000330 WING         LEE            
000340 JASON        GOUNOT         
200010 DIAN         HEMMINGER      
200120 GREG         ORLANDO        
200140 KIM          NATZ           
200170 KIYOSHI      YAMAMOTO       
200220 REBA         JOHN           
200240 ROBERT       MONTEVERDE     
200280 EILEEN       SCHWARTZ       
200310 MICHELLE     SPRINGER       
200330 HELENA       WONG           
200340 ROY          ALONZO         

  42 record(s) selected.

I then re-ran my Java code: -

java -cp db2jcc4.jar:. JdbcTestDB2 54.23.128.93 50000 SAMPLE db2inst1 Qp455w0rd!

000010 CHRISTINE HAAS
000020 MICHAEL THOMPSON
000030 SALLY KWAN
000050 JOHN GEYER
000060 IRVING STERN
000070 EVA PULASKI
000090 EILEEN HENDERSON
000100 THEODORE SPENSER
000110 VINCENZO LUCCHESSI
000120 SEAN O'CONNELL
000130 DELORES QUINTANA
000140 HEATHER NICHOLLS
000150 BRUCE ADAMSON
000160 ELIZABETH PIANKA
000170 MASATOSHI YOSHIMURA
000180 MARILYN SCOUTTEN
000190 JAMES WALKER
000200 DAVID BROWN
000210 WILLIAM JONES
000220 JENNIFER LUTZ
000230 JAMES JEFFERSON
000240 SALVATORE MARINO
000250 DANIEL SMITH
000260 SYBIL JOHNSON
000270 MARIA PEREZ
000280 ETHEL SCHNEIDER
000290 JOHN PARKER
000300 PHILIP SMITH
000310 MAUDE SETRIGHT
000320 RAMLAL MEHTA
000330 WING LEE
000340 JASON GOUNOT
200010 DIAN HEMMINGER
200120 GREG ORLANDO
200140 KIM NATZ
200170 KIYOSHI YAMAMOTO
200220 REBA JOHN
200240 ROBERT MONTEVERDE
200280 EILEEN SCHWARTZ
200310 MICHELLE SPRINGER
200330 HELENA WONG
200340 ROY ALONZO


So that's all good then :-)

The moral of the story - when you drop and recreate a container, don't assume that the "local" storage is still there; next time around, I'll mount some external storage to my container ….

Kubernetes and IBM Bluemix: How to deploy, manage, and secure your container-based workloads

$
0
0
A rather useful series of blog posts: -


which dovetails with my personal interests right now, given that I've just successfully brought up: -

(a) a containerised instance of IBM DB2 Express using Docker on my Mac
(b) the same on IBM Containers on IBM Bluemix
(c) the same but on Kubernetes on IBM Bluemix ( leveraging Clusters, Deployments, Pods and Nodes ).

My next challenge is to add WebSphere Liberty Profile into my Kubernetes cluster and see whether I can get a Java servlet talking via JDBC to DB2, which shouldn't be too hard #FamousLastWords

Meantime, enjoy the articles ...

IBM HTTP Server and HTTP Strict Transport Security (HSTS)

$
0
0
I was asked about this earlier today.

IBM HTTP Server (IHS), being based upon Apache, can do most whatever Apache itself can do.

This means that HTTP Strict Transport Security (HSTS) *can* be enabled in IHS.

I followed this blog post: -


and I can see the header being set: -

 


This is what I did in httpd.conf : -

Disabled HTTP

#Listen 8080

Enabled SSL and enforced TLS 1.2

LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
Listen 8443
<VirtualHost *:8443>
        SSLProtocolEnable TLSv12
        SSLProtocolDisable SSLv2 SSLv3 TLSv10 TLSv11
        SSLEnable
</VirtualHost>
KeyFile /opt/ibm/HTTPServer/ODM/ssl/keystore.kdb
SSLDisable

Added in mod_headers

LoadModule headers_module modules/mod_headers.so

Added in the appropriate HSTS header - using two years as an example expiration period ( 2 * 365 days * 24 hours * 60 minutes * 60 seconds )

        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"

giving me this: -

LoadModule headers_module modules/mod_headers.so
LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
Listen 8443
<VirtualHost *:8443>
        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
        SSLProtocolEnable TLSv12
        SSLProtocolDisable SSLv2 SSLv3 TLSv10 TLSv11
        SSLEnable
</VirtualHost>
KeyFile /opt/ibm/HTTPServer/ODM/ssl/keystore.kdb
SSLDisable

with the configuration being validated using wget : -

wget --no-check-certificate https://odm.uk.ibm.com:8443/index.html --server-response

--2017-08-23 10:48:31--  https://odm.uk.ibm.com:8443/index.html
Resolving odm.uk.ibm.com (odm.uk.ibm.com)... fe80::20c:29ff:fe9a:9e56, 192.168.153.133
Connecting to odm.uk.ibm.com (odm.uk.ibm.com)|fe80::20c:29ff:fe9a:9e56|:8443... connected.
WARNING: cannot verify odm.uk.ibm.com's certificate, issued by '/CN=odm.uk.ibm.com':
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Wed, 23 Aug 2017 09:48:31 GMT
  Strict-Transport-Security: max-age=63072000; includeSubdomains;
  Last-Modified: Mon, 31 Oct 2016 10:10:36 GMT
  ETag: "da5-540266b425f00"
  Accept-Ranges: bytes
  Content-Length: 3493
  Keep-Alive: timeout=10, max=100
  Connection: Keep-Alive
  Content-Type: text/html
Length: 3493 (3.4K) [text/html]
Saving to: 'index.html'

100%[================================================================================================================================================================>] 3,493       --.-K/s   in 0s      

2017-08-23 10:48:31 (357 MB/s) - 'index.html'saved [3493/3493]

and apachectl : -

/opt/ibm/HTTPServer/bin/apachectl -DDUMP_SSL_CONFIG -f /opt/ibm/HTTPServer/ODM/conf/httpd.conf

 

SSL configuration:
Default server
Server name: odm.uk.ibm.com:8080
SSL enabled: NO

SSL server defined at: /opt/ibm/HTTPServer/ODM/conf/httpd.conf:852
Server name: odm.uk.ibm.com:8443
SSL enabled: YES
FIPS enabled: 0
Keyfile: /opt/ibm/HTTPServer/ODM/ssl/keystore.kdb
Protocols enabled: TLSv12
Ciphers for SSLV2: (protocol disabled)
Ciphers for SSLV3: (protocol disabled)
Ciphers for TLSv10: (protocol disabled)
Ciphers for TLSv11: (protocol disabled)
Ciphers for TLSv12: (defaults) TLS_RSA_WITH_AES_128_GCM_SHA256(9C),TLS_RSA_WITH_AES_256_GCM_SHA384(9D),TLS_RSA_WITH_AES_128_CBC_SHA256(3C),TLS_RSA_WITH_AES_256_CBC_SHA256(3D),TLS_RSA_WITH_AES_128_CBC_SHA(2F),TLS_RSA_WITH_AES_256_CBC_SHA(35b),SSL_RSA_WITH_3DES_EDE_CBC_SHA(3A)

Syntax OK

Hope this helps.

Introducing IBM Business Process Manager 8.6 and there's more

$
0
0

IBM BPM and Oracle - another interesting problem

$
0
0
Earlier this week, I was working with a client to grow their BPM development environment from two to four nodes, meaning that the Deployment Environment effectively doubled in size.

We achieved this by editing the template ( Advanced-PS-ThreeClusters-Oracle.properties ) and adding the additional two nodes, each hosting three new cluster members, and then using the BPMConfig.sh script to update the Deployment Environment as follows: -

./BPMConfig.sh -create -de Advanced-PS-ThreeClusters-Oracle.properties

Having done this, we started up the DE, and validated the changes by hitting the Process Portal, Process Admin and BPC UIs, and also stopping the old nodes ( 1 and 2 ) and ensuring that the service carried on running on nodes 3 and 4.

Apart from briefly forgetting to regenerate/propagate the WebSphere Plugin configuration and then restart IBM HTTP Server, all was well.

However, when we started the core business application ( which is an Enterprise Archive comprising SCA modules with mediations and BPEL flows ), we saw this in the SystemOut.log for all of the AppCluster members, both the original AND the new ones: -

java.lang.NoClassDefFoundError: oracle.xdb.XMLType
Caused by: java.lang.ClassNotFoundException: oracle.xdb.XMLType
       at java.net.URLClassLoader.findClass(URLClassLoader.java:602)
       at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:243)
       at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:777)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:754)
       at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:134)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:731)

Given that this had worked before the change and given that we know what the change was, this was somewhat weird.

This is covered here: -


*BUT* nothing has changed … apart from what has changed.

We dug further through the logs, but to no avail.

We then started to dig into the WebSphere Classloader, using this as source: -


and this: -


specifically by tracing the class loader : -

Enable Java™ Virtual Machine (JVM) classloader traces through the Admin console:

• Select Servers, choose Application servers and select the server you want to configure.

• In the Server Infrastructure section, open Java and Process Management and select Process Definition.

• Under Additional Properties, select Java Virtual Machine.

• Check the Verbose class loading checkbox.

• Add the following string to the Generic JVM arguments field:

-Dws.ext.debug=true  -Dws.osgi.debug

• Click OK.

Once we did this, and looked at the trace, we could see that, whilst the Oracle JDBC driver ( ojdbc7.jar ) *WAS* being loaded ( and we could see that, partly because BPM was coming up and working, and partly because the JDBC Test Connection function worked for all of the databases, both BPM and application ), the requisite Oracle XML tool ( xdb6.jar ) was NOT being loaded.

However, when we looked at the configuration of the JDBC driver that was being used by the application-specific data source, it looked to be in order, similar to this: -


( although we're using the ojdbc7.jar rather than ojdbc6.jar as per the screenshot above ).

When we checked the underlying Linux file-system, we could see that ojdbc7.jar was present : -

ls -al /opt/ibm/WebSphere/AppServer/jdbcdrivers/Oracle/

total 6632
drwxr-xr-x 2 wasadmin wasadmins      40 Jul 10 19:59 .
drwxr-xr-x 5 wasadmin wasadmins      45 Jul 10 19:59 ..
-rw-r--r-- 1 wasadmin wasadmins 3389454 Jul 10 19:59 ojdbc6.jar
-rw-r--r-- 1 wasadmin wasadmins 3397734 Jul 10 19:59 ojdbc7.jar

*BUT* that the xdb6.jar was NOT in the same location.

When we dug further, we could see that xdb6.jar was here: -

/opt/ibm/WebSphere/AppServer/lib/ext

along with ojdbc7.jar and xmlparserv2.jar.

which is interesting.

This then led the client to drill into the WebSphere Variable ORACLE_JDBC_DRIVER_PATH which is referenced at the JDBC driver level.

This was set to: -

${WAS_INSTALL_ROOT}/jdbcdrivers/Oracle

which is, in effect, this path: -

/opt/ibm/WebSphere/AppServer/jdbcdrivers/Oracle/

Looking at another environment, it was clear that, at some point in the past, this variable had been altered to point here: -

/opt/ibm/WebSphere/AppServer/lib/ext

rather than here; -

/opt/ibm/WebSphere/AppServer/jdbcdrivers/Oracle/

But, and here's the interesting part, the BPMConfig.sh script must've reset the variable back to the IBM-supplied default.

So, the moral of the story is two-fold; try and avoid altering IBM-provided variables AND learn how to debug the class loader in WAS :-)

Tinkering with IBM Containers on IBM Bluemix - Like Docker really ...

$
0
0
As per previous posts, I have been tinkering with IBM Containers (IC) on IBM Bluemix, and am starting to bring things together in my mind, in terms of positioning IC vs. Kubernetes vs. Docker.

One of the many things that I like is the amount of help and choices that one has.

Having initialised the Bluemix ( bc ) Cloud Foundry ( cf ) IBM Containers ( ic ) environment: -

bx cf ic init

Invoking 'cf ic init'...

Deleting old configuration file...
OK
Generating client certificates for IBM Containers...
Client certificates are being stored in /Users/foobar/.ice/certs/...

Client certificates are being stored in /Users/foobar/.ice/certs/containers-api.eu-gb.bluemix.net/21377cbf-6e5f-4a9a-175a-4fdfeb3c3e12...

OK
Client certificates were retrieved.

Checking local Docker configuration...
OK

Authenticating with registry at host name registry.eu-gb.bluemix.net
OK
You are authenticated with IBM Bluemix Container Registry.
Your private Bluemix repository is URL: registry.eu-gb.bluemix.net/foobar
No ic-cfg.ini found on the system. Creating...

You can choose from two ways to use the Docker CLI with IBM Containers:


Option 1: This option allows you to use 'cf ic' for managing containers on IBM Containers while still using the Docker CLI directly to manage your local Docker host.
Use this Cloud Foundry IBM Containers plug-in without affecting the local Docker environment:


Example Usage:
cf ic ps
cf ic images

Option 2: Use the Docker CLI directly. In this shell, override the local Docker environment to connect to IBM Containers by setting these variables. Copy and paste the following commands:
Note: Only Docker commands followed by (Docker) are supported with this option. 
 export DOCKER_HOST=tcp://containers-api.eu-gb.bluemix.net:8443
 export DOCKER_CERT_PATH=/Users/foobar/.ice/certs/containers-api.eu-gb.bluemix.net/21377cbf-6e5f-4a9a-175a-4fdfeb3c3e12
 export DOCKER_TLS_VERIFY=1

Example Usage:
docker ps
docker images



it's great to see that I can use either cf ic commands: -

cf ic ps

CONTAINER ID        IMAGE                                                       COMMAND             CREATED             STATUS              PORTS                            NAMES
3cf533af-c95        registry.eu-gb.bluemix.net/foobar/db2expressc:pamfixed   "db2start "         8 days ago          Running             134.168.59.83:50000->50000/tcp   db2


cf ic images

REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE
registry.eu-gb.bluemix.net/ibmnode                       v1.2                b1667ce7e5af        2 weeks ago         183MB
registry.eu-gb.bluemix.net/ibmnode                       v1.1                18f8f073b62b        2 weeks ago         176MB
registry.eu-gb.bluemix.net/ibm-websphere-extreme-scale   latest              8fccb460321a        7 weeks ago         466MB
registry.eu-gb.bluemix.net/ibm-integration-bus           latest              4b5f5fb39008        4 weeks ago         698MB
registry.eu-gb.bluemix.net/ibm_wa_agent                  latest              db7dc2abff64        4 months ago        435MB
registry.eu-gb.bluemix.net/ibm-mq                        latest              b42d55b53b18        8 days ago          455MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile7         cd826253309d        7 weeks ago         268MB
registry.eu-gb.bluemix.net/ibmnode                       v4                  20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibmnode                       latest              20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibm-backup-restore            latest              ea90ec45b636        4 weeks ago         205MB
registry.eu-gb.bluemix.net/ibm-node-strong-pm            latest              9499f23eb689        4 months ago        281MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile6         b350d9fd08fd        7 weeks ago         260MB
registry.eu-gb.bluemix.net/ibmliberty                    latest              edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    javaee7             edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    microProfile        4a50d0f49c6e        7 weeks ago         230MB
registry.eu-gb.bluemix.net/foobar/db2expressc         pamfixed            968890871f71        8 days ago          640MB

 -OR- docker commands: -

docker ps

CONTAINER ID        IMAGE                                                       COMMAND             CREATED             STATUS              PORTS                            NAMES
3cf533af-c95        registry.eu-gb.bluemix.net/foobar/db2expressc:pamfixed   "db2start "         8 days ago          Running             134.168.59.83:50000->50000/tcp   db2


docker images

REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE
registry.eu-gb.bluemix.net/ibm-integration-bus           latest              4b5f5fb39008        4 weeks ago         698MB
registry.eu-gb.bluemix.net/ibm_wa_agent                  latest              db7dc2abff64        4 months ago        435MB
registry.eu-gb.bluemix.net/ibm-websphere-extreme-scale   latest              8fccb460321a        7 weeks ago         466MB
registry.eu-gb.bluemix.net/ibm-mq                        latest              b42d55b53b18        8 days ago          455MB
registry.eu-gb.bluemix.net/ibm-node-strong-pm            latest              9499f23eb689        4 months ago        281MB
registry.eu-gb.bluemix.net/ibmnode                       latest              20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibmnode                       v4                  20020df7341b        2 weeks ago         188MB
registry.eu-gb.bluemix.net/ibmnode                       v1.1                18f8f073b62b        2 weeks ago         176MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile7         cd826253309d        7 weeks ago         268MB
registry.eu-gb.bluemix.net/ibmliberty                    microProfile        4a50d0f49c6e        7 weeks ago         230MB
registry.eu-gb.bluemix.net/ibmliberty                    latest              edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    javaee7             edea51e84600        7 weeks ago         307MB
registry.eu-gb.bluemix.net/ibmliberty                    webProfile6         b350d9fd08fd        7 weeks ago         260MB
registry.eu-gb.bluemix.net/ibm-backup-restore            latest              ea90ec45b636        4 weeks ago         205MB
registry.eu-gb.bluemix.net/ibmnode                       v1.2                b1667ce7e5af        2 weeks ago         183MB
registry.eu-gb.bluemix.net/foobar/db2expressc         pamfixed            968890871f71        8 days ago          640MB

You have a choice - and choices are good :-)

Intro to App Development with Swift by Apple Education

Book Review - What Am I Reading ?

$
0
0

Node-RED on IBM Bluemix - Deleting Wires

$
0
0
So this caused me grief for a brief period, until I turned to Google :-)

I am editing a flow in Node-RED on IBM Bluemix 


and wanted to delete a connection ( line ) between two nodes, as illustrated above.

Now how the heck can I do this ? I tried clicking the right-hand mouse button


( I'm using Chrome )

but that wasn't too useful.

I tried double-clicking on the offending connection .. no dice

Then I turned to Google and found this: -


Hold down shift while dragging from the end of the wire you want to move

In essence, I held down the shift key and dragged the connection away from the node and … let go.


Simples :-)

IBM API Connect - new newness

IBM Redbook - Developing Node.js Applications on IBM Bluemix

$
0
0

This IBM® Redbooks® publication explains how to create various applications based on Node.js and run them on IBM Bluemix®. In this book, you will do the following activities: 

• Develop a Hello World application in Node.js, executing on IBM Bluemix. Through this activity, you can learn about these technologies:

• IBM SDK for Node.js 
• Eclipse Orion Web IDE 

• Use asynchronous callback
• Create an Express application
• Build a rich user interface application by using AngularJS based in Node.js

This book is for beginner and experienced developers who want to start coding Node.js applications on IBM Bluemix.

Table of contents

Chapter 1. Developing a Hello World Node.js app on Bluemix
Chapter 2. Understanding asynchronous callback
Chapter 3. Creating your first express application
Chapter 4. Building a rich UI application by using AngularJS with Node.js
Appendix A. Additional material

New Technology Demonstration: BPM Analytics

$
0
0
This from my IBM colleague, Allan Chan: -

A new BPM Analytics technology demonstration is available to use with the latest IBM Business Process Manager. The latest version works with V8.5.7.0 CF201706 release at the end of June 2017. The original version worked with V8.5.7.0 CF201703 released on 31st March 2017.
...
The key value of IBM Business Process Manager (BPM) is in streamlining custom enterprise business processes to better optimize service and cost. It does this namely through 1) custom process applications to manage work, and 2) process analytics for workers, managers, and analysts to assist their decision making in the execution and management of work and the design of processes. This technology demonstration aims to enhance BPM capabilities for (2) process analytics, with modern technologies which can excel in the era of big data and analytics, taking advantage of the full potential of the rich information into business operations afforded by custom process apps executing in BPM.

The BPM Analytics aims to enhance BPM for two scenarios: 1) BPM Analytics – providing enhanced process analytics features directly within the BPM offering targeting BPM user roles, and 2) 3rd Party analytics – providing enhanced features to publish process data to external data and analytics solutions provided by IBM, customers, and partners.

Secure Identity Propagation Using WS-Trust, SAML2, and WS-Security

Viewing all 1851 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>