{"action":"created","issue":{"url":"https://api.github.com/repos/ctron/package-drone/issues/88","labels_url":"https://api.github.com/repos/ctron/package-drone/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/ctron/package-drone/issues/88/comments","events_url":"https://api.github.com/repos/ctron/package-drone/issues/88/events","html_url":"https://github.com/ctron/package-drone/issues/88","id":77711761,"number":88,"title":"Problems with aspect \"P2 Metadata Generator\"","user":{"login":"afischer211","id":4056990,"avatar_url":"https://avatars.githubusercontent.com/u/4056990?v=3","gravatar_id":"","url":"https://api.github.com/users/afischer211","html_url":"https://github.com/afischer211","followers_url":"https://api.github.com/users/afischer211/followers","following_url":"https://api.github.com/users/afischer211/following{/other_user}","gists_url":"https://api.github.com/users/afischer211/gists{/gist_id}","starred_url":"https://api.github.com/users/afischer211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afischer211/subscriptions","organizations_url":"https://api.github.com/users/afischer211/orgs","repos_url":"https://api.github.com/users/afischer211/repos","events_url":"https://api.github.com/users/afischer211/events{/privacy}","received_events_url":"https://api.github.com/users/afischer211/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-18T16:07:14Z","updated_at":"2015-05-18T17:03:04Z","closed_at":null,"body":"I have a channel with OSGi-artifacts deployed from tycho or from other sources (so with p2 metadata and without).\r\nFor a clear situation I have added the two aspects \"P2 Metadata Generator\" and \"Tycho Cleaner\". I want to ensure, that Package Drone generates the needed informations itself.\r\nThis works so long, until I try to add artifacts with same metainformations. Then I get errors like this:\r\n\r\nCaused by: org.eclipse.persistence.exceptions.DatabaseException:\r\nInternal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`pd`.`ARTIFACTS`, CONSTRAINT `ARTIFACTS_ibfk_2` FOREIGN KEY (`PARENT`) REFERENCES `ARTIFACTS` (`ID`) ON DELETE CASCADE)\r\nError Code: 1452\r\nCall: INSERT INTO ARTIFACTS (ID, AGR_NUM_ERR, AGR_NUM_WARN, CREATION_TS, NAME, SIZE, CHANNEL_ID, PARENT, `TYPE`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\r\n        bind => [9 parameters bound]\r\n\r\n\r\ncom.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`pd`.`ARTIFACTS`, CONSTRAINT `ARTIFACTS_ibfk_2` FOREIGN KEY (`PARENT`) REFERENCES `ARTIFACTS` (`ID`) ON DELETE CASCADE)\r\n\r\nHow can I solve this problems? Without the aspect \"P2 Metadata Generator\" this problems does not occur. But than I have an nearly empty content.xml and artifacts.xml for the channel/p2-repository (no enlisted artifacts). So Tycho can not find the artifacts in the repository.\r\n"},"comment":{"url":"https://api.github.com/repos/ctron/package-drone/issues/comments/103131077","html_url":"https://github.com/ctron/package-drone/issues/88#issuecomment-103131077","issue_url":"https://api.github.com/repos/ctron/package-drone/issues/88","id":103131077,"user":{"login":"afischer211","id":4056990,"avatar_url":"https://avatars.githubusercontent.com/u/4056990?v=3","gravatar_id":"","url":"https://api.github.com/users/afischer211","html_url":"https://github.com/afischer211","followers_url":"https://api.github.com/users/afischer211/followers","following_url":"https://api.github.com/users/afischer211/following{/other_user}","gists_url":"https://api.github.com/users/afischer211/gists{/gist_id}","starred_url":"https://api.github.com/users/afischer211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afischer211/subscriptions","organizations_url":"https://api.github.com/users/afischer211/orgs","repos_url":"https://api.github.com/users/afischer211/repos","events_url":"https://api.github.com/users/afischer211/events{/privacy}","received_events_url":"https://api.github.com/users/afischer211/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T17:03:04Z","updated_at":"2015-05-18T17:03:04Z","body":"Some more informations:\r\npackage-drone 0.8.1 with MySQL 5.1 and filesystem-storage for BLOBs\r\nchannel with following aspects:\r\n- Eclipse Source Bundle\r\n- OSGi\r\n- P2 Metadata Generator\r\n- P2 Repository\r\n- Tycho Cleaner\r\n- Cleanup Channel\r\n- Core Information\r\n- Hasher\r\n- Mime\r\n\r\n![image](https://cloud.githubusercontent.com/assets/4056990/7685478/e7177532-fd8e-11e4-8991-2c7a7fa2be39.png)\r\n\r\nCleanup-Configuration:\r\n![image](https://cloud.githubusercontent.com/assets/4056990/7685504/0d205c58-fd8f-11e4-9495-4877d61a3427.png)\r\n\r\nUse the example-project of issue #85 and run deployment 3x quickly in series\r\n(**`mvn clean deploy -DaltDeploymentRepository=pdrone::default::http://...`**)\r\nTwo times it works, on third run it fails with server-error 500 on Maven-side. The console-log of package-drone shows:\r\n\r\nWARN  o.e.jetty.servlet.ServletHandler [ServletHandler.java:620]\r\njavax.servlet.ServletException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.DatabaseException\r\nInternal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`pd`.`ARTIFACTS`, CONSTRAINT `ARTIFACTS_ibfk_2` FOREIGN KEY (`PARENT`) REFERENCES `ARTIFACTS` (`ID`) ON DELETE CASCADE)\r\nError Code: 1452\r\nCall: INSERT INTO ARTIFACTS (ID, AGR_NUM_ERR, AGR_NUM_WARN, CREATION_TS, NAME, SIZE, CHANNEL_ID, PARENT, `TYPE`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\r\n        bind => [9 parameters bound]\r\nQuery: InsertObjectQuery(de.dentrassi.pm.storage.jpa.VirtualArtifactEntity@570d9d7)\r\n        at de.dentrassi.pm.maven.internal.MavenServlet.doPut(MavenServlet.java:219) ~[de.dentrassi.pm.maven_1.0.0.20150513-1125.jar:na]\r\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ~[javax.servlet-api_3.1.0.jar:3.1.0]\r\n        at de.dentrassi.pm.storage.service.servlet.AbstractStorageServiceServlet.service(AbstractStorageServiceServlet.java:85) ~[de.dentrassi.pm.storage.service_1.0.0.20150508-1435.jar:na]\r\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api_3.1.0.jar:3.1.0]\r\n        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) ~[na:na]\r\n        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587) [org.eclipse.jetty.servlet_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [org.eclipse.jetty.security_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [org.eclipse.jetty.servlet_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.Server.handle(Server.java:497) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) [org.eclipse.jetty.server_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [org.eclipse.jetty.io_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [org.eclipse.jetty.util_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [org.eclipse.jetty.util_9.2.9.v20150224.jar:9.2.9.v20150224]\r\n        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]\r\nCaused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.DatabaseException\r\nInternal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`pd`.`ARTIFACTS`, CONSTRAINT `ARTIFACTS_ibfk_2` FOREIGN KEY (`PARENT`) REFERENCES `ARTIFACTS` (`ID`) ON DELETE CASCADE)\r\nError Code: 1452\r\nCall: INSERT INTO ARTIFACTS (ID, AGR_NUM_ERR, AGR_NUM_WARN, CREATION_TS, NAME, SIZE, CHANNEL_ID, PARENT, `TYPE`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\r\n        bind => [9 parameters bound]\r\nQuery: InsertObjectQuery(de.dentrassi.pm.storage.jpa.VirtualArtifactEntity@570d9d7)\r\n        at de.dentrassi.pm.storage.service.jpa.LockManager.act(LockManager.java:87) ~[na:na]\r\n        at de.dentrassi.pm.storage.service.jpa.LockManager.modifyCall(LockManager.java:63) ~[na:na]\r\n        at de.dentrassi.pm.storage.service.jpa.StorageServiceImpl.internalCreateArtifact(StorageServiceImpl.java:203) ~[na:na]\r\n        at de.dentrassi.pm.storage.service.jpa.StorageServiceImpl.createArtifact(StorageServiceImpl.java:198) ~[na:na]\r\n        at de.dentrassi.pm.storage.service.jpa.ChannelImpl.createArtifact(ChannelImpl.java:124) ~[na:na]\r\n        at de.dentrassi.pm.maven.internal.MavenServlet.storeArtifact(MavenServlet.java:509) ~[de.dentrassi.pm.maven_1.0.0.20150513-1125.jar:na]\r\n        at de.dentrassi.pm.maven.internal.MavenServlet.processUpload(MavenServlet.java:284) ~[de.dentrassi.pm.maven_1.0.0.20150513-1125.jar:na]\r\n        at de.dentrassi.pm.maven.internal.MavenServlet.processPut(MavenServlet.java:246) ~[de.dentrassi.pm.maven_1.0.0.20150513-1125.jar:na]\r\n        at de.dentrassi.pm.maven.internal.MavenServlet.doPut(MavenServlet.java:211) ~[de.dentrassi.pm.maven_1.0.0.20150513-1125.jar:na]\r\n\r\nMay be the cleanup-aspect is not quickly enough? Or we have in general a problem with multiple deployment of the same artifact? But then the second or third deployment-run should be ignored by the repository."}}