Thanks Otto for your response.

Indeed this is the exception which is thrown. We activated the debug logging and saw that there is no flow file to transfer:

2023-01-04 15:48:53,701 DEBUG [NiFi Web Server-6778] o.a.nifi.web.api.DataTransferResource finished transferring flow files, numOfFlowFiles=0

After this log, and few other debug logs, the raised exception is logged.

I am not sure what it means as well. Why must NiFi throw an exception, if no data is available to transfer? According to my understanding, it is not an exception, if no data exists to transfer.

Do someone knows more about the behaviour there? :-)

Kind regards
Fabian

Am 04.01.23 um 14:16 schrieb Otto Fowler:
  ```
                     try {
                         int numOfFlowFiles =
serverProtocol.getPort().transferFlowFiles(peer, serverProtocol);
                         logger.debug("finished transferring flow files,
numOfFlowFiles={}", numOfFlowFiles);
                         if (numOfFlowFiles < 1) {
                             // There was no flow file to transfer. Throw
this exception to stop responding with SEE OTHER.
                             throw new
WebApplicationException(Response.Status.OK);
                         }
                     } catch (NotAuthorizedException | BadRequestException |
RequestExpiredException e) {
                         // Handshake is done outside of write() method, so
these exception wouldn't be thrown.
                         throw new IOException("Failed to process the
request.", e);
                     }
```

I’m not sure about what this means, other than what it says, that there is
nothing to transfer

From: Fabian Reiber <rei...@dfn-cert.de> <rei...@dfn-cert.de>
Reply: users@nifi.apache.org <users@nifi.apache.org> <users@nifi.apache.org>
Date: January 3, 2023 at 10:24:54
To: users@nifi.apache.org <users@nifi.apache.org> <users@nifi.apache.org>
Subject:  Unintelligible exception log for HTTP-200 response

Hi people,

We have a setup with 2 NiFi instances (here we name it "nifi-instance-1"
br/>and ""nifi-instance-2") in version 1.16.3 running in podman containers
br/>respectively in pods. In the log file of nifi-app.log we discover the
br/>following: <

2023-01-03 12:00:00,195 INFO [NiFi Web Server-46]
br//>org.apache.nifi.web.server.RequestLog 10.0.2.100 - nifi-instance-2
[03/Jan/2023:12:00:00 +0000] "POST
br/>/nifi-api/data-trannsfer/output-ports/721c54f7-0185-1000-8cc8-d1a327e7a98f/transactions

HTTP/1.1" 201 155 "-" "Apache-HttpClient/4.5.13 (Java/11.0.12)"
br/>2023-01-03 12:00:00,221 WARN [[NiFi Web Server-235]
o.a.n.w.a.c.WebApplicationExceptionMapper
br/>javax.ws.rs.WebAppplicationException: HTTP 200 OK. Returning 200
br/>response. javax.wss.rs.WebApplicationException: HTTP 200 OK at
br/>org.apache.nifi.web..api.DataTransferResource$1.write(DataTransferResource.java:670)
brr/>at
br/>org.glassfish.jersey.message.internal.StreamingOutputProvidder.writeTo(StreamingOutputProvider.java:55)

...
     at
br/>org.eclipse.jetty.util.thread.QueuuedThreadPool.runJob(QueuedThreadPool.java:883)

     at
br/>org.eclipse.jetty.util.thread.QueuuedThreadPool$Runner.run(QueuedThreadPool.java:1034)

     at java.base/java.lang.Thread.run(Unknown Source)


The full traceback is attached. The instances are running on the same
br/>machine and working properly. ""nifi-instance-1" has an output port
br/>configured as ""Remote connections (site-to-site)". "nifi-instance-2"
has br/>a Remote Process Group and is configuured to connect to br/>""
nifi-instance-1.de" via HTTPs to fetch the flow files. The connection
br/>between them and the sharing of floow files work as expected. Except
this br/>log message we don't underrstand.

The authorizations.xml of "nifi-instance-1" has this configuration,
br/>among other things, to allow the other instance to send/reeceive data:

<policy identifier="cbeec38a-0178-1000-77da-25e37ce5344e"
br/>resource="/data-transfer/output-ports/721c54f7-0185-1000-8cc8-d1a327e7a98f"
br/>action="W">
     <group identifier="1f68ef93-0176-1000-c949-f005799da72d"/>
</policy>
<policy identifier="2fe2ee5f-0174-1000-e61b-45137c67eac1"
br/>resource="/site-to-site" action="R">
     <group identifier="1f68ef93-0176-1000-c949-f005799da72d"/>
</policy>

The users.xml contains among other things this:

<group identifier="1f68ef93-0176-1000-c949-f005799da72d"
br/>name="nifi-instance-2">
     <user identifier="1f6ba22e-0176-1000-7b45-ec3ea6d38fe5"/>
</group>
<users>
     <user identifier="1f6ba22e-0176-1000-7b45-ec3ea6d38fe5" br/>identity="
nifi-instance-2.de"/>
</users>

"nifi-instance-2" has also the configuration for the /site-to-site
br/>resource to allow it for ""nifi-instance-1". But it should not be
br/>necessary for the occurrence of this log. <

As I said, the data exchange between them is working fine. We found this
br/>issue: https://issues.apache.org/jira/browse/NIFFI-9752 and already
br/>deleted and recreated the output port, but without ssuccess.

The last output in the stack trace hypothesizes that there is something
br/>wrong with the permissions!!? But we are not sure. Do we miss anything?

Do you have any idea what the reason could be for this log? We guess, we
br/>can suppress the log in our logback config. But we wantt to figure out
br/>what the reason is :-) <

Kind regards
Fabian

-- br/>FFabian Reiber, M.Sc. (Projekt- u. Entwicklungsteam)
Phone: +49 40 808077-689 Fax: +49 40 808077-556 Mail: rei...@dfn-cert.de

DFN-CERT Services GmbH, https://www.dfn-cert.de/, Phone +49 40 808077-555
Sitz / Register: Hamburg, AG Hamburg, HRB 88805, Ust-IdNr.: DE 232129737
Nagelsweg 41, 20097 Hamburg, Germany. CEO: Dr. Klaus-Peter Kossakowski


--
Fabian Reiber, M.Sc.                      (Projekt- u. Entwicklungsteam)
Phone: +49 40 808077-689 Fax: +49 40 808077-556 Mail: rei...@dfn-cert.de

DFN-CERT Services GmbH, https://www.dfn-cert.de/, Phone  +49 40 808077-555
Sitz / Register: Hamburg, AG Hamburg, HRB 88805,  Ust-IdNr.:  DE 232129737
Nagelsweg 41, 20097 Hamburg, Germany. CEO: Dr. Klaus-Peter Kossakowski

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to