[ 
https://issues.apache.org/jira/browse/NIFI-2291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15403611#comment-15403611
 ] 

ASF GitHub Bot commented on NIFI-2291:
--------------------------------------

Github user YolandaMDavis commented on the issue:

    https://github.com/apache/nifi/pull/752
  
    @markap14 found an issue during testing.  When attempting to run the 
SiteToSiteProvenanceReporterTask on a single node setup (attempting to report 
to a cluster) I did not have the site to site port set, so the task attempted 
to log a warning. In the process it received an IllegalAccessException when it 
was attempting to use the getLogger parent method to obtain a logger to log the 
warning.  That causes setup to fail and the reporter to not execute (see 
attached log).   I think changing the code in 
AbstractSiteToSiteReportingTask.java (starting at line 115) to use a locally 
declared logger variable defaulted using the getLogger() method will help (e.g. 
declaring  final ComponentLog logger = getLogger(); and using logger in the 
EventReporter). Here is the current code with suggested changes in comments:
    
    `
    //suggest to add 
    //ComponentLog logger = getLogger();
     final EventReporter eventReporter = new EventReporter() {
                @Override
                public void reportEvent(final Severity severity, final String 
category, final String message) {
                    switch (severity) {
                        case WARNING:
                            getLogger().warn(message); //suggest change to 
logger.warn(message);
                            break;
                        case ERROR:
                            getLogger().error(message); //suggest change to 
logger.error(message);
                            break;
                        default:
                            break;
                    }
                }
            };
    `
    
    When the SiteToSite port value was set on the cluster, communication 
occurred as expected and the contextURI in the captured json appears in the 
format expected. (e.g. http://localhost:808/nifi-api )
    
    Attached are pictures of the error:
    <img width="1440" alt="sitetositeloggererror" 
src="https://cloud.githubusercontent.com/assets/1371858/17322062/aaad713c-5869-11e6-8e1b-cd33e5b30b54.png";>
    
    



> Site-to-Site Provenance Reporting Task showing wrong content URI
> ----------------------------------------------------------------
>
>                 Key: NIFI-2291
>                 URL: https://issues.apache.org/jira/browse/NIFI-2291
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>             Fix For: 1.0.0
>
>
> I'm seeing the following JSON provided by the reporting task:
> {"eventId":"056aaf5c-476b-48fb-a252-55f9c6f42287",
> "eventOrdinal":113158283,
> "eventType":"ATTRIBUTES_MODIFIED",
> "timestampMillis":1468719367054,
> "timestamp":"2016-07-17T01:36:07.054Z",
> "durationMillis":-1,
> "lineageStart":1468718777766,
> "componentId":"f1550b29-5823-31c0-801d-d95770828ca9",
> "componentType":"UpdateAttribute",
> "componentName":"UpdateAttribute",
> "entityId":"14d23482-e2e6-4740-af6a-31059134feef",
> "entityType":"org.apache.nifi.flowfile.FlowFile",
> "entitySize":1431,
> "previousEntitySize":1431,
> "updatedAttributes":{},
> "previousAttributes":{"path":"./","execution.command":"python","filename":"5285482415879175","execution.command.args":"-m
>  
> json.tool","execution.status":"0","reporting.task.transaction.id":"a3528aa7-674b-4de1-a65c-61ff0b094eac","execution.error":"","uuid":"14d23482-e2e6-4740-af6a-31059134feef"},
> "actorHostname":"nifi-02",
> "contentURI":"http:/-02:8080/nifi-api/controller/provenance/events/113158283/content/output",
> "previousContentURI":"http:/-02:8080/nifi-api/controller/provenance/events/113158283/content/input",
> "parentIds":[],
> "childIds":[],
> "platform":"nifi",
> "application":"NiFi Flow"}
> It appears that the "/nifi" is getting removed from the content URI - I think 
> this has to do with the following block of code in the reporting task:
> `final String urlPrefix = nifiUrl.toString().replace(nifiUrl.getPath(), "");`



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to