Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-13609 Correct Component Search Configuration #9131

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

exceptionfactory
Copy link
Contributor

Summary

NIFI-13609 Corrects the Component Search configuration definitions to avoid failures when using the search field in the web user interface.

Changes include removing a duplicate Controller Search Service bean definition and wiring in the correct Controller Search Service to the Controller Facade bean definition.

This issue does not impact released versions and was a result of recent changes with Spring Framework configuration refactoring.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Removed duplicate Controller Search Service bean definition
- Wired Controller Search Service to Controller Facade bean definition
@bbende bbende self-requested a review July 31, 2024 17:03
Copy link
Contributor

@bbende bbende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this fix... With a single processor on the canvas the search worked correctly. I then added a child PG with a processor inside it, went back to root group and searched and got a 500 response, checked the logs and found:

2024-07-31 13:14:35,345 ERROR [NiFi Web Server-64] o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: java.lang.NullPointerException: Cannot invoke "org.apache.nifi.controller.FlowController.getControllerServiceProvider()" because "this.flowController" is null. Returning Internal Server Error response.
java.lang.NullPointerException: Cannot invoke "org.apache.nifi.controller.FlowController.getControllerServiceProvider()" because "this.flowController" is null
	at org.apache.nifi.web.search.attributematchers.SearchableMatcher.match(SearchableMatcher.java:44)
	at org.apache.nifi.web.search.attributematchers.SearchableMatcher.match(SearchableMatcher.java:32)
	at org.apache.nifi.web.search.AttributeBasedComponentMatcher.lambda$match$0(AttributeBasedComponentMatcher.java:46)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.apache.nifi.web.search.AttributeBasedComponentMatcher.match(AttributeBasedComponentMatcher.java:46)
	at org.apache.nifi.web.controller.ControllerSearchService.lambda$searchComponentType$2(ControllerSearc

Refreshing the page and deleting the child PG put it back to working.

@exceptionfactory
Copy link
Contributor Author

Testing this fix... With a single processor on the canvas the search worked correctly. I then added a child PG with a processor inside it, went back to root group and searched and got a 500 response, checked the logs and found:

2024-07-31 13:14:35,345 ERROR [NiFi Web Server-64] o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: java.lang.NullPointerException: Cannot invoke "org.apache.nifi.controller.FlowController.getControllerServiceProvider()" because "this.flowController" is null. Returning Internal Server Error response.
java.lang.NullPointerException: Cannot invoke "org.apache.nifi.controller.FlowController.getControllerServiceProvider()" because "this.flowController" is null
	at org.apache.nifi.web.search.attributematchers.SearchableMatcher.match(SearchableMatcher.java:44)
	at org.apache.nifi.web.search.attributematchers.SearchableMatcher.match(SearchableMatcher.java:32)
	at org.apache.nifi.web.search.AttributeBasedComponentMatcher.lambda$match$0(AttributeBasedComponentMatcher.java:46)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.apache.nifi.web.search.AttributeBasedComponentMatcher.match(AttributeBasedComponentMatcher.java:46)
	at org.apache.nifi.web.controller.ControllerSearchService.lambda$searchComponentType$2(ControllerSearc

Refreshing the page and deleting the child PG put it back to working.

Thanks for the feedback @bbende. The SearchableMatcher was also missing a reference to FlowController, now corrected.

Copy link
Contributor

@bbende bbende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest update looks good and previous issue is working now, thanks! Will merge after CI builds

@bbende bbende merged commit 8ad6aa6 into apache:main Jul 31, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants