0
votes

I'm attempting to run a .bat file in Kettle using the "Shell" function. However, Pentaho is throwing an error, showing that I have an invalid environment variable name. I'm at a complete loss as to what to do to resolve this, hence my post.

I've provided the output log file text below:

2017/09/11 11:09:14 - Spoon - Starting job...
2017/09/11 11:09:14 - test_job - Start of job execution
2017/09/11 11:09:14 - test_job - Starting entry [test_batch.bat]
2017/09/11 11:09:14 - test_batch.bat - Running on platform : Windows 7
2017/09/11 11:09:14 - test_batch.bat - Executing command : cmd.exe /C "\Desktop\test_batch.bat"
2017/09/11 11:09:14 - test_batch.bat - ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : Unexpected error running shell [\Desktop\test_batch.bat] : java.lang.IllegalArgumentException: Invalid environment variable name: "
2017/09/11 11:09:14 - test_batch.bat - ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : java.lang.IllegalArgumentException: Invalid environment variable name: "
2017/09/11 11:09:14 - test_batch.bat - at java.lang.ProcessEnvironment.validateName(Unknown Source)
2017/09/11 11:09:14 - test_batch.bat - at java.lang.ProcessEnvironment.put(Unknown Source)
2017/09/11 11:09:14 - test_batch.bat - at java.lang.ProcessEnvironment.put(Unknown Source)
2017/09/11 11:09:14 - test_batch.bat - at org.pentaho.di.job.entries.shell.JobEntryShell.executeShell(JobEntryShell.java:568)
2017/09/11 11:09:14 - test_batch.bat - at org.pentaho.di.job.entries.shell.JobEntryShell.execute(JobEntryShell.java:416)
2017/09/11 11:09:14 - test_batch.bat - at org.pentaho.di.job.Job.execute(Job.java:716)
2017/09/11 11:09:14 - test_batch.bat - at org.pentaho.di.job.Job.execute(Job.java:859)
2017/09/11 11:09:14 - test_batch.bat - at org.pentaho.di.job.Job.execute(Job.java:532)
2017/09/11 11:09:14 - test_batch.bat - at org.pentaho.di.job.Job.run(Job.java:424)
2017/09/11 11:09:14 - test_job - Finished job entry [test_batch.bat] (result=[false])
2017/09/11 11:09:14 - test_job - Job execution finished
2017/09/11 11:09:14 - Spoon - Job has ended.

If anyone can advise on the above it'd be greatly appreciated!

Thanks

1
You are using the Execute Shell Scriptin a job. Did you used the Insert script or the Script file name ? And is the Working directory valid? If, yes, the next possible error is your script, which uses willingly or not, a environment variable. - AlainD

1 Answers

0
votes

You want to run a bat file which executes a job? Not to run a command line from a job. Am I right?

In that case the command line is kitchen /job=job-path. Full doc is here and forum is (for example) here.

The command can be included in a bat file, provided the bat file can find the kitchen excutable. I have noticed that recently Pentaho removed the kitchen.exe to replace it with a kitchen.bat, from which you can copy the call line.

In case you want to run a transformation, the command is pan.bat.