Difference behavior when using SSH through CircleCi Workflow

Hi all,

(Im new to CircleCi and Im not sure if this is the correct place for this question)

I have a SpringBoot RestAPI (v2.2.6.RELEASE) pointing to a MySql database.

Below is an extract of the properties file:

spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=****
spring.datasource.username=*****
spring.datasource.password=*****
spring.datasource.initialization-mode=always
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

I have a simple workflow.
-build jar
-ssh into box and remove old jar
-scp jar over to box
-java -jar api.jar

When running the workflow. I get this from the api:


***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

I’ve since changed the workflow whilst trying to figure out where the issue lies.

Now the workflow simply ssh’s into the remote box and runs a bash script.
I still get the error shown previously.

But if I ssh myself into the box an run that same bash script the application runs perfectly.

The ssh credentials in both cases are the same. ie. Im using the same user through circleCi’s workflow and when I ssh into the box.

I have no idea where the issue lies and I have no idea how to further debug this problem.

Any assistance would be greatly appreciated. Thanks

When there’s a difference between a build and SSH like this, it typically lies with environment variables and how they are sourced. Not always, but frequently.

1 Like