relation ts_us_sessions_map_20180606_09 already exists

Document ID : KB000100375
Last Modified Date : 12/06/2018
Show Technical Document Details
Issue:
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] [Manager.com.timestock.tess.util.DbUtils] 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(QueryExecutorImpl.java:2157) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331) at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:208) at com.timestock.tess.util.DbUtils.executeDDL(DbUtils.java:5533) at com.timestock.tess.util.DbUtils.createUserSessionPartitionPostgres(DbUtils.java:6697) at com.timestock.tess.util.DbUtils.createUserSessionPartition(DbUtils.java:6629) at com.timestock.tess.util.DbUtils$SessionPartitionCreator.createPartitions(DbUtils.java:6602) at com.timestock.tess.util.DbUtils.createMissingPartitions(DbUtils.java:6022) at com.timestock.tess.util.DbUtils.createMissingSessionPartitions(DbUtils.java:6616) at com.timestock.tess.services.scheduler.CreateSessionPartitionsTask.run(CreateSessionPartitionsTask.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 6/06/18 10:51:22.541 AM EDT [WARN] [SessionPartition.Thread1] [Manager.com.timestock.tess.util.Messages] 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? 
Resolution:
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: 
<EM-home>/config/internal/server/tess-internal.properties 
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.