Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Publishing default hosts fails #6456

Closed
joseorsini opened this issue Sep 25, 2014 · 3 comments
Closed

Push Publishing default hosts fails #6456

joseorsini opened this issue Sep 25, 2014 · 3 comments

Comments

@joseorsini
Copy link
Contributor

Steps to reproduce:

  1. Set up a clean 2.5.6 Push Pub environment (using data from starter).
  2. Push demo.dotcms.com host to the receiver side.
  3. Once the host is pushed, go to the sender side and make m.demo.dotcms.com as default host.
  4. Push the m.demo.dotcms.com host to the receiver side.

Stacktrace from Receiver Side

[25/09/14 16:30:02:921 EDT] INFO handler.ContentHandler: : [BundleID: 4c40dfc6-aeee-4e22-a825-9a695a221177.tar.gz] Content published. Id: SYSTEM_HOST 
[25/09/14 16:30:02:926 EDT] WARN util.JDBCExceptionReporter: SQL Error: 0, SQLState: 23503 
[25/09/14 16:30:02:926 EDT] ERROR util.JDBCExceptionReporter: ERROR: insert or update on table "contentlet_version_info" violates foreign key constraint "fk_contentlet_version_info_working" 
  Detail: Key (working_inode)=(65095a4f-0bb3-4d5c-bb3a-d3cb77937db2) is not present in table "contentlet". 
[25/09/14 16:30:02:926 EDT] ERROR impl.SessionImpl: Could not synchronize database state with session 
[25/09/14 16:30:02:927 EDT] ERROR business.PublisherAPIImpl: Error Publishing Bundle: Unable to save/update Object to Hibernate Session 
com.dotcms.publishing.DotPublishingException: Unable to save/update Object to Hibernate Session 
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.a(SourceFile:247) 
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.handle(SourceFile:86) 
at com.dotcms.enterprise.publishing.remote.handler.HostHandler.handle(SourceFile:27) 
at com.dotcms.publisher.receiver.BundlePublisher.process(BundlePublisher.java:161) 
at com.dotcms.rest.PublishThread.run(PublishThread.java:40) 
at java.lang.Thread.run(Thread.java:744) 
Caused by: com.dotmarketing.exception.DotHibernateException: Unable to save/update Object to Hibernate Session 
at com.dotmarketing.db.HibernateUtil.saveOrUpdate(HibernateUtil.java:481) 
at com.dotmarketing.business.VersionableFactoryImpl.saveContentletVersionInfo(VersionableFactoryImpl.java:253) 
at com.dotmarketing.business.VersionableAPIImpl.saveContentletVersionInfo(VersionableAPIImpl.java:459) 
at com.dotcms.enterprise.publishing.remote.handler.ContentHandler.a(SourceFile:199) 
... 5 more 
Caused by: net.sf.hibernate.exception.ConstraintViolationException: could not update: [com.dotmarketing.portlets.contentlet.model.ContentletVersionInfo#com.dotmarketing.portlets.contentlet.model.ContentletVersionInfo@5474202c] 
at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:62) 
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) 
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331) 
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:681) 
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:621) 
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52) 
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) 
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) 
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2393) 
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261) 
at com.dotmarketing.db.HibernateUtil.saveOrUpdate(HibernateUtil.java:479) 
... 8 more 
Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "contentlet_version_info" violates foreign key constraint "fk_contentlet_version_info_working" 
  Detail: Key (working_inode)=(65095a4f-0bb3-4d5c-bb3a-d3cb77937db2) is not present in table "contentlet". 
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) 
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) 
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) 
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500) 
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388) 
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334) 
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) 
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) 
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:661) 
... 15 more 
[25/09/14 16:30:02:942 EDT] ERROR lang.String: Error Publishing: com.dotcms.publishing.DotPublishingException: Unable to save/update Object to Hibernate Session 
[25/09/14 16:30:02:942 EDT] INFO rest.PublishThread: : [BundleID: 4c40dfc6-aeee-4e22-a825-9a695a221177.tar.gz] Finished bundle publish process

From sender side:

dotcms256-sender=# select inode, identifier, title from contentlet where inode = '65095a4f-0bb3-4d5c-bb3a-d3cb77937db2';
                inode                 |              identifier              |      title      
--------------------------------------+--------------------------------------+-----------------
 65095a4f-0bb3-4d5c-bb3a-d3cb77937db2 | 48190c8c-42c4-46af-8d1a-0cd5db894797 | demo.dotcms.com
(1 row)

From receiver side:

dotcms256-receiver=# select inode, identifier, title from contentlet  where inode ='65095a4f-0bb3-4d5c-bb3a-d3cb77937db2';
 inode | identifier | title 
-------+------------+-------
(0 rows)
@jtesser
Copy link
Contributor

jtesser commented Sep 26, 2014

I think we fixed this already in 3.0 at least but we will test this morning.

@oarrietadotcms
Copy link
Contributor

I tested this one and works just fine in 3.0.

In 3.0 we don't have m.dotcms.com or shared anymore by default but I created a copy and pushed to the receiver, then I went to both databases and the inodes where in both receiver and sender.

@bryanboza
Copy link
Member

Fixed, tested on a Oct-07-2014 distribution // Oracle // Linux // Safari (OSX 10.9.4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants