knime batch mode

batch
#1

Hi everyone,

I run “C:\Program Files\KNIME\knime.exe” -consoleLog -noexit -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -preferences=“C:\Users\NACAD49312\knime-workspace\preferences.epf” -workflowDir=“C:/Users/NACAD49312/knime-workspace/CENPES_rev2_avaliacao”

I have got this error:
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

I hope anyone tell me a tip to solve this.
Thanks.

0 Likes

#2

Hi @Alexandre1,

this is just a typical logger output and not an error. Does the workflow run as expected?

Best,

Christian

0 Likes

#3

Hi Christian,

Workflow does not run as expected. But i tried to implement -reset and now it runs. Now I need to implement the command -workflow.variable=itemdesejado,“REGULADOR PRESSÃO P/SUPR.INSTR.”,STRING. And I have got this: ERROR main BatchExecutor Couldn’t parse -workflow.variable argument: -workflow.variable=itemdesejado,REGULADOR PRESS?O P/SUPR.INSTR.,STRING: Invalid type for workflow variable itemdesejado: STRING. Any help for that?

Thanks for your support

0 Likes

#4

Hi Alexandre1,

check Check https://www.knime.com/faq#q12. I guess you have to do lower-case “STRING” or similar.

Cheers,

Christian

0 Likes

#5

Hi @christian.dietz,

today, I spend some 6 hrs using trial-and-error approach to figure our, how the KNIME batch mode works on a windows machine in general. Even if I finally managed to run my workflow (hints: set PATH-environment to KNIME.EXE, rewrite windows-styled paths from backslash to slash, " or ’ for paths etc.) I wasn’t able to redirect the console log into a text file. Is there any hint from your side how to solve this in particular? And in general, is there any more detailed description for the batch-mode than FAQ#12?
The batch-mode capability is so powerful, I’d love to use it more often…!

Thanks in advance and kind regards,

Patrick

0 Likes

#6

Hi @Patrick1974,

unfortunately, we don’t have any further documentation of the batch mode. The best we can offer is typing knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION​, which gives you a full overview of the batch executor capabilities. Regarding the log output: Can you pipe the output to a textfile (e.g. > mylog.txt)?

Cheers,

Christian

0 Likes

Can't run KNIME workflow via batch mode on windows
#7

Hi @christian.dietz,

after adding “-consoleLog” and “-noexit”, I managed to see the batch parameter. However, > log.txt didn’t do the trick - the ConsoleOutput is not under control of the CMD-windows and therefore not part of redirectable output - see command line below:
knime -consoleLog -nosplash -noexit -application org.knime.product.KNIME_BATCH_APPLICATION > log.txt

However, I was able to copy-paste the output to a file and for conveniences I added the output (see below).

Again, I’d love to capture the consoleLog output to a file in order to have a kind of a trace log when using KNIME in a productive environment - any idea, how to perform this? Is there a “Console-Redirector-Bode” available?

CompilerOracle: exclude javax/swing/text/GlyphView.getBreakSpot
ERROR    main KNIMECorePlugin    Error while starting workbench, some setting may not have been applied properly: null
Usage: The following options are available:
 -nosave           => do not save the workflow after execution has finished
 -reset            => reset workflow prior to execution
 -failonloaderror  => don't execute if there are errors during workflow loading
 -updateLinks      => update metanode links to latest version
 -credential=name[;login[;password]] => for each credential enter credential
                      name and optional login/password, otherwise its prompted for
 -masterkey[=...]  => prompt for master password (used in e.g. database nodes),
                      if provided with argument, use argument instead of prompting
 -preferences=...  => path to the file containing eclipse/knime preferences,
 -workflowFile=... => ZIP file with a ready-to-execute workflow in the root
                      of the ZIP
 -workflowDir=...  => directory with a ready-to-execute workflow
 -destFile=...     => ZIP file where the executed workflow should be written to
                      if omitted the workflow is only saved in place
 -destDir=...      => directory where the executed workflow is saved to
                      if omitted the workflow is only saved in place
 -workflow.variable=name,value,type => define or overwrite workflow variable
                      'name' with value 'value' (possibly enclosed by quotes). The
                      'type' must be one of "String", "int" or "double".
Some KNIME settings can also be adjusted by Java properties;
they need to be provided as last option in the command line:
 -vmargs -Dorg.knime.core.maxThreads=n => sets the maximum
                  number of threads used by KNIME

The following return codes are defined:
        0       upon successful execution
        2       if parameters are wrong or missing
        3       when an error occurs during loading a workflow
        4       if an error during execution occurred

Kind regards,

Patrick.

2 Likes

#8

Hi @Patrick1974,

do we know any update about how to stored logs from Knime in a batch mode? I’ve always found Knime a really cool tool, but I feel a bit disappointing that the batch-mode’s logs are not stored directly. If everything’s ran corrrect, Knime is great. If not, is a bit hard to finding out why it failed. :sa:

thanks a lot Patrick!

0 Likes

#9

I did this several times using a custom log4j configuration, where you can redirect and prioritize your logs to different sources (e.g. show only info level on console, but log debug to file).

You would create log4j.xml file and specify this as VM args at the end of the knime command:

… -vmargs -Dlog4j.configuration=log4j.xml

– Philipp

2 Likes

Workflow log file rotation workaround
#10

… and there are also the logs that are stored in the usual location under the workspace’s .metadata directory.

0 Likes

#11

Did you ever get a Workflow to run without error in Windows via a batch file? If so, can you share what you bat file looks like?

0 Likes

#12

Hi there!

I’m no Patrick but I got workflows running without error on Windows via batch file. Example is attached.

Hope it helps.

Batch_example.zip (334 Bytes)

Br,
Ivan

0 Likes