Thingworx Docker image for MS SQL not starting
Hello,
I have been trying to build the Thingworx 9.4.0 b49 Docker image for MS SQL Server. I've followed the steps from here:
I spun up a new Ubuntu 20.04.1 VM and downloaded the Twx 9.4 Platform archive. Next I downloaded the Docker images for Thingworx and the security tool, built the security tool and copied the resulting archive in the staging folder of the Thingworx Docker files. I've added the Oracle JDK 11.0.19 and Tomcat 9.0.80 and the MS JDBC driver for MS SQL archives and went through the build.sh stage with no problem then build.sh mssql
The image appears to have been built successfully. Next I edited the yml file for docker to specify the remote MS SQL Server DB details. I commented out the part about the mssql service as I saw the KB notes and other instructions, plus an example of docker yml file, where the mssql server was left out and it had only the remote DB server's details.
I've ran manually the DB and content creation scripts, made sure that I can connect via the sqlcmd tool from the Ubuntu VM to the MS SQL Server instance using the Thingworx DB, user and password and I was able to access the Twx tables, albeit they're empty.
Now when trying to run the docker container using this command:
sudo docker compose -f docker-compose-mssql.yml up -d
as per the instructions from the PTC site.
This is when I start getting problems as the container seems to start but the Thingworx app doesn't appear to start as well.
After digging for the log files, I found them in the thingworx-mssql-storage/ThingworxStorage/logs/ and inside the Application.log file I can see this:
023-08-30 14:42:09.648+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ========================================
2023-08-30 14:42:09.650+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ThingWorx Version Information
2023-08-30 14:42:09.650+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ========================================
2023-08-30 14:42:09.650+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] majorVersion = 9
2023-08-30 14:42:09.651+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] minorVersion = 4
2023-08-30 14:42:09.652+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] revision = 0
2023-08-30 14:42:09.652+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] build = b49
2023-08-30 14:42:09.652+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] schemaVersion = 1140
2023-08-30 14:42:09.652+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ========================================
2023-08-30 14:42:09.653+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ========================================
2023-08-30 14:42:09.654+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ThingWorx System Environment Settings
2023-08-30 14:42:09.654+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ========================================
2023-08-30 14:42:09.654+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] OS: Linux
2023-08-30 14:42:09.655+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] OS arch: amd64
2023-08-30 14:42:09.656+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] OS version: 5.15.0-82-generic
2023-08-30 14:42:09.656+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Total Processors: 2
2023-08-30 14:42:09.656+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] Default encoding: UTF-8
2023-08-30 14:42:09.657+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] JAVA vendor: Oracle Corporation
2023-08-30 14:42:09.657+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] JAVA version: 11.0.19
2023-08-30 14:42:09.657+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] JAVA install location: /opt/jdk
2023-08-30 14:42:09.658+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] JVM Max Memory: 970 (MB)
2023-08-30 14:42:09.659+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] ========================================
2023-08-30 14:42:09.659+0000 [L: INFO] [O: c.t.s.ThingWorxServer] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] WebApp starting...
2023-08-30 14:42:40.937+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#5] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@157014a6 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception:
2023-08-30 14:42:40.937+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#5] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@2de0b397 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2023-08-30 14:42:40.937+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#1] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2a7368c4 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception:
2023-08-30 14:42:40.937+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#1] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@2de0b397 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2023-08-30 14:42:40.938+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#4] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@48a75bc9 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception:
2023-08-30 14:42:40.938+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#4] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@2de0b397 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2023-08-30 14:42:40.938+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#7] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@7bbd8651 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception:
2023-08-30 14:42:40.938+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#7] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@2de0b397 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2023-08-30 14:42:40.938+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#2] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@45dbc843 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (3). Last acquisition attempt exception:
2023-08-30 14:42:40.938+0000 [L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqrg1uayjo5azpobyg24|6711468f]-HelperThread-#2] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@2de0b397 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2023-08-30 14:42:40.940+0000 [L: ERROR] [O: c.t.s.ThingWorxBootstrapper] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] *** CRITICAL ERROR ON STARTUP: Connections could not be acquired from the underlying database!
The last entry got me thinking that maybe the DB is not accessible from the VM but I double checked using the sqlcmd utility and I can connect to the Thingworx DB on the remote MS SQL Server.
There's nothing indicating any missing JDBC driver or anything in the cataling.log file either, there's no error whatsoever in the Apache logs for that matter.
So, has anyone actually managed to get these Docker images going with MS SQL Server?
I know the some Twx environments connected to MS SQL Server DBs hosted in the PTC Cloud are running in a container, but I think that's AKS so not sure if the same applies, so I guess it should be possible to get the instance to run or at least tell me more about the DB problem or how to troubleshoot this further.
Regards,
Denis

