Support Questions

Find answers, ask questions, and share your expertise

Nifi tasks not honouring HTTP_PROXY settings

avatar
Explorer
I have a apache/nifi:latest instance spun inside an Amazon Linux 2 EC2. For reference, see this guide: here

I have a QuerySalesforceObject ver. 1.18.0 that makes use of StandardOauth2AccessTokenProvider.  The oauth2 provider url is configured at https://test.salesforce.com/services/oauth2/token

CRISSAEGRIM_0-1669040457150.png

I can curl this url from the box and from inside the docker container just fine (I don’t get a timeout).

[root@ip-10-229-18-107 \~\]# docker exec -it nifi_container_persistent /bin/sh

printenv | grep -i proxy

HTTPS_PROXY=http://proxy.MY_DOMAIN.com:3128

no_proxy=localhost,127.0.0.1,MY_DOMAIN.com,.amazonaws.com

NO_PROXY=localhost,127.0.0.1, MY_DOMAIN.com,.amazonaws.com

https_proxy=http://proxy.MY_DOMAIN.com:3128

http_proxy=http://proxy.MY_DOMAIN.com:3128

HTTP_PROXY=http://proxy.MY_DOMAIN.com:3128

curl https://test.salesforce.com/services/oauth2/token

{"error":"unsupported_grant_type","error_description":"grant type not supported"}#

But when I run the task, oauth2 fails with an error

java.io.UncheckedIOException: OAuth2 access token request failed

Caused by: java.net.SocketTimeoutException: connect timed out
CRISSAEGRIM_1-1669040482661.png

This leads me to believe the proxy settings are not being honored by the class. How can I fix this?

1 ACCEPTED SOLUTION

avatar
Explorer

Figured out the issue.  The java SDK that nifi uses does not honour "noProxy" flags.

View solution in original post

1 REPLY 1

avatar
Explorer

Figured out the issue.  The java SDK that nifi uses does not honour "noProxy" flags.