cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cahill <>
Subject EntityExistsException on management server startup (createDefaultNetworks)
Date Fri, 02 Nov 2012 08:26:07 GMT

Over the past few days, I've run into EntityExistsException several times
when I shut down and restart my management server:

ERROR [cloud.servlet.CloudStartupServlet] (main:) Exception starting
management server
javax.persistence.EntityExistsException: Entity already exists:

This generally requires a drop database, redeploy etc - very time consuming.

I dug into the error a little, and the code behavior seems a little strange.

See, createDefaultNetworks(),
line 1085:

long id = 1;

And line 1141:
_networkDao.persist(network, false,

The code is trying to insert rows into the networks table, with "id"s
starting at 1. However, the existing values in the networks table also
start at 1, giving a primary key exception and causing the management
server not to start successfully.

Is the networks table supposed to always be empty at startup so that these
inserts will always succeed even though they are setting id to 1 blindly?
Or is the code wrong to be starting IDs at 1 and failing on duplicate key


*Info on my setup:*
Running CloudStack from master (4.1.0-SNAPSHOT).

Setup process for the management server was:

Grab latest from git repo, then:

mvn install
mvn -P developer -pl developer -Ddeploydb
export MAVEN_OPTS="-Xmx1024m -Xdebug
mvn -pl :cloud-client-ui jetty:run

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message