Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I followed the steps for thingworx 9.3 docker with external postgresdb installation process.
security container - ok
postgres-init - ok : checked that init has successfully connected to the external postgres and have made the schema,tables correctly
platform - error :
[L: WARN] [O: c.m.v.r.BasicResourcePool] [I: ] [U: ] [S: ] [P: ] [T: C3P0PooledConnectionPoolManager[identityToken->1bqu96satfv8vm3hxx67u|46919ddb, dataSourceName->PostgresPersistenceProvider]-HelperThread-#6] Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@65de6078 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
2022-12-22 09:36:23.264+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!
2022-12-22 09:36:23.264+0000 [L: ERROR] [O: c.t.s.ThingWorxBootstrapper] [I: ] [U: SuperUser] [S: ] [P: ] [T: main] *** Web Application STATE is being set to ERROR! ***
What am I doing wrong??
please help..
version: '2.2'
volumes:
storage:
services:
postgresql-init:
image: thingworx/postgresql-init-twx:latest
entrypoint: bash -c -x "/usr/local/bin/db-check.sh && /usr/local/bin/db-setup.sh && sleep infinity"
healthcheck:
test: [ "CMD-SHELL", "grep 'success' tmp/status.txt || exit 1" ]
interval: 15s
retries: 5
# depends_on:
# postgresql:
# condition: service_healthy
environment:
# NOTE: Set DATABASE_ADMIN_USERNAME, DATABASE_ADMIN_PASSWORD DATABASE_ADMIN_SCHEMA for connecting
# to the postgres as super user
- "DATABASE_ADMIN_USERNAME=postgres"
- "DATABASE_ADMIN_PASSWORD=plain text password"
- "DATABASE_ADMIN_SCHEMA=postgres"
- "DATABASE_HOST=10.0.1.11"
- "DATABASE_PORT=5432"
- "TWX_DATABASE_USERNAME=thingworx3"
- "TWX_DATABASE_SCHEMA=thingworx3"
- "TWX_DATABASE_PASSWORD=plain text password"
- "TABLESPACE_LOCATION=/var/lib/postgresql/data"
security-cli:
image: thingworx/security-tool:latest
entrypoint: sh -c "/opt/docker-entrypoint.sh && sleep infinity"
healthcheck:
test: [ "CMD-SHELL", "grep 'success' status.txt || exit 1" ]
interval: 15s
retries: 5
environment:
KEYSTORE: 'true'
# NOTE: Set KEYSTORE_PASSWORD (Must match value from platform container)
KEYSTORE_PASSWORD: 'plain text password'
KEYSTORE_PASSWORD_FILE_PATH: '/opt'
KEYSTORE_FILE_PATH: '/ThingworxPlatform/sc-keystore'
CUSTOM_SECRET_LIST: 'encrypt.db.password:TWX_DATABASE_PASSWORD'
# NOTE: Set TWX_DATABASE_PASSWORD
TWX_DATABASE_PASSWORD: 'plain text password'
volumes:
- storage:/ThingworxStorage
platform:
image: thingworx/platform-postgres:latest
healthcheck:
test: curl -f localhost:8080/Thingworx/health
interval: 15s
depends_on:
security-cli:
condition: service_healthy
postgresql-init:
condition: service_healthy
ports:
- "8080:8080"
- "8443:8443"
environment:
- "CATALINA_OPTS=-Xms2g -Xmx4g"
# NOTE: Set KEYSTORE_PASSWORD (Must match value from security-cli container)
#- "KEYSTORE_PASSWORD=plain text password"
- "DATABASE_HOST=10.0.1.11"
- "DATABASE_PORT=5432"
- "TWX_DATABASE_USERNAME=thingworx3"
- "TWX_DATABASE_SCHEMA=thingworx3"
- "TWX_DATABASE_PASSWORD=plain text password"
# NOTE: The following must be set for the Platform to start. This will be
# the initial Administrator password.
- "THINGWORX_INITIAL_ADMIN_PASSWORD=plain text password"
# NOTE: The following must be set for the Platform to start. This will be
# the initial MetricsUser password.
- "THINGWORX_INITIAL_METRICS_USER_PASSWORD=plain text password"
#Uncomment the below to automatically download license
- "LS_USERNAME=xxx@xx.com"
- "LS_PASSWORD=plain text password"
- "DATABASE_ADMIN_USERNAME=postgres"
- "DATABASE_ADMIN_PASSWORD=plain text password"
- "TABLESPACE_LOCATION=/var/lib/postgresql/data"
#- "SSL_KEYSTORE_PASSWORD=plain text password"
# Use this to mount your orgs licence file, if not ThingWorx will fallback to temporary licence
volumes:
- "/ThingworxPlatform:/ThingworxPlatform"
- "/ThingworxStorage:/ThingworxStorage"
- "/ThingworxBackupStorage:/ThingworxBackupStorage"
- "/tomcat-logs:/app/opt/apache-tomcat/logs"
Did you provide the necessary information for Thingworx to connect to the postgres db?
Also does postgres already have a user account/schema or not? I forget if the installer takes care of that or not.
I am doing docker compose run.
postgres-init container was able to connect to external poastgres db , create account/schema.
After setting account/schema, platform container is having above problems.
Not sure if you can check it or not, but what do you have in your platform-settings.json?
You can find it in spoiler.
{
"PlatformSettingsConfig": {
"BasicSettings": {
"BackupStorage": "/ThingworxBackupStorage",
"DatabaseLogRetentionPolicy": 7,
"EnableBackup": true,
"EnableClusteredMode": false,
"EnableSystemLogging": false,
"HTTPRequestHeaderMaxLength": 2000,
"HTTPRequestParameterMaxLength": 2000,
"ScriptTimeout": 30,
"Storage": "/ThingworxStorage",
"InternalAesCryptographicKeyLength": 128
},
"AdministratorUserSettings": {
"InitialPassword": "plain text password"
},
"MetricsUserSettings": {
"InitialPassword": "plain text password"
},
"ClusteredModeSettings": {
"CoordinatorConnectionTimeout": 10000,
"CoordinatorHosts": "127.0.0.1:2181",
"CoordinatorMaxRetries": 3,
"CoordinatorRetryTimeout": 3000,
"CoordinatorSessionTimeout": 90000,
"LoadBalancerBase64EncodedCredentials": "QWRtaW5pc3RyYXRvcjp0clVmNnl1ejI/X0d1Yg==",
"PlatformId": "platform1"
},
"SolutionCentralSettings": {
"SolutionCentralHost": "sc-twxci.a.cirrus.msai.devops.ptc.io",
"KeyStorePath": "/ThingworxPlatform/sc-keystore",
"KeyStorePass": "plain text password"
},
"ExtensionPackageImportPolicy": {
"importEnabled": true,
"allowJarResources": true,
"allowJavascriptResources": true,
"allowCSSResources": true,
"allowJSONResources": true,
"allowWebAppResources": true,
"allowEntities": true,
"allowExtensibleEntities": true,
"haCompatibilityImportLevel": "WARN"
},
"ContentTypeSettings": {
"supportedMediaEntityContentTypes": [
"image/svg+xml",
"image/png",
"image/gif",
"image/bmp",
"image/jpeg",
"application/pdf",
"image/vnd.microsoft.icon"
]
}
},
"PersistenceProviderPackageConfigs": {
"PostgresPersistenceProviderPackage": {
"ConnectionInformation": {
"acquireIncrement": 15,
"acquireRetryAttempts": 3,
"acquireRetryDelay": 5000,
"checkoutTimeout": 1000000,
"driverClass": "org.postgresql.Driver",
"fetchSize": 5000,
"idleConnectionTestPeriod": 60,
"initialPoolSize": 15,
"jdbcUrl": "jdbc:postgresql://10.0.1.11:5432/thingworx3",
"maxConnectionAge": 0,
"maxIdleTime": 0,
"maxIdleTimeExcessConnections": 300,
"maxPoolSize": 100,
"maxStatements": 100,
"minPoolSize": 5,
"numHelperThreads": 8,
"password": "plain text password",
"testConnectionOnCheckout": false,
"unreturnedConnectionTimeout": 0,
"username": "thingworx3"
},
"StreamProcessorSettings": {
"maximumBlockSize": 2500,
"maximumQueueSize": 250000,
"maximumWaitTime": 10000,
"numberOfProcessingThreads": 5,
"scanRate": 5,
"sizeThreshold": 1000
},
"DataTableProcessorSettings": {
"maximumBlockSize": 2500,
"maximumQueueSize": 250000,
"maximumWaitTime": 10000,
"numberOfProcessingThreads": 1,
"scanRate": 5,
"sizeThreshold": 1
},
"ValueStreamProcessorSettings": {
"maximumBlockSize": 2500,
"maximumWaitTime": 10000,
"maximumQueueSize": 500000,
"numberOfProcessingThreads": 5,
"scanRate": 5,
"sizeThreshold": 1000
},
"PersistentPropertyProcessorSettings": {
"maximumBlockSize": 2500,
"maximumWaitTime": 1000,
"maximumQueueSize": 100000,
"numberOfProcessingThreads": 20,
"scanRate": 25,
"sizeThreshold": 1000
}
}
}
}
I see there is information there, I'm not sure if you blanked out the password. But at least if all that info is connect, then the connection should happen, unless you have some firewall issue.
Not too sure how to further help you.
Hi @BS_10420068
Did you adhere to the Docker versions indicated in the Help Center? Are you running PostgreSQL in a Docker container as well? What o/s are you running for the db server?
You do have to create the user account and db.
Regards.
--Sharon