davyam commented on pull request #3887: URL: https://github.com/apache/nifi/pull/3887#issuecomment-710739387
Hi @rkarthik29 I am getting the following error: `org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout` Steps that I did: **BUILD NIFI** ``` git clone https://github.com/rkarthik29/nifi-1.git -b NIFI-6032 cd nifi-1 export MAVEN_OPTS="-Xms1024m -Xmx3076m -XX:MaxPermSize=256m" mvn -T C2.0 clean install -Pinclude-grpc -Pinclude-oraclecdc # Error: [ERROR] Failed to execute goal on project nifi-splunk-processors: Could not resolve dependencies for project org.apache.nifi:nifi-splunk-processors:jar:1.11.4: Could not find artifact com.splunk:splunk:jar:1.6.5.0 in splunk... # Solution: mvn -T C2.0 clean install -Pinclude-grpc -Pinclude-oraclecdc -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true cd nifi-assembly/target/ tar -xvzf nifi-1.11.0-SNAPSHOT-bin.tar.gz sh nifi-1.11.0-SNAPSHOT/bin/nifi.sh run ``` **INSTALL ORACLE DRIVER** ``` # Download driver: https://www.oracle.com/br/database/technologies/instant-client/linux-x86-64-downloads.html yum install oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm ``` **CONFIG LIBS** ``` vim ~./bash_profile ... export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib:$LD_LIBRARY_PATH source ~./bash_profile vim nifi-1.11.0-SNAPSHOT/conf/bootstrap.conf ... java.arg.17=-Djava.library.path=/usr/lib/oracle/12.2/client64/lib ... sh nifi-1.11.0-SNAPSHOT/bin/nifi.sh run ``` **CREATE ORACLE XSTREAM OUTBOUND SERVER** ``` # Create Recovery Area dir: mkdir -p /opt/oracle/oradata/recovery_area chown -R oracle: /opt/oracle # Enable GoldenGate replication and archive log mode: su - oracle sqlplus /nolog CONNECT sys AS SYSDBA alter system set db_recovery_file_dest_size = 5G; alter system set db_recovery_file_dest = '/opt/oracle/oradata/recovery_area' scope=spfile; alter system set enable_goldengate_replication=true; shutdown immediate startup mount alter database archivelog; alter database open; # Should show "Database log mode: Archive Mode": archive log list exit; # Create Tablespace dir: mkdir -p /opt/oracle/oradata/tbs # Create an XStream admin user: sqlplus / as sysdba CREATE TABLESPACE xstream_adm_tbs DATAFILE '/opt/oracle/oradata/tbs/xstream_adm_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED; CREATE USER xstrmadmin IDENTIFIED BY xsa DEFAULT TABLESPACE xstream_adm_tbs QUOTA UNLIMITED ON xstream_adm_tbs; GRANT CREATE SESSION TO xstrmadmin; BEGIN DBMS_XSTREAM_AUTH.GRANT_ADMIN_PRIVILEGE( grantee => 'xstrmadmin', privilege_type => 'CAPTURE', grant_select_privileges => TRUE ); END; / exit; # Create XStream user: sqlplus / as sysdba CREATE TABLESPACE xstream_tbs DATAFILE '/opt/oracle/oradata/tbs/xstream_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED; CREATE USER xstrm IDENTIFIED BY xs DEFAULT TABLESPACE xstream_tbs QUOTA UNLIMITED ON xstream_tbs; GRANT CREATE SESSION TO xstrm; GRANT SELECT ON V_$DATABASE to xstrm; GRANT FLASHBACK ANY TABLE TO xstrm; exit; # Create NiFi user: sqlplus / as sysdba CREATE TABLESPACE nifi_tbs DATAFILE '/opt/oracle/oradata/tbs/nifi_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED; CREATE USER nifi IDENTIFIED BY nifi DEFAULT TABLESPACE nifi_tbs QUOTA UNLIMITED ON nifi_tbs; CREATE TABLE nifi.tb_teste (id NUMBER PRIMARY KEY, name VARCHAR2(150)); ALTER TABLE nifi.tb_teste ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS; exit; # Create an XStream Outbound server: sqlplus xstrmadmin/xsa DECLARE tables DBMS_UTILITY.UNCL_ARRAY; schemas DBMS_UTILITY.UNCL_ARRAY; BEGIN tables(1) := NULL; schemas(1) := 'nifi'; DBMS_XSTREAM_ADM.CREATE_OUTBOUND( server_name => 'nfxout', table_names => tables, schema_names => schemas); END; / exit; # Alter the XStream Outbound server to allow the xstrm user to connect to it: sqlplus / as sysdba BEGIN DBMS_XSTREAM_ADM.ALTER_OUTBOUND( server_name => 'nfxout', connect_user => 'xstrm'); END; / exit; # Insert data: INSERT INTO nifi.tb_teste VALUES (1, 'Davy'); ``` NiFi Processor: <img width="804" alt="processor_config" src="https://user-images.githubusercontent.com/32827630/96327216-0dad9b80-100e-11eb-991d-00b687f9b3f5.png"> <img width="1118" alt="processor_error" src="https://user-images.githubusercontent.com/32827630/96327218-0dad9b80-100e-11eb-8105-725646e4d2af.png"> NiFi Services: <img width="772" alt="service_config" src="https://user-images.githubusercontent.com/32827630/96327221-0f775f00-100e-11eb-98ee-15f1567d62cb.png"> <img width="633" alt="driver_location" src="https://user-images.githubusercontent.com/32827630/96327215-0d150500-100e-11eb-9ea1-873eafe9fb67.png"> <img width="1346" alt="service_error" src="https://user-images.githubusercontent.com/32827630/96327222-100ff580-100e-11eb-8b81-372bdf1a2ff7.png"> Oracle views: <img width="1165" alt="DBA_XSTREAM_OUTBOUND" src="https://user-images.githubusercontent.com/32827630/96327214-0be3d800-100e-11eb-96e5-3cca6c7bc401.png"> <img width="779" alt="V$XSTREAM_CAPTURE" src="https://user-images.githubusercontent.com/32827630/96327223-10a88c00-100e-11eb-8974-5e7783d3d1e7.png"> <img width="641" alt="DBA_APPLY" src="https://user-images.githubusercontent.com/32827630/96327212-09817e00-100e-11eb-8232-42ca6968bb18.png"> <img width="1059" alt="V$XSTREAM_OUTBOUND_SERVER" src="https://user-images.githubusercontent.com/32827630/96327224-11412280-100e-11eb-86dc-3fe8c53e3b9a.png"> NiFi log: ``` 2020-10-16 23:39:24,282 INFO [NiFi Web Server-110] o.a.n.c.s.StandardProcessScheduler Starting OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] 2020-10-16 23:39:24,284 INFO [NiFi Web Server-110] o.a.n.controller.StandardProcessorNode Starting OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] 2020-10-16 23:39:24,381 INFO [Flow Service Tasks Thread-1] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@25224e98 // Another save pending = false 2020-10-16 23:40:03,611 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository 2020-10-16 23:40:03,612 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds 2020-10-16 23:40:03,774 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@3d5b2c1e checkpointed with 0 Records and 0 Swap Files in 23 milliseconds (Stop-the-world time = 5 milliseconds, Clear Edit Logs time = 4 millis), max Transaction ID -1 2020-10-16 23:40:24,290 WARN [Monitor Processor Lifecycle Thread-1] o.a.n.controller.StandardProcessorNode Timed out while waiting for OnScheduled of OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] to finish. An attempt is made to cancel the task via Thread.interrupt(). However it does not guarantee that the task will be canceled since the code inside current OnScheduled operation may have been written to ignore interrupts which may result in a runaway thread. This could lead to more issues, eventually requiring NiFi to be restarted. This is usually a bug in the target Processor 'OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51]' that needs to be documented, reported and eventually fixed. 2020-10-16 23:40:24,291 ERROR [Timer-Driven Process Thread-1] o.a.n.p.o.c.i.StandardOracleCDCService StandardOracleCDCService[id=32c9c2cd-0175-1000-c663-73fb836e27c7] cannot attach to outbound server: nfxout java.sql.SQLException: Cannot get a connection, general error 2020-10-16 23:40:24,293 ERROR [Timer-Driven Process Thread-1] o.a.n.p.oraclecdc.OracleChangeCapture OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout: org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout at org.apache.nifi.processors.oraclecdc.controller.impl.StandardOracleCDCService.attach(StandardOracleCDCService.java:198) at sun.reflect.GeneratedMethodAccessor400.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87) at com.sun.proxy.$Proxy89.attach(Unknown Source) at org.apache.nifi.processors.oraclecdc.OracleChangeCapture.onScheduled(OracleChangeCapture.java:137) at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:75) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:52) at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$4(StandardProcessorNode.java:1532) at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 2020-10-16 23:40:24,296 WARN [Timer-Driven Process Thread-1] o.a.n.p.o.c.i.StandardOracleCDCService StandardOracleCDCService[id=32c9c2cd-0175-1000-c663-73fb836e27c7] cannot detach from the outbound server: oracle.streams.XStreamOut 2020-10-16 23:40:24,297 ERROR [Timer-Driven Process Thread-1] org.apache.nifi.util.ReflectionUtils Failed while invoking annotated method 'public void org.apache.nifi.processors.oraclecdc.OracleChangeCapture.shutdown(org.apache.nifi.processor.ProcessContext)' with arguments '[org.apache.nifi.processor.StandardProcessContext@1d5c0a7c]'. java.lang.reflect.InvocationTargetException: null at sun.reflect.GeneratedMethodAccessor402.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130) at org.apache.nifi.util.ReflectionUtils.quietlyInvokeMethodsWithAnnotations(ReflectionUtils.java:268) at org.apache.nifi.util.ReflectionUtils.quietlyInvokeMethodsWithAnnotation(ReflectionUtils.java:90) at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$4(StandardProcessorNode.java:1576) at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.nifi.processor.exception.ProcessException: cannot detach from the outbound server: oracle.streams.XStreamOut at org.apache.nifi.processors.oraclecdc.controller.impl.StandardOracleCDCService.detach(StandardOracleCDCService.java:210) at sun.reflect.GeneratedMethodAccessor403.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87) at com.sun.proxy.$Proxy89.detach(Unknown Source) at org.apache.nifi.processors.oraclecdc.OracleChangeCapture.shutdown(OracleChangeCapture.java:143) ... 15 common frames omitted 2020-10-16 23:41:45,272 INFO [NiFi Web Server-103] o.a.n.c.s.StandardProcessScheduler Stopping OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] 2020-10-16 23:41:45,273 INFO [NiFi Web Server-103] o.a.n.controller.StandardProcessorNode Stopping processor: OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] 2020-10-16 23:41:45,455 INFO [Flow Service Tasks Thread-1] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@25224e98 // Another save pending = false 2020-10-16 23:41:54,308 WARN [Monitor Processor Lifecycle Thread-2] o.a.n.controller.StandardProcessorNode Timed out while waiting for OnScheduled of OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] to finish. An attempt is made to cancel the task via Thread.interrupt(). However it does not guarantee that the task will be canceled since the code inside current OnScheduled operation may have been written to ignore interrupts which may result in a runaway thread. This could lead to more issues, eventually requiring NiFi to be restarted. This is usually a bug in the target Processor 'OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51]' that needs to be documented, reported and eventually fixed. 2020-10-16 23:41:54,308 ERROR [Timer-Driven Process Thread-2] o.a.n.p.o.c.i.StandardOracleCDCService StandardOracleCDCService[id=32c9c2cd-0175-1000-c663-73fb836e27c7] cannot attach to outbound server: nfxout java.sql.SQLException: Cannot get a connection, general error 2020-10-16 23:41:54,309 ERROR [Timer-Driven Process Thread-2] o.a.n.p.oraclecdc.OracleChangeCapture OracleChangeCapture[id=32c99420-0175-1000-0e97-840ff38cca51] Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout: org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout org.apache.nifi.processor.exception.ProcessException: cannot attach to outbound server: nfxout at org.apache.nifi.processors.oraclecdc.controller.impl.StandardOracleCDCService.attach(StandardOracleCDCService.java:198) at sun.reflect.GeneratedMethodAccessor400.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87) at com.sun.proxy.$Proxy89.attach(Unknown Source) at org.apache.nifi.processors.oraclecdc.OracleChangeCapture.onScheduled(OracleChangeCapture.java:137) at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:75) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:52) at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$4(StandardProcessorNode.java:1532) at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 2020-10-16 23:41:54,312 WARN [Timer-Driven Process Thread-2] o.a.n.p.o.c.i.StandardOracleCDCService StandardOracleCDCService[id=32c9c2cd-0175-1000-c663-73fb836e27c7] cannot detach from the outbound server: oracle.streams.XStreamOut 2020-10-16 23:41:54,312 ERROR [Timer-Driven Process Thread-2] org.apache.nifi.util.ReflectionUtils Failed while invoking annotated method 'public void org.apache.nifi.processors.oraclecdc.OracleChangeCapture.shutdown(org.apache.nifi.processor.ProcessContext)' with arguments '[org.apache.nifi.processor.StandardProcessContext@3803bfd3]'. java.lang.reflect.InvocationTargetException: null at sun.reflect.GeneratedMethodAccessor402.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142) at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130) at org.apache.nifi.util.ReflectionUtils.quietlyInvokeMethodsWithAnnotations(ReflectionUtils.java:268) at org.apache.nifi.util.ReflectionUtils.quietlyInvokeMethodsWithAnnotation(ReflectionUtils.java:90) at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$4(StandardProcessorNode.java:1576) at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.nifi.processor.exception.ProcessException: cannot detach from the outbound server: oracle.streams.XStreamOut at org.apache.nifi.processors.oraclecdc.controller.impl.StandardOracleCDCService.detach(StandardOracleCDCService.java:210) at sun.reflect.GeneratedMethodAccessor403.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87) at com.sun.proxy.$Proxy89.detach(Unknown Source) at org.apache.nifi.processors.oraclecdc.OracleChangeCapture.shutdown(OracleChangeCapture.java:143) ... 15 common frames omitted 2020-10-16 23:42:03,613 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository 2020-10-16 23:42:03,613 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds 2020-10-16 23:42:03,796 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@3d5b2c1e checkpointed with 0 Records and 0 Swap Files in 21 milliseconds (Stop-the-world time = 5 milliseconds, Clear Edit Logs time = 4 millis), max Transaction ID -1 ``` Is something wrong? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org