Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Windows Batch Script runs from the command prompt, but fails to run in the ExecuteStreamCommand Processor

avatar
New Contributor
Environment

OS: Windows

main batch Script: sample_Import_Load.bat

@echo off && pushd "%~dp0" && setlocal

call "C:\Program Files\CARIS\BASE Editor\5.5\system\caris_env.bat"

call "C:\sample_Testing\1_XYZ\import-points-loop.bat"

set pythonpath=c:\Program Files\CARIS\BASE Editor\5.5\python\3.5

python "C:\sample_Testing\2_Coverages_Upload\coverage_loader_sample.py" -L dba/sql@localhost -D sample_TEST -o surfac -t .csar -f "C:\sample_Testing\2_Coverages_Upload" -m "C:\sample_Testing\2_Coverages_Upload\Sample_Meta.csv" -v

popd && endlocal
pause


Nested batch script: Import-points-loop.bat

@echo off && pushd "%~dp0" && setlocal

call "C:\Program Files\CARIS\BASE Editor\5.5\system\caris_env.bat"

FOR %%f in (*.xyz) do (
carisbatch --run ImportPoints --input-format ASCII --input-crs EPSG:3395 --output-crs EPSG:32659 --info-file "C:\sample_Testing\1_XYZ\Example.info" "%%~nf.xyz" "C:\sample_Testing\2_Coverages_Upload\%%~nf.csar"
)

popd && endlocal
REM pause

 

Python Call Code snippet:

 

""" This script can be executed to load a coverage file into a BDB Server database and optionally being able to load related metadata from a CSV file """
import argparse
import sys
import os
import getpass
import csv

# Attempt to import CARIS modules
try:
import caris.bathy.db as bdb
import caris.coverage
import caris
except ImportError as e:
if "No module named" in str(e):
print('Error importing CARIS modules. Is the PYTHONPATH variable configured with the path to the installed CARIS Python modules?')
sys.exit(1)
raise e

...

When I execute this batch Script from a windows command prompt. i.e., C:\windows\system32\cmd.exe\sample_Import_Load.bat
everything works correctly, but when I execute the script from within Nifi's ExecuteStreamCommand 1.19.1

I get a message "Unknown process name "ImportPoints" ERROR: No such feature is available on the license server." in the List Queue and the process aborts.

When I view the content in List Queue, I get a message "No such feature is available on the license server." = SNTL_NO_SUCH_FEATURE

https://docs.sentinel.thalesgroup.com/softwareandservices/RMS/RMSDocumentation/APIREF/Content/Unifie...

RMS explains this error as "The requested feature does not exist on the License Manager host Diagnose further for locking mismatch and similar issues to understand why the license failed to load"

CARIS Support is saying that Apache Nifi is causing this issue, they asked mr to confirm that the Sentinel License Server default port is open, which I did.

 

ExecuteStreamCommand

Property Value
Command Arguments Strategy: Commmand Arguments Property
Command Arguments: /C C:\Temp\sample_Import_Load.bat
Ignore STDIN: false
Working Directory: No value set

 

Does anyone know what would cause the execution of the sample_Import_Load.bat to run correctly from the windows command prompt, but fail when executed via the ExecuteStreamCommand processor with these errors?

 

Thanks

5 REPLIES 5

avatar
New Contributor

Update:

We attempted to bundle the execute of the sample_Import_Load.bat call into a PowerShell script, and then use the ExecuteStreamCommand processor to execute the PowerShell script.  

Findings:

The PowerShell script executed from the windows command prompt without issue, but the execution from the PowerShell script from the Processor Failed with the same error: ERROR: No such feature is available on the license server." 

 

Could the issue be the windows account that the Nifi service is running under?

avatar
Community Manager

@Fredb Welcome to our community! To help you get the best possible answer, I have tagged our NiFi experts  @cotopaul @MattWho who may be able to assist you further.

Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
New Contributor

Still wait for an answer Vidya. 

avatar
Community Manager

@steven-matison @SAMSAL Any insights here? Thanks!


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar

@Fredb  This is a very difficult one to solve.   

 

Does anyone know what would cause the execution of the sample_Import_Load.bat to run correctly from the windows command prompt, but fail when executed via the ExecuteStreamCommand processor with these errors?

 

This is most likely caused by permission issues.    Nifi requires specific permissions against files and scripts it touches or executes from within processors.  As such, the error is saying the processor does not know where any of the resources exist to run that .bat file.    

 

I do not have any experience with nifi on windows, other than to avoid it, but the solution is likely the same as other operating systems.   Make sure the nifi user has full ownership of the file(s).   Additionally, it is sometimes possible to find deeper errors looking at the nifi-app.log file while testing and/or setting the log level of the processor to be more aggressive.