0

I have a PDI Kitchen job on my server that I run through a script using Crontab on my Ubuntu 14.04 server and everything runs fine.

Now I am trying to schedule it using Jenkins (which is installed in the same server) and I get the following error:

2017/10/26 14:55:01 - Kitchen - Logging is at level : Basic logging
2017/10/26 14:55:01 - Kitchen - Start of run.
2017/10/26 14:55:02 - cfgbuilder - Warning: The configuration parameter [org] is not supported by the default configuration builder for scheme: sftp
14:55:12,522 ERROR [KarafLifecycleListener] The Kettle Karaf Lifycycle Listener failed to execute properly. Releasing lifecycle hold, but some services may be unavailable.
2017/10/26 14:55:12 - JOB_EXTRACT - Start of job execution
2017/10/26 14:55:12 - JOB_EXTRACT - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : A serious error occurred during job execution: 
2017/10/26 14:55:12 - JOB_EXTRACT - Error occurred while trying to connect to the database
2017/10/26 14:55:12 - JOB_EXTRACT - 
2017/10/26 14:55:12 - JOB_EXTRACT - Error connecting to database: (using class org.gjt.mm.mysql.Driver)
2017/10/26 14:55:12 - JOB_EXTRACT - Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${BI_SERVER.PORT}"'.
2017/10/26 14:55:12 - JOB_EXTRACT - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2017/10/26 14:55:12 - JOB_EXTRACT - Error occurred while trying to connect to the database
2017/10/26 14:55:12 - JOB_EXTRACT - 
2017/10/26 14:55:12 - JOB_EXTRACT - Error connecting to database: (using class org.gjt.mm.mysql.Driver)
2017/10/26 14:55:12 - JOB_EXTRACT - Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${BI_SERVER.PORT}"'.
2017/10/26 14:55:12 - JOB_EXTRACT - 
2017/10/26 14:55:12 - JOB_EXTRACT - 
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.normalConnect(Database.java:459)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.connect(Database.java:357)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.connect(Database.java:328)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.connect(Database.java:318)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.job.Job.beginProcessing(Job.java:1027)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.job.Job.execute(Job.java:520)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.job.Job.run(Job.java:435)
2017/10/26 14:55:12 - JOB_EXTRACT - Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 
2017/10/26 14:55:12 - JOB_EXTRACT - Error connecting to database: (using class org.gjt.mm.mysql.Driver)
2017/10/26 14:55:12 - JOB_EXTRACT - Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${BI_SERVER.PORT}"'.
2017/10/26 14:55:12 - JOB_EXTRACT - 
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:572)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.normalConnect(Database.java:443)
2017/10/26 14:55:12 - JOB_EXTRACT -     ... 6 more
2017/10/26 14:55:12 - JOB_EXTRACT - Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "${BI_SERVER.PORT}"'.
2017/10/26 14:55:12 - JOB_EXTRACT -     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2017/10/26 14:55:12 - JOB_EXTRACT -     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2017/10/26 14:55:12 - JOB_EXTRACT -     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2017/10/26 14:55:12 - JOB_EXTRACT -     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.Util.getInstance(Util.java:360)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:333)
2017/10/26 14:55:12 - JOB_EXTRACT -     at java.sql.DriverManager.getConnection(DriverManager.java:664)
2017/10/26 14:55:12 - JOB_EXTRACT -     at java.sql.DriverManager.getConnection(DriverManager.java:247)
2017/10/26 14:55:12 - JOB_EXTRACT -     at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:554)
2017/10/26 14:55:12 - JOB_EXTRACT -     ... 7 more
2017/10/26 14:55:12 - JOB_EXTRACT - Caused by: java.lang.NumberFormatException: For input string: "${BI_SERVER.PORT}"
2017/10/26 14:55:12 - JOB_EXTRACT -     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
2017/10/26 14:55:12 - JOB_EXTRACT -     at java.lang.Integer.parseInt(Integer.java:569)
2017/10/26 14:55:12 - JOB_EXTRACT -     at java.lang.Integer.parseInt(Integer.java:615)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.NonRegisteringDriver.port(NonRegisteringDriver.java:822)
2017/10/26 14:55:12 - JOB_EXTRACT -     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
2017/10/26 14:55:12 - JOB_EXTRACT -     ... 10 more
2017/10/26 14:55:12 - Kitchen - Finished!
2017/10/26 14:55:12 - Kitchen - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Finished with errors
2017/10/26 14:55:12 - Kitchen - Start=2017/10/26 14:55:01.379, Stop=2017/10/26 14:55:12.875
2017/10/26 14:55:12 - Kitchen - Processing ended after 11 seconds.
Finished: SUCCESS

${BI_SERVER.PORT} is a variable I defined on my kettle.properties file, so my intuition tells me that Jenkins is not loading this file when it executes kitchen (but it's automatically loaded when I run it using Crontab).

Any ideas on how can I fix this? I have checked multiple Jenkins and Pentaho blogs like this:

https://anonymousbi.wordpress.com/2014/09/17/pentaho-data-integration-scheduling-with-jenkins/

But the examples doesn't use Pentaho variables, so they are not relevant to me.

Diego Serrano
  • 846
  • 2
  • 15
  • 34
  • NOT a solution, but as a quick way to check if your intuition is correct: can you hardcode the ${BI_SERVER.PORT} in the appropriate job entry. Because there are many ore files that kitchen may miss. – AlainD Oct 26 '17 at 13:50
  • The hardcoded version works because no properties need to be loaded. – Diego Serrano Oct 27 '17 at 12:40

1 Answers1

1

The errror happens when Jenkins is installed under a root account, as it will try to overwrite files as the jenkins user. To avoid this, either do the installation under a new user or change the ownership of the root files to jenkins (not recommended for security issues).

Also, move your kettle.properties file to jenkins home ($JENKINS_HOME/.kettle)

Diego Serrano
  • 846
  • 2
  • 15
  • 34