Support Questions

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

Unable to do a clean Nifi restart from ambari

avatar

Everytime I try to restart clean restart fails but nifi but nifi will be running. Also tried restarting from cli same issue. Because of this I am unable to apply any conf changes from Ambari. Attached screenshot of the exception. It reads as

stderr: Traceback (most recent call last):  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 982, in restart    self.status(env)  File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py", line 156, in status    check_process_status(status_params.nifi_node_pid_file)  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/check_process_status.py", line 43, in check_process_status    raise ComponentIsNotRunning() ComponentIsNotRunning 
The above exception was the cause of the following exception: 
Traceback (most recent call last):  File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py", line 278, in     Master().execute()  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 353, in execute    method(env)  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 993, in restart    self.start(env, upgrade_type=upgrade_type)  File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py", line 152, in start    nifi_cli.create_or_update_reg_client(params.nifi_registry_host, params.nifi_registry_url)  File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi_cli.py", line 175, in create_or_update_reg_client    existing_clients = list_reg_clients()  File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi_cli.py", line 144, in list_reg_clients    outputType="json"  File "/var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi_cli.py", line 73, in nifi_cli    raise Fail("Failed to execute nifi cli.sh command") resource_management.core.exceptions.Fail: Failed to execute nifi cli.sh command

Tried increasing heap settings, cleaning up logs. Nothing worked.

@Matt Clarke @Bryan Bende


1562091463601.png
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Vishwa Golakoti

As we see:

raise Fail("Failed to execute nifi cli.sh command")

.

By any chance are you running Ambari Agent as a Non Root user on the Nifi Host?

If yes then can you please check if you have given the Sudoer permission the following file properly isnide your "/etc/sudoer" file for that user?

"/var/lib/ambari-agent/tmp/nifi-toolkit-x.x.x.x.x/bin/cli.sh *"


If above is not the case then can you please provide the following info and test the following:


1. What is your exact HDF version which you are using ?

2. Can you please check and share the output of the following command from NiFi host where the startup is failing?

# grep 'stack_support_nifi_auto_client_registration' /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py


Just in case if you see the output as following:

Original Lines

# grep 'stack_support_nifi_auto_client_registration' /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py
    if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration:


Changed Line

# grep 'stack_support_nifi_auto_client_registration' /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py
    if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration and False: 


Then for a quick test can you change that line by appending " and False:" at the end like following and then restart NiFi again from ambari UI?


The above change will skip the NiFi's client registration on startup and might prevent NiFi Startup failure.


In Later version of HDF that script is already changed as following to include the "force_skip_registry_registration":

    if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration and not params.force_skip_registry_registration:

.

.


View solution in original post

2 REPLIES 2

avatar
Master Mentor

@Vishwa Golakoti

As we see:

raise Fail("Failed to execute nifi cli.sh command")

.

By any chance are you running Ambari Agent as a Non Root user on the Nifi Host?

If yes then can you please check if you have given the Sudoer permission the following file properly isnide your "/etc/sudoer" file for that user?

"/var/lib/ambari-agent/tmp/nifi-toolkit-x.x.x.x.x/bin/cli.sh *"


If above is not the case then can you please provide the following info and test the following:


1. What is your exact HDF version which you are using ?

2. Can you please check and share the output of the following command from NiFi host where the startup is failing?

# grep 'stack_support_nifi_auto_client_registration' /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py


Just in case if you see the output as following:

Original Lines

# grep 'stack_support_nifi_auto_client_registration' /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py
    if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration:


Changed Line

# grep 'stack_support_nifi_auto_client_registration' /var/lib/ambari-agent/cache/common-services/NIFI/1.0.0/package/scripts/nifi.py
    if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration and False: 


Then for a quick test can you change that line by appending " and False:" at the end like following and then restart NiFi again from ambari UI?


The above change will skip the NiFi's client registration on startup and might prevent NiFi Startup failure.


In Later version of HDF that script is already changed as following to include the "force_skip_registry_registration":

    if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration and not params.force_skip_registry_registration:

.

.


avatar

@Jay Kumar SenSharma after Changing if params.nifi_registry_url and params.stack_support_nifi_auto_client_registration and False: it worked. Thank you so much!