Issue Details (XML | Word | Printable)

Key: ABICLOUD-359
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Enric Ruiz
Reporter: Diego Parrilla
Votes: 0
Watchers: 0
Operations

Email this issue
Send issue summary in email
If you were logged in you would be able to see more operations.
Abiquo

JDBC Exception when bundling an image several times

Created: 01/Dec/09 11:36 PM   Updated: 10/Jun/10 11:08 AM   Resolved: 02/Dec/09 03:06 PM
Component/s: Bundle
Affects Version/s: abicloud-1.0.0-RC1
Fix Version/s: abicloud-1.0.0-RC2

Time Tracking:
Not Specified


 Description  « Hide
If you bundle an image several times:

1) create vapp, add virtualmachine with image X
2) bundle vapp and update X image
3) repeat 2 several times

You get this error after a couple of tries:

org.hibernate.exception.DataException: Could not execute JDBC batch update
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:100) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:66) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:
275) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.j
ava:114) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.j
ava:109) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.persister.entity.AbstractEntityPersister.update(Abstrac
tEntityPersister.java:2390) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert
(AbstractEntityPersister.java:2335) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.persister.entity.AbstractEntityPersister.update(Abstrac
tEntityPersister.java:2635) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.ja
va:115) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) [hiber
nate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
 [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
 [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutio
ns(AbstractFlushingEventListener.java:321) [hibernate-core-3.3.1.GA.jar:3.3.1.GA
]
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus
hEventListener.java:50) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) [hibernat
e-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365) [hi
bernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java
:137) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at com.abiquo.abiserver.business.authentication.AuthenticationManagerDB.
checkSession(AuthenticationManagerDB.java:293) [AuthenticationManagerDB.class:na
]
        at com.abiquo.abiserver.business.Proxy.checkSession(Proxy.java:107) [Pro
xy.class:na]
        at com.abiquo.abiserver.commands.BasicCommand.execute(BasicCommand.java:
203) [BasicCommand.class:na]
        at com.abiquo.abiserver.commands.BasicCommand.execute(BasicCommand.java:
260) [BasicCommand.class:na]
        at com.abiquo.abiserver.services.flex.NonBlockingService.checkVirtualApp
liance(NonBlockingService.java:275) [NonBlockingService.class:na]
        at sun.reflect.GeneratedMethodAccessor1014.invoke(Unknown Source) [na:na
]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25) [na:1.6.0_17]
        at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_17]
        at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdap
ter.java:406) [flex-messaging-remoting-3.0.jar:3.0.0.544]
        at flex.messaging.services.RemotingService.serviceMessage(RemotingServic
e.java:183) [flex-messaging-remoting-3.0.jar:3.0.0.544]
        at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java
:1417) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp
oint.java:878) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBroker
Filter.java:121) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:15
8) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:
49) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFi
lter.java:67) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(Serialization
Filter.java:146) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.ja
va:274) [flex-messaging-core-3.0.jar:3.0.0.544]
        at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java
:377) [flex-messaging-core-3.0.jar:3.0.0.544]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [tomcat6
-servlet-2.5-api-6.0.18.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290) [catalina-6.0.18.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206) [catalina-6.0.18.jar:na]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233) [catalina-6.0.18.jar:na]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191) [catalina-6.0.18.jar:na]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128) [catalina-6.0.18.jar:na]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102) [catalina-6.0.18.jar:na]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109) [catalina-6.0.18.jar:na]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286) [catalina-6.0.18.jar:na]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:845) [tomcat-coyote-6.0.18.jar:na]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583) [tomcat-coyote-6.0.18.jar:na]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7) [tomcat-coyote-6.0.18.jar:na]
        at java.lang.Thread.run(Thread.java:619) [na:1.6.0_17]
Caused by: java.sql.BatchUpdateException: Data truncation: Data too long for col
umn 'name' at row 1
        at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStateme
nt.java:1666) [mysql-connector-java-5.1.6.jar:na]
        at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:
1082) [mysql-connector-java-5.1.6.jar:na]
        at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.jav
a:70) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:
268) [hibernate-core-3.3.1.GA.jar:3.3.1.GA]
        ... 46 common frames omitted


Since the name is automatically generated, truncate the name before inserting it.

Enric Ruiz added a comment - 02/Dec/09 09:37 AM
I think that this error is not related directly with the bundling process, the error is produced when the client try to check the current session.

        at com.abiquo.abiserver.business.Proxy.checkSession(Proxy.java:107) [Pro
xy.class:na]
        at com.abiquo.abiserver.commands.BasicCommand.execute(BasicCommand.java:
203) [BasicCommand.class:na]
        at com.abiquo.abiserver.commands.BasicCommand.execute(BasicCommand.java:
260) [BasicCommand.class:na]
        at com.abiquo.abiserver.services.flex.NonBlockingService.checkVirtualApp
liance(NonBlockingService.java:275) [NonBlockingService.class:na]

Xavier Fernandez added a comment - 02/Dec/09 10:12 AM
The problem it's not about the sessions, the error said that the image name are surpassing the length.

Caused by: java.sql.BatchUpdateException: Data truncation: Data too long for col
umn 'name' at row 1

We hace 3 solutions:

Or truncate the bundle name that we insert on db

Or increase the name column.

Or both (the best)

Diego, can you said what image is? In order to reproduce in our environments (Or we can create an image with a long name :P)

Diego Parrilla added a comment - 02/Dec/09 10:15 AM
It's the new hudson image. But it's easy to reproduce. Bundle several times an image and update the virtual app with the new image with a long name and you will get it.


Xavier Fernandez added a comment - 02/Dec/09 12:59 PM
If you change the image name to a long name fails because name in NODE. It's 50 and Name in virtual Image is 256.

I think that here is the problem.

Enric Ruiz added a comment - 02/Dec/09 03:06 PM
I increased the length of the field NAME in the table NODE to 255. It necessary to point that multiple bundles doesn't increase the image name length.