relation ts_us_sessions_map_20180606_09 already exists

Document ID : KB000100375
Last Modified Date : 12/06/2018
Show Technical Document Details
We added a collector to our APM cluster. We copied the EM from an existing enterprise manager.

After the start of EM, EM is showing the following error in it's logs:

[ERROR] [SessionPartition.Thread1] [] Unable to create user session partition for 2018-06-06 09:00 org.postgresql.util.PSQLException: ERROR: relation "ts_us_sessions_map_20180606_09" already exists at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse( at org.postgresql.core.v3.QueryExecutorImpl.processResults( at org.postgresql.core.v3.QueryExecutorImpl.execute( at org.postgresql.jdbc2.AbstractJdbc2Statement.execute( at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags( at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate( at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate( at com.timestock.tess.util.DbUtils.executeDDL( at com.timestock.tess.util.DbUtils.createUserSessionPartitionPostgres( at com.timestock.tess.util.DbUtils.createUserSessionPartition( at com.timestock.tess.util.DbUtils$SessionPartitionCreator.createPartitions( at com.timestock.tess.util.DbUtils.createMissingPartitions( at com.timestock.tess.util.DbUtils.createMissingSessionPartitions( at at java.util.concurrent.Executors$ at java.util.concurrent.FutureTask.runAndReset( at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301( at java.util.concurrent.ScheduledThreadPoolExecutor$ at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at 6/06/18 10:51:22.541 AM EDT [WARN] [SessionPartition.Thread1] [] Message key not defined in properties file: errors.createPartitionError; a default message has been provided.

The other collector is not generating the messages. How do I clear this message? 
Please run the following steps and observe if we see the behavior change. 

1) Shutdown all EMs in the cluster (MOM and all Collectors) 
2) delete the following file: 
from MOM and all collectors (make backup copy of this file before delete). 

3) Execute following query in APMDB: 
> delete from ts_entity; 
> commit; 

4) Restart all EMs (MOM & Collectors), start MOM first wait for few minutes 
and then start Collectors.