api-manager icon indicating copy to clipboard operation
api-manager copied to clipboard

Forget-Me Tool does not function as described in the documentation with deleted-user information in databases

Open YasasRangika opened this issue 4 months ago • 0 comments

Description

As mentioned in the official documentation [1], I followed the steps and encountered the following errors while running the tool:

[com.zaxxer.hikari.pool.HikariPool] DEBUG : HikariPool-4 - Cannot acquire connection from data source
org.h2.jdbc.JdbcSQLNonTransientConnectionException: A file path that is implicitly relative to the current working directory is not allowed in the database URL "jdbc:h2:repository/database/WSO2METRICS_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE". Use an absolute path, ~/name, ./name, or the baseDir setting instead. [90011-210]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:697)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:496)
	at org.h2.message.DbException.get(DbException.java:227)
	at org.h2.message.DbException.get(DbException.java:203)
	at org.h2.engine.ConnectionInfo.getName(ConnectionInfo.java:464)
	at org.h2.engine.Engine.openSession(Engine.java:49)

This error is resolved by deleting the corresponding datasource from the specific datasource file. The same issue occurs with the 'WSO2MB_DB' as well.

If all the erroneous datasources are deleted, the scripts run without the above errors. However, in the end, the following errors occur:

[org.wso2.carbon.privacy.forgetme.ForgetMeExecutionEngine] ERROR : Interrupted while executing the processor thread : java.util.concurrent.FutureTask@2ef8a8c3[Completed exceptionally: org.wso2.carbon.privacy.forgetme.api.runtime.InstructionExecutionException: Error occurred while executing sql from : /Users/yasas/Documents/Release/4.4.0/Alpha_testing/forgetme_tool/tool/identity-anonymization-tool-1.4.1/conf/sql/identity]
java.util.concurrent.ExecutionException: org.wso2.carbon.privacy.forgetme.api.runtime.InstructionExecutionException: Error occurred while executing sql from : /Users/yasas/Documents/Release/4.4.0/Alpha_testing/forgetme_tool/tool/identity-anonymization-tool-1.4.1/conf/sql/identity
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
	at org.wso2.carbon.privacy.forgetme.ForgetMeExecutionEngine.waitForCompletion(ForgetMeExecutionEngine.java:109)
	at org.wso2.carbon.privacy.forgetme.ForgetMeExecutionEngine.execute(ForgetMeExecutionEngine.java:91)
	at org.wso2.carbon.privacy.forgetme.ForgetMeTool.process(ForgetMeTool.java:204)
	at org.wso2.carbon.privacy.forgetme.ForgetMeTool.main(ForgetMeTool.java:141)
Caused by: org.wso2.carbon.privacy.forgetme.api.runtime.InstructionExecutionException: Error occurred while executing sql from : /Users/yasas/Documents/Release/4.4.0/Alpha_testing/forgetme_tool/tool/identity-anonymization-tool-1.4.1/conf/sql/identity
	at org.wso2.carbon.privacy.forgetme.sql.instructions.RdbmsForgetMeInstruction.execute(RdbmsForgetMeInstruction.java:148)
	at org.wso2.carbon.privacy.forgetme.ForgetMeExecutionEngine$ProcessorPipeline.call(ForgetMeExecutionEngine.java:219)
	at org.wso2.carbon.privacy.forgetme.ForgetMeExecutionEngine$ProcessorPipeline.call(ForgetMeExecutionEngine.java:189)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.wso2.carbon.privacy.forgetme.sql.exception.SQLModuleException: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "IDN_USER_ACCOUNT_ASSOCIATION" not found (this database is empty); SQL statement:
UPDATE IDN_USER_ACCOUNT_ASSOCIATION
SET USER_NAME =  ?
WHERE USER_NAME =  ?
      AND DOMAIN_NAME =  ?
      AND TENANT_ID =  ?  [42104-210]
	at org.wso2.carbon.privacy.forgetme.sql.module.DomainSeparatedSQLExecutionModule.execute(DomainSeparatedSQLExecutionModule.java:95)
	at org.wso2.carbon.privacy.forgetme.sql.module.DomainSeparatedSQLExecutionModule.execute(DomainSeparatedSQLExecutionModule.java:36)
	at org.wso2.carbon.privacy.forgetme.sql.instructions.RdbmsForgetMeInstruction.execute(RdbmsForgetMeInstruction.java:102)
	... 6 more
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "IDN_USER_ACCOUNT_ASSOCIATION" not found (this database is empty); SQL statement:
UPDATE IDN_USER_ACCOUNT_ASSOCIATION
SET USER_NAME =  ?
WHERE USER_NAME =  ?
      AND DOMAIN_NAME =  ?
      AND TENANT_ID =  ?  [42104-210]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:521)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:496)
	at org.h2.message.DbException.get(DbException.java:227)
	at org.h2.message.DbException.get(DbException.java:203)
	at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8397)
	at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8381)
	at org.h2.command.Parser.readTableOrView(Parser.java:8370)
	at org.h2.command.Parser.readTableOrView(Parser.java:8340)
	at org.h2.command.Parser.readSimpleTableFilter(Parser.java:1151)
	at org.h2.command.Parser.parseUpdate(Parser.java:1109)
	at org.h2.command.Parser.parsePrepared(Parser.java:841)
	at org.h2.command.Parser.parse(Parser.java:674)
	at org.h2.command.Parser.parse(Parser.java:644)
	at org.h2.command.Parser.prepareCommand(Parser.java:551)
	at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615)
	at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553)
	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116)
	at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92)
	at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288)
	at com.zaxxer.hikari.proxy.ConnectionProxy.prepareStatement(ConnectionProxy.java:265)
	at com.zaxxer.hikari.proxy.HikariConnectionProxy.prepareStatement(HikariConnectionProxy.java)
	at org.wso2.carbon.privacy.forgetme.sql.util.NamedPreparedStatement.<init>(NamedPreparedStatement.java:72)
	at org.wso2.carbon.privacy.forgetme.sql.util.NamedPreparedStatement.<init>(NamedPreparedStatement.java:83)
	at org.wso2.carbon.privacy.forgetme.sql.module.DomainSeparatedSQLExecutionModule.execute(DomainSeparatedSQLExecutionModule.java:70)
	... 8 more

When I check the databases, I can see that the deleted user entries are still available, i.e., in the CREATED_BY column in the AM_API table. This indicates that the tool was unable to process those entries in the databases.

[1] https://apim.docs.wso2.com/en/latest/install-and-setup/setup/security/general-data-protection-regulation-gdpr-for-wso2-api-manager/

Steps to Reproduce

N/A

Affected Component

APIM

Version

4.4.0-alpha

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

YasasRangika avatar Oct 04 '24 04:10 YasasRangika