Page 1 of 1

Bug: Error when blacklist import contains duplicate emails

Posted: Thu Jul 25, 2013 6:00 pm
by bk007
The "Check for duplicate records" filtering doesn't seem to work for an import mode of "Add recipients to blacklist", and the import instead fails with an error

STEPS TO REPRODUCE:
- Create an import profile to "Add recipients to blacklist"
- Import a CSV that contains duplicate email addresses (see example file below)
- Run the import, and the page displays ""A general error occurred. Please check your input."


STACKTRACE - The stacktrace is pretty helpful in this case. It doesn't looks like there's no filtering being done on the importInToBlackList method.

2013-07-25 16:40:34,581: ERROR [pool-1-thread-5] org.agnitas.service.ImportRecipientsProcessWorker - Error during import: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [INSERT INTO cust_ban_tbl (company_id, email) VALUES (?,?)]; Duplicate entry '1-email2@email.com' for key 'PRIMARY'; nested exception is java.sql.BatchUpdateException: Duplicate entry '1-email2@email.com' for key 'PRIMARY'
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228)
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:619)
org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:866)
org.agnitas.dao.impl.ImportRecipientsDaoImpl.importInToBlackList(ImportRecipientsDaoImpl.java:967)
org.agnitas.service.impl.NewImportWizardServiceImpl.doValidate(NewImportWizardServiceImpl.java:314)
org.agnitas.service.impl.NewImportWizardServiceImpl.doParse(NewImportWizardServiceImpl.java:218)
org.agnitas.service.ImportRecipientsProcessWorker.call(ImportRecipientsProcessWorker.java:47)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
java.util.concurrent.FutureTask.run(FutureTask.java:166)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:722)


SAMPLE INPUT FILE (note there are duplicate addresses in this)

"EMAIL"
"email1@email.com"
"email2@email.com"
"email2@email.com"
"email3@email.com"

Re: Bug: Error when blacklist import contains duplicate emai

Posted: Fri Jul 26, 2013 10:31 am
by maschoff
Thanks for your bug report, we could confirm it. We will provide a fix via SourceForge asap.

Re: Bug: Error when blacklist import contains duplicate emai

Posted: Mon Aug 26, 2013 2:34 pm
by bk007
Hey Maschoff,

Thanks for the reply.

But any update on this one?

Re: Bug: Error when blacklist import contains duplicate emai

Posted: Sat Sep 07, 2013 7:12 am
by maschoff
I uploaded modified class NewImportWizardServiceImpl to SourceForge at
https://sourceforge.net/projects/openem ... /Bugfixes/

To modify an existing installation replace files NewImportWizardServiceImpl.class and NewImportWizardServiceImpl_RootNode.class in directory /home/openemm/webapps/openemm/WEB-INF/classes/org/agnitas/service/impl and restart OpenEMM.

Important: Replace "_" in the latter file name with "$" because SourceForge can not handle the Dollar sign.

Binaries were compiled with Java 7.

Please check if this bugfix works for you.