Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

METRON-1720: Better error messages when there are no results or wireshark is not installed#1154

Closed
merrimanr wants to merge 113 commits intoapache:feature/METRON-1554-pcap-query-panelfrom
merrimanr:METRON-1720
Closed

METRON-1720: Better error messages when there are no results or wireshark is not installed#1154
merrimanr wants to merge 113 commits intoapache:feature/METRON-1554-pcap-query-panelfrom
merrimanr:METRON-1720

Conversation

@merrimanr
Copy link
Copy Markdown
Contributor

Contributor Comments

This PR adds error handling when pdml results are requested after a pcap job has finished. I also added a small fix to a pcap-panel-component.ts test where the job status wasn't properly set.

Testing

This has been tested in full dev:

  1. Navigate to the Pcap tab in the Alerts UI
  2. Submit a Pcap query with a filter you know won't match any results
  3. After the job finishes you should see an error message that says "No results found"
  4. Uninstall wireshark in full dev: yum -y remove wireshark
  5. Run a query that will produce results
  6. You should get an error message that includes a message about tshark not being found

Pull Request Checklist

Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.

In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:

For all changes:

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

For code changes:

  • Have you included steps to reproduce the behavior or problem that is being changed or addressed?

  • Have you included steps or a guide to how the change may be verified and tested manually?

  • Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:

    mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh 
    
  • Have you written or updated unit tests and or integration tests to verify your changes?

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?

  • Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via site-book/target/site/index.html:

    cd site-book
    mvn site
    

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.

merrimanr and others added 30 commits July 13, 2018 16:31
 into pcaprest

Conflicts:
	metron-interface/metron-alerts/src/app/app.module.ts
 Conflicts:
	metron-interface/metron-rest/src/main/java/org/apache/metron/rest/MetronRestApplication.java
	metron-interface/metron-rest/src/main/java/org/apache/metron/rest/controller/PcapQueryController.java
	metron-interface/metron-rest/src/main/java/org/apache/metron/rest/util/pcapQueryThread.java
Conflicts:
src/app/pcap/model/pcap.request.ts
src/app/pcap/pcap-panel/pcap-panel.component.ts
src/app/pcap/pcap.module.ts
src/app/pcap/service/pcap.service.spec.ts
src/app/pcap/service/pcap.service.ts
tiborm and others added 26 commits July 27, 2018 12:37
Conflicts:
src/app/pcap/pcap-panel/pcap-panel.component.html
…ation

Revert "PCAP UI - Implement port validation"
Cover the pcap panel component with unit tests.
PCAP UI: add unit tests for search in panel
PCAP UI: add unit tests for pcap packet component
PCAP UI: covering pcap-packet-line.component with unit tests
…anel' into METRON-1720

# Conflicts:
#	metron-interface/metron-alerts/src/app/pcap/model/pcap-status-response.ts
#	metron-interface/metron-alerts/src/app/pcap/model/pcap.mock.ts
#	metron-interface/metron-alerts/src/app/pcap/pcap-pagination/pcap-pagination.component.html
#	metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.spec.ts
#	metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts
#	metron-interface/metron-alerts/src/app/pcap/service/pcap.service.spec.ts
#	metron-interface/metron-alerts/src/app/pcap/service/pcap.service.ts
Copy link
Copy Markdown
Contributor

@mmiklavc mmiklavc left a comment

Choose a reason for hiding this comment

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

Note for observers/rewiewers. This was originally forked from #1122. 1122 has been squashed onto the feature branch which is why this PR is showing 113 commits in the diff. The file diff is correct.

Just one question about removing that error handling line I commented about and this should be good to go pending Travis.

return this.http.get(`/api/v1/pcap/${id}/pdml?page=${pageId}`, new RequestOptions({headers: new Headers(this.defaultHeaders)}))
.map(HttpUtil.extractData)
.catch(HttpUtil.handleError)
.onErrorResumeNext();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are the implications of removing onErrorResumeNext()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It won't catch the error if that line is included.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So previously it would catch the error and continue on regardless. Now it catches the error and handles it?

Copy link
Copy Markdown
Contributor Author

@merrimanr merrimanr Aug 8, 2018

Choose a reason for hiding this comment

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

It was not passing the error on to the client observer.

@mmiklavc
Copy link
Copy Markdown
Contributor

mmiklavc commented Aug 8, 2018

@merrimanr thanks for the clarification. +1 via inspection.

@merrimanr merrimanr closed this Aug 8, 2018
asfgit pushed a commit that referenced this pull request Aug 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants