View Issue Details

IDProjectCategoryView StatusLast Update
0005932SymmetricDSImprovementpublic2023-08-01 20:00
Reporterghevge Assigned Tocquamme  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.14.7 
Target Version3.14.9Fixed in Version3.14.9 
Summary0005932: Update docs on using environment variables in engines properties (modified summary)
DescriptionBeing a Java app, I would have expect to be able to pass environment variables into engines properties. But it seems that doesn't work in symmetricds.

Any reason why is that?

This functionality is particularly vital in securing the symmetricds containers deployments, as you must not pass the credential in clear text, within the engines .properties files.
Steps To ReproduceWhat I've basically did, was to define 2 environment variables(DB_USER & DB_PASS ) at my docker-compose.yaml level like this:
..........
  symmetricds:
    image: symmetricds
    environment:
      DB_USER: "user"
      DB_PASS: "password"
....................

And then pass these references into my engine.properties file like this:
....
db.user=${DB_USER}
db.password=${DB_PASS}
....


But when I try to start symmetricds container, I get an error like:

symmetricds_1 | Waiting for server to start
symmetricds_1 | ......:.....:
symmetricds_1 | Started
symmetricds_1 | at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247)
symmetricds_1 | at org.postgresql.Driver.makeConnection(Driver.java:434)
symmetricds_1 | at org.postgresql.Driver.connect(Driver.java:291)
symmetricds_1 | at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52)
symmetricds_1 | at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:374)
symmetricds_1 | at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:106)
symmetricds_1 | at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:649)
symmetricds_1 | ... 17 more
symmetricds_1 |
symmetricds_1 | 2023-07-21 12:03:56,693 INFO [startup] [SymmetricWebServer] [main] Joining the web server main thread
symmetricds_1 | 2023-07-21 12:04:05,880 ERROR [symmetricdsmwdb] [ClientSymmetricEngine] [symmetric-engine-startup-1] Could not get a connection to the database: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "${DB_USER}"). Waiting for 10 seconds before trying to connect to the database again. StackTraceKey [SQLException:1799704357]
symmetricds_1 | Stopping abandoned wrapper PID 28
symmetricds_1 | .Stopping abandoned wrapper PID 28
symmetricds_1 | .Stopping abandoned wrapper PID 28
project-k-middleware_symmetricds_1 exited with code 129


Obviously the environment variable conversion to its actual value, doesn't work
Tagsdocumentation

Activities

cquamme

2023-07-26 17:54

developer   ~0002360

You would use $(environment variable name). Use ( instead of {.

Related Changesets

SymmetricDS: 3.14 56977743

2023-08-01 19:16:47

cquamme

Details Diff
0005932: Update docs on using environment variables in engines
properties (modified summary)
Affected Issues
0005932
mod - symmetric-assemble/src/asciidoc/setup/engine-properties.ad Diff File

Issue History

Date Modified Username Field Change
2023-07-21 12:22 ghevge New Issue
2023-07-26 17:54 cquamme Note Added: 0002360
2023-07-26 17:55 cquamme Tag Attached: documentation
2023-08-01 12:59 elong Assigned To => cquamme
2023-08-01 12:59 elong Status new => closed
2023-08-01 12:59 elong Resolution open => no change required
2023-08-01 13:06 elong Status closed => acknowledged
2023-08-01 13:06 elong Resolution no change required => open
2023-08-01 13:06 elong Target Version => 3.14.9
2023-08-01 13:06 elong Summary I cannot pass environment variables into engines properties? => Update docs on using environment variables in engines properties (modified summary)
2023-08-01 19:17 cquamme Status acknowledged => resolved
2023-08-01 19:17 cquamme Resolution open => fixed
2023-08-01 19:17 cquamme Category Bug => Improvement
2023-08-01 20:00 cquamme Changeset attached => SymmetricDS 3.14 56977743
2023-08-25 20:13 admin Status resolved => closed