View Issue Details

IDProjectCategoryView StatusLast Update
0002050SymmetricDSBugpublic2015-01-06 17:27
ReporterrottenAssigned Tochenson 
PrioritylowSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product Version3.6.12 
Target Version3.7.0Fixed in Version3.7.0 
Summary0002050: dropping a table before dropping trigger causes NPE
DescriptionI've seen this before, and it tripped me up again, so I figured I'd mention it. I observed this issue in 3.6.12, today so it is still new.

If you drop a table before you drop the trigger_router/trigger entries the node will get stuck and be unable to start. It gets stuck around the sync-triggers step with an NPE.

java.lang.NullPointerException
    at org.jumpmind.symmetric.db.postgresql.PostgreSqlSymmetricDialect.removeTrigger(PostgreSqlSymmetricDialect.java:168)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.dropTriggers(TriggerRouterService.java:1203)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.inactivateTriggers(TriggerRouterService.java:1183)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1098)
    at org.jumpmind.symmetric.SymmetricAdmin.syncTrigger(SymmetricAdmin.java:402)
    at org.jumpmind.symmetric.SymmetricAdmin.executeWithOptions(SymmetricAdmin.java:279)
    at org.jumpmind.symmetric.AbstractCommandLauncher.execute(AbstractCommandLauncher.java:177)
    at org.jumpmind.symmetric.SymmetricAdmin.main(SymmetricAdmin.java:126)

The work around is to stick an empty table back in there and then start it back up and then after symmetricds is running smoothly, remove the table.


Steps To ReproduceHere are some things I tried after it failed to start because the table was gone.

$ ./symadmin sync-triggers -p my.properties -v
Log output will be written to /symmds/logs/my.log
-------------------------------------------------------------------------------
An exception occurred. Please see the following for details:
-------------------------------------------------------------------------------
java.lang.NullPointerException
    at org.jumpmind.symmetric.db.postgresql.PostgreSqlSymmetricDialect.removeTrigger(PostgreSqlSymmetricDialect.java:168)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.dropTriggers(TriggerRouterService.java:1203)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.inactivateTriggers(TriggerRouterService.java:1183)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1098)
    at org.jumpmind.symmetric.SymmetricAdmin.syncTrigger(SymmetricAdmin.java:402)
    at org.jumpmind.symmetric.SymmetricAdmin.executeWithOptions(SymmetricAdmin.java:279)
    at org.jumpmind.symmetric.AbstractCommandLauncher.execute(AbstractCommandLauncher.java:177)
    at org.jumpmind.symmetric.SymmetricAdmin.main(SymmetricAdmin.java:126)
-------------------------------------------------------------------------------


$ ./symadmin drop-triggers -p my.properties -v mytable
Log output will be written to /symmds/logs/my.log
Dropping trigger for table data_delivery_log


$ ./symadmin sync-triggers -p my.properties -v
Log output will be written to my.log
-------------------------------------------------------------------------------
An exception occurred. Please see the following for details:
-------------------------------------------------------------------------------
java.lang.NullPointerException
    at org.jumpmind.symmetric.db.postgresql.PostgreSqlSymmetricDialect.removeTrigger(PostgreSqlSymmetricDialect.java:168)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.dropTriggers(TriggerRouterService.java:1203)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.inactivateTriggers(TriggerRouterService.java:1183)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1098)
    at org.jumpmind.symmetric.SymmetricAdmin.syncTrigger(SymmetricAdmin.java:402)
    at org.jumpmind.symmetric.SymmetricAdmin.executeWithOptions(SymmetricAdmin.java:279)
    at org.jumpmind.symmetric.AbstractCommandLauncher.execute(AbstractCommandLauncher.java:177)
    at org.jumpmind.symmetric.SymmetricAdmin.main(SymmetricAdmin.java:126)
-------------------------------------------------------------------------------

I was able to add triggers to another table by explicitly setting it in the sync-triggers cli. I just couldn't get it to run a "sync all triggers", which in turn was causing it to fail to start.
Additional InformationThe actual NPE on startup is slightly different than what I've pasted above (which is from the CLI sync-triggers).

2014-11-04 15:22:27,277 INFO [SymmetricDS] [TriggerRouterService] [symmetric-engine-startup-0] Done synchronizing triggers
2014-11-04 15:22:27,279 ERROR [SymmetricDS] [AbstractSymmetricEngine] [symmetric-engine-startup-0] An error occurred while starting SymmetricDS
java.lang.NullPointerException
    at org.jumpmind.symmetric.db.postgresql.PostgreSqlSymmetricDialect.removeTrigger(PostgreSqlSymmetricDialect.java:168)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.dropTriggers(TriggerRouterService.java:1203)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.inactivateTriggers(TriggerRouterService.java:1183)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1098)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1046)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1042)
    at org.jumpmind.symmetric.AbstractSymmetricEngine.start(AbstractSymmetricEngine.java:533)
    at org.jumpmind.symmetric.AbstractSymmetricEngine.start(AbstractSymmetricEngine.java:499)
    at org.jumpmind.symmetric.web.SymmetricEngineHolder$EngineStarter.run(SymmetricEngineHolder.java:440)

TagsNo tags attached.

Activities

chenson

2014-11-04 17:38

administrator   ~0000594

Thanks for the report!

Related Changesets

SymmetricDS: master eb87d813

2014-11-04 17:38:13

chenson

Details Diff
0002050: dropping a table before dropping trigger causes NPE
0002050
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/postgresql/PostgreSqlSymmetricDialect.java Diff File

Issue History

Date Modified Username Field Change
2014-11-04 16:09 rotten New Issue
2014-11-04 17:37 chenson Assigned To => chenson
2014-11-04 17:37 chenson Status new => assigned
2014-11-04 17:38 chenson Fixed in Version => 3.7.0
2014-11-04 17:38 chenson Target Version => 3.7.0
2014-11-04 17:38 chenson Status assigned => resolved
2014-11-04 17:38 chenson Resolution open => fixed
2014-11-04 17:38 chenson Note Added: 0000594
2014-11-04 18:00 chenson Changeset attached => SymmetricDS trunk r8892
2015-01-06 17:27 chenson Status resolved => closed
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master eb87d813