Hitachi Vantara Pentaho Community Forums
Results 1 to 12 of 12

Thread: Cannot run a job or transform with command line

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Angry Cannot run a job or transform with command line

    Hi all,

    I've created a basic job and a basic transform which are running perfectly fine using the designer in spoon.

    The problem I have is when I try to run this job or the transform from a command line in windows (XP SP2)...

    I put the error message I have below, the first one is when I try to run the job with a connection to the repository and the second is when I run it as a xml file...None works...

    For some reason it looks like the problem might be around the file repositories.xml (which looked fine for me as far as I can see...)

    If anyone has a thought that would be greatly appriciated...

    Thanks




    C:\Program Files\Java\jre6\bin>kitchen.bat /rep:"repoDI" /job:"Jb_Load_Employees" /dir:/ /user:test /pass:test /level:Basic
    INFO 27-11 13:23:50,109 - Kitchen - Logging is at level : Basic logging
    INFO 27-11 13:23:50,109 - Kitchen - Start of run.
    2008/11/27 13:23:51:265 GMT [INFO] DefaultFileReplicator - Using "C:\DOCUME~1\UKCCO1~1\LOCALS~1\Temp\vfs_cache" as temporary files store.
    INFO 27-11 13:23:51,375 - RepositoriesMeta - Reading repositories XML file: C:\Documents and Settings\ukcco1mfi\.kettle\repositories.xml
    ERROR: No repository provided, can't load job.
    ERROR: Kitchen can't continue because the job couldn't be loaded.








    C:\Program Files\Java\jre6\bin>kitchen.bat /file:"job_to_run\Jb_Load_Employees.kjb" /level:Basic
    INFO 27-11 13:30:41,173 - Kitchen - Logging is at level : Basic logging
    INFO 27-11 13:30:41,173 - Kitchen - Start of run.
    2008/11/27 13:30:42:343 GMT [INFO] DefaultFileReplicator - Using "C:\DOCUME~1\UKCCO1~1\LOCALS~1\Temp\vfs_cache" as temporary files store.
    INFO 27-11 13:30:42,608 - Jb_Load_Employees - Starting entry [Load_text_Files1]
    INFO 27-11 13:30:42,608 - Load_text_Files1 - Loading transformation from repository [Load_text_Files1] in directory [/]
    ERROR 27-11 13:30:42,608 - Thread[Jb_Load_Employees (Jb_Load_Employees (Thread-2)),5,main] - org.pentaho.di.core.exception.KettleException:
    Unexpected error during transformation metadata load

    No repository defined!


    at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:800)
    at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:434)
    at org.pentaho.di.job.Job.execute(Job.java:410)
    at org.pentaho.di.job.Job.execute(Job.java:511)
    at org.pentaho.di.job.Job.execute(Job.java:296)
    at org.pentaho.di.job.Job.execute(Job.java:264)
    at org.pentaho.di.kitchen.Kitchen.main(Kitchen.java:354)
    Caused by: org.pentaho.di.core.exception.KettleException:
    No repository defined!

    at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:784)
    ... 6 more

    Exception in thread "main" org.pentaho.di.core.exception.KettleException:
    Unexpected error occurred while launching entry [Load_text_Files1.0]

    Unexpected error during transformation metadata load

    No repository defined!



    at org.pentaho.di.job.Job.execute(Job.java:516)
    at org.pentaho.di.job.Job.execute(Job.java:296)
    at org.pentaho.di.job.Job.execute(Job.java:264)
    at org.pentaho.di.kitchen.Kitchen.main(Kitchen.java:354)
    Caused by: org.pentaho.di.core.exception.KettleException:
    Unexpected error during transformation metadata load

    No repository defined!


    at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:800)
    at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:434)
    at org.pentaho.di.job.Job.execute(Job.java:410)
    at org.pentaho.di.job.Job.execute(Job.java:511)
    ... 3 more
    Caused by: org.pentaho.di.core.exception.KettleException:
    No repository defined!

    at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:784)
    ... 6 more

    C:\Program Files\Java\jre6\bin>

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    See if the repository name is specified correctly. /rep:"repoDI"
    See if there are no trailing spaces or anything like that.

  3. #3
    DEinspanjer Guest

    Default

    And for the second instance where you are trying to run the .kjb file, make sure you pass the /norep flag to Kitchen to tell it not to try to log in to a repository.

  4. #4
    Join Date
    Dec 2008
    Posts
    5

    Angry

    Same issue here... Works fine within Spoon, but with exported job and transformations (a .kjb and a set of .ktr), whether or not the repository is specified (/repo:"pentrepo" or /norep), the result is always that:

    Code:
    ERROR 21-01 09:48:52,038 - Thread[Set Variable Test (Set Variable Test (Thread-2)),5,main] - org.pen
    taho.di.core.exception.KettleException:
    Unexpected error during transformation metadata load
    
    No repository defined!
    
    
            at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:800)
            at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:434)
            at org.pentaho.di.job.Job.execute(Job.java:410)
            at org.pentaho.di.job.Job.execute(Job.java:511)
            at org.pentaho.di.job.Job.execute(Job.java:296)
            at org.pentaho.di.job.Job.execute(Job.java:264)
            at org.pentaho.di.kitchen.Kitchen.main(Kitchen.java:354)
    Caused by: org.pentaho.di.core.exception.KettleException:
    No repository defined!
    All transformation files are all in a given folder, and kitchen command is run from its own directory... Thanks for any inputs.

  5. #5
    Join Date
    Dec 2008
    Posts
    5

    Default

    typo in my last post: should read "/rep" instead of "/repo"

  6. #6
    Join Date
    Dec 2008
    Posts
    5

    Default Exporting to XML file, are the steps ok? Still not working...

    I'd like to know what step I'm missing or if I misunderstood something:

    I have a job composed of transformations.

    - For each transformations I export to a .ktr file.
    - I export the job to a .kjb file.
    - Each file is copied under a same directory (for this example: %PDI_PROJECT_HOME%\CommonDB)

    And when I run this command (within the directory %PDI_HOME%):

    Code:
    %PDI_HOME%\kitchen.bat /file:"%PDI_PROJECT_HOME%\CommonDB\transfer_SLA_v1.kjb" /job:"Set Variable Test" /norep
    Then the error mentionned below appears. The only way I can make it work is with the repository:

    Code:
    %PDI_HOME%\kitchen /rep:"pentrepo" /user:"admin" /pass:"admin" /job:"Set Variable Test"
    Any hints? I can provide more information if needed.... Thanks!

  7. #7
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Code:
    "%PDI_PROJECT_HOME%\CommonDB\transfer_SLA_v1.kjb"
    I'm not sure this is resolved properly by the MS-DOS command line. Try losing the double quotes.

    Code:
    /job:"Set Variable Test"
    Remove that part.

  8. #8
    Join Date
    Dec 2008
    Posts
    5

    Default

    Thanks for the suggestion. Same thing happens, here's the entire stack trace. May be it is related to how the .ktr file is resolved in the newly exported .kjb file? Should we explicitely modify the .kjb file to "point" to the ktr files?

    Code:
    C:\apps\pdi-open-3.1.0-826>kitchen.bat /file:c:\apps\pdi-projects\CommonDB\transfer_SLA_v1.kjb /norep
    INFO  28-01 10:34:40,079 - Kitchen - Start of run.
    2009/01/28 10:34:41:298 EST [INFO] DefaultFileReplicator - Using "C:\DOCUME~1\DANIEL~1\LOCALS~1\Temp\vfs_cache" as temporary files store.
    INFO  28-01 10:34:41,485 - Set Variable Test - Starting entry [Set variables]
    INFO  28-01 10:34:41,501 - Set variables - Loading transformation from repository [Set variables] in directory [/]
    ERROR 28-01 10:34:41,501 - Thread[Set Variable Test (Set Variable Test (Thread-2)),5,main] - org.pentaho.di.core.exception.KettleException:
    Unexpected error during transformation metadata load
    
    No repository defined!
    
    
            at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:800)
            at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:434)
            at org.pentaho.di.job.Job.execute(Job.java:410)
            at org.pentaho.di.job.Job.execute(Job.java:511)
            at org.pentaho.di.job.Job.execute(Job.java:296)
            at org.pentaho.di.job.Job.execute(Job.java:264)
            at org.pentaho.di.kitchen.Kitchen.main(Kitchen.java:354)
    Caused by: org.pentaho.di.core.exception.KettleException:
    No repository defined!
    
            at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:784)
            ... 6 more
    
    Exception in thread "main" org.pentaho.di.core.exception.KettleException:
    Unexpected error occurred while launching entry [Set variables.0]
    
    Unexpected error during transformation metadata load
    
    No repository defined!
    
    
    
            at org.pentaho.di.job.Job.execute(Job.java:516)
            at org.pentaho.di.job.Job.execute(Job.java:296)
            at org.pentaho.di.job.Job.execute(Job.java:264)
            at org.pentaho.di.kitchen.Kitchen.main(Kitchen.java:354)
    Caused by: org.pentaho.di.core.exception.KettleException:
    Unexpected error during transformation metadata load
    
    No repository defined!
    
    
            at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:800)
            at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:434)
            at org.pentaho.di.job.Job.execute(Job.java:410)
            at org.pentaho.di.job.Job.execute(Job.java:511)
            ... 3 more
    Caused by: org.pentaho.di.core.exception.KettleException:
    No repository defined!
    
            at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:784)
            ... 6 more
    
    C:\apps\pdi-open-3.1.0-826>

  9. #9
    DEinspanjer Guest

    Default

    I think the problem might be that just because you export the files from the repository, that won't cause Kettle to rewrite your Job Entries to point at files instead of the repository.
    So if you open up your job file transfer_SLA_v1.kjb and look at the entries inside it that call other jobs or transformations, they are likely still configured to point at the repository. You'll need to change them to point at the files you have exported instead. Then, the whole thing should be able to run without the repository.

  10. #10
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    I would say that DEinspanjer has it nailed.

    From your trace:
    error during transformation metadata load
    I have both a repository (for Production jobs) and file-system based (for Development and Sandbox jobs) --
    When in the repository, you need to define transformation steps to look in the repository, and when
    in the filesystem, you need to define the transformation steps to look in the filesystem.

    One thing that the developers have done to make the filesystem definitions easier is allow you to use internal variables
    (eg ${Internal.Job.Filename.Directory}) in the transformation file name. As long as your kjb and jtr files are in the same
    directory, the linkage between them won't get broken when moving them around.

    However, if you move between filesystem and repository, you have to update the linkages.

  11. #11
    Join Date
    Dec 2008
    Posts
    5

    Default works now

    That was it. Thanks also for the suggestion of using ${Internal.Job.Filename.Directory} as part of the filename of the transformation.

    Thanks all!

  12. #12
    Join Date
    Oct 2008
    Posts
    4

    Default

    Try running the below command for executing the .kjb file from command prompt:


    C:\pentaho>kitchen.bat /file:"C:\test\test1.kjb" /leve:Basic

    give the complete path of the job file you want to execute from the command line like mentioned above, test is the directory where test1.kjb is palced.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.