cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Thingworx Docker image for MS SQL not starting

DB_9992723
5-Regular Member

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:

https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Installation/ThingWorxDockerGuide/thingworx_docker_setup_config.html#


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

 

 

 

2 REPLIES 2
DB_9992723
5-Regular Member
(To:DB_9992723)

PS: I noticed that in the container files for database, the db-check.sh script, there's a reference to the sqlcmd from the mssql tools package but this does not appear to be installed in the docker container, and there is apparently no mention of it as a requirement or dependency anywhere. I suppose that if the docker container is intended to be used using a local instance of the mssql engine then this would not be an issue as the tools would be available to the container runtime, but since the docker container for mssql is supposed to connect to an external MS SQL server instance these tools will not be present on the container thus causing the application to not be able to start, which would explain my current problem.

 

I hope someone from PTC could comment on this and if there is any workaround, other than abandoning the Docker+MS SQL Server option completely.

 

Regards,
Denis

Hi @DB_9992723,

I believe the issue you're encountering, considering that it looks to be important, is a better fit for a Technical Support case, as it needs to be reported to R&D and then manage the response back to you etc.

Please report this by creating a Tech Support ticket.

Announcements


Top Tags