[ 
https://issues.apache.org/jira/browse/NIFI-11794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pierre Villard updated NIFI-11794:
----------------------------------
    Description: 
Trying to configure the NiFi cluster state provider with the Redis 
implementation against a Google Cloud Platform Memorystore instance.

I can see that there is no state saved in the redis instance.

When trying to clear state of a processor:
{code:java}
2023-07-11 17:57:39,007 ERROR [NiFi Web Server-22] 
o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: 
java.lang.NullPointerException. Returning Internal Server Error response.
java.lang.NullPointerException: null
    at 
org.apache.nifi.redis.state.RedisStateProvider.lambda$replace$1(RedisStateProvider.java:248)
    at 
org.apache.nifi.redis.state.RedisStateProvider.withConnection(RedisStateProvider.java:313)
    at 
org.apache.nifi.redis.state.RedisStateProvider.replace(RedisStateProvider.java:207)
    at 
org.apache.nifi.redis.state.RedisStateProvider.clear(RedisStateProvider.java:263)
    at 
org.apache.nifi.controller.state.manager.StandardStateManagerProvider$1.clear(StandardStateManagerProvider.java:395)
    at 
org.apache.nifi.controller.state.StandardStateManager.clear(StandardStateManager.java:85)
    at 
org.apache.nifi.web.dao.impl.StandardComponentStateDAO.clearState(StandardComponentStateDAO.java:58)
    at 
org.apache.nifi.web.dao.impl.StandardComponentStateDAO.clearState(StandardComponentStateDAO.java:72)
    at 
org.apache.nifi.web.dao.impl.StandardComponentStateDAO$$FastClassBySpringCGLIB$$51589743.invoke(<generated>)
 {code}
However this action results in creating the key in the Redis instance:
{code:java}
# redis-cli -h ... -p ... -a ... --tls --cacert /tmp/server-ca.pem 
...:6378> KEYS *
1) "nifi/components/46025cdf-0189-1000-ffff-ffffc11ae372"
...:6378> GET "nifi/components/46025cdf-0189-1000-ffff-ffffc11ae372"
"{\"version\":0,\"encodingVersion\":1,\"stateValues\":{}}"
{code}
The configuration in state-management.xml is looking like:
{code:java}
    <cluster-provider>
        <id>redis-provider</id>
        <class&gt;org.apache.nifi.redis.state.RedisStateProvider</class&gt;
        <property name="Redis Mode">Standalone</property>
        <property name="Connection String">...:6378</property>
        <property name="Password">...</property>
        <property name="Enable TLS">true</property>
    </cluster-provider> {code}
CA cert has been added in the NiFi truststore.

Still debugging the code to figure out the issue and will also add additional 
logs.

 

  was:
Trying to configure the NiFi cluster state provider with the Redis 
implementation against a Google Cloud Platform Memorystore instance.

I can see that there is no state saved in the redis instance.

When trying to clear state of a processor:

 
{code:java}
2023-07-11 17:57:39,007 ERROR [NiFi Web Server-22] 
o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: 
java.lang.NullPointerException. Returning Internal Server Error response.
java.lang.NullPointerException: null
    at 
org.apache.nifi.redis.state.RedisStateProvider.lambda$replace$1(RedisStateProvider.java:248)
    at 
org.apache.nifi.redis.state.RedisStateProvider.withConnection(RedisStateProvider.java:313)
    at 
org.apache.nifi.redis.state.RedisStateProvider.replace(RedisStateProvider.java:207)
    at 
org.apache.nifi.redis.state.RedisStateProvider.clear(RedisStateProvider.java:263)
    at 
org.apache.nifi.controller.state.manager.StandardStateManagerProvider$1.clear(StandardStateManagerProvider.java:395)
    at 
org.apache.nifi.controller.state.StandardStateManager.clear(StandardStateManager.java:85)
    at 
org.apache.nifi.web.dao.impl.StandardComponentStateDAO.clearState(StandardComponentStateDAO.java:58)
    at 
org.apache.nifi.web.dao.impl.StandardComponentStateDAO.clearState(StandardComponentStateDAO.java:72)
    at 
org.apache.nifi.web.dao.impl.StandardComponentStateDAO$$FastClassBySpringCGLIB$$51589743.invoke(<generated>)
 {code}
However this action results in creating the key in the Redis instance:

 

 
{code:java}
# redis-cli -h ... -p ... -a ... --tls --cacert /tmp/server-ca.pem 
...:6378> KEYS *
1) "nifi/components/46025cdf-0189-1000-ffff-ffffc11ae372"
...:6378> GET "nifi/components/46025cdf-0189-1000-ffff-ffffc11ae372"
"{\"version\":0,\"encodingVersion\":1,\"stateValues\":{}}"
{code}
The configuration in state-management.xml is looking like:
{code:java}
    <cluster-provider>
        <id>redis-provider</id>
        <class>org.apache.nifi.redis.state.RedisStateProvider</class>
        <property name="Redis Mode">Standalone</property>
        <property name="Connection String">...:6378</property>
        <property name="Password">...</property>
        <property name="Enable TLS">true</property>
    </cluster-provider> {code}
CA cert has been added in the NiFi truststore.

Still debugging the code to figure out the issue and will also add additional 
logs.

 


> RedisStateProvider failing when used with GCP Memorystore
> ---------------------------------------------------------
>
>                 Key: NIFI-11794
>                 URL: https://issues.apache.org/jira/browse/NIFI-11794
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Pierre Villard
>            Assignee: Pierre Villard
>            Priority: Major
>             Fix For: 1.latest, 2.latest
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Trying to configure the NiFi cluster state provider with the Redis 
> implementation against a Google Cloud Platform Memorystore instance.
> I can see that there is no state saved in the redis instance.
> When trying to clear state of a processor:
> {code:java}
> 2023-07-11 17:57:39,007 ERROR [NiFi Web Server-22] 
> o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred: 
> java.lang.NullPointerException. Returning Internal Server Error response.
> java.lang.NullPointerException: null
>     at 
> org.apache.nifi.redis.state.RedisStateProvider.lambda$replace$1(RedisStateProvider.java:248)
>     at 
> org.apache.nifi.redis.state.RedisStateProvider.withConnection(RedisStateProvider.java:313)
>     at 
> org.apache.nifi.redis.state.RedisStateProvider.replace(RedisStateProvider.java:207)
>     at 
> org.apache.nifi.redis.state.RedisStateProvider.clear(RedisStateProvider.java:263)
>     at 
> org.apache.nifi.controller.state.manager.StandardStateManagerProvider$1.clear(StandardStateManagerProvider.java:395)
>     at 
> org.apache.nifi.controller.state.StandardStateManager.clear(StandardStateManager.java:85)
>     at 
> org.apache.nifi.web.dao.impl.StandardComponentStateDAO.clearState(StandardComponentStateDAO.java:58)
>     at 
> org.apache.nifi.web.dao.impl.StandardComponentStateDAO.clearState(StandardComponentStateDAO.java:72)
>     at 
> org.apache.nifi.web.dao.impl.StandardComponentStateDAO$$FastClassBySpringCGLIB$$51589743.invoke(<generated>)
>  {code}
> However this action results in creating the key in the Redis instance:
> {code:java}
> # redis-cli -h ... -p ... -a ... --tls --cacert /tmp/server-ca.pem 
> ...:6378> KEYS *
> 1) "nifi/components/46025cdf-0189-1000-ffff-ffffc11ae372"
> ...:6378> GET "nifi/components/46025cdf-0189-1000-ffff-ffffc11ae372"
> "{\"version\":0,\"encodingVersion\":1,\"stateValues\":{}}"
> {code}
> The configuration in state-management.xml is looking like:
> {code:java}
>     <cluster-provider>
>         <id>redis-provider</id>
>         <class&gt;org.apache.nifi.redis.state.RedisStateProvider</class&gt;
>         <property name="Redis Mode">Standalone</property>
>         <property name="Connection String">...:6378</property>
>         <property name="Password">...</property>
>         <property name="Enable TLS">true</property>
>     </cluster-provider> {code}
> CA cert has been added in the NiFi truststore.
> Still debugging the code to figure out the issue and will also add additional 
> logs.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to