xwikisas / application-diagram

Create various types of diagrams using draw.io
GNU Lesser General Public License v2.1
0 stars 8 forks source link

Random attachment error in XWiki console while saving a Diagram page #166

Open oanalavinia opened 4 years ago

oanalavinia commented 4 years ago

Steps to reproduce:

  1. Create a new Diagram with elements inside
  2. Edit it multiple times and click "Save and continue"
  3. Observe the XWiki console

Expected result There are no errors

Actual result Some errors are sometimes printed at saving step

2020-07-22 14:03:40,610 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment xwiki:Diagram.1.WebHome@diagram.png] 
com.xpn.xwiki.XWikiException: Error number 3231 in 3: Exception while loading attachment Attachment xwiki:Diagram.1.WebHome@diagram.png
    at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.loadAttachmentContent(XWikiHibernateAttachmentStore.java:255)
    at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1018)
    at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:850)
    at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getContentAsText(AbstractSolrMetadataExtractor.java:506)
    at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachment(DocumentSolrMetadataExtractor.java:281)
    at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachments(DocumentSolrMetadataExtractor.java:261)
    at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setExtras(DocumentSolrMetadataExtractor.java:187)
    at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setFieldsInternal(DocumentSolrMetadataExtractor.java:135)
    at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:133)
    at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:504)
    at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:411)
    at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:377)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xpn.xwiki.doc.XWikiAttachmentContent#1396330618]
    at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:435)
    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:233)
    at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
    at org.hibernate.impl.SessionImpl.load(SessionImpl.java:974)
    at com.xpn.xwiki.store.XWikiHibernateAttachmentStore.loadAttachmentContent(XWikiHibernateAttachmentStore.java:242)
    ... 12 common frames omitted

However, the diagram is saved correctly.

Tested with XWiki version 9.11, Diagram Application version 1.15.1 (reproduced starting with 1.13)

ilieandriuta commented 1 year ago

It seems I reproduced the issue too on Diagram 1.17.3 (XWiki 14.9/ Edge 107/ PostgreSQL 15/ Tomcat 9.0.68), but the stacktrace is the following:

2022-11-15 15:44:01,282 [XWiki Solr index thread] ERROR .DocumentSolrMetadataExtractor - Failed to retrieve the content of attachment [Attachment xwiki:Diagram.Diag2.WebHome@diagram.png]
com.xpn.xwiki.XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:Diagram.Diag2.WebHome@diagram.png] (file D:\Win 10 Backup\LUCRU_D\TOMCAT_HOME 9.0.68 - 14.9 PostgreSQL\work\Catalina\localhost\xwiki\store\file\xwiki\5\b\665e2f238296e97f3b25cd2b75d1e0\attachments\7\a\159a536f47c017eb492297bb45c270\f.png) could not be found in the filesystem attachment store.
        at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.loadAttachmentContent(FilesystemAttachmentStore.java:214)
        at com.xpn.xwiki.doc.XWikiAttachment.loadAttachmentContent(XWikiAttachment.java:1107)
        at com.xpn.xwiki.doc.XWikiAttachment.reloadAttachmentContent(XWikiAttachment.java:931)
        at com.xpn.xwiki.doc.XWikiAttachment.getContentInputStream(XWikiAttachment.java:909)
        at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getContentAsText(AbstractSolrMetadataExtractor.java:524)
        at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachment(DocumentSolrMetadataExtractor.java:333)
        at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setAttachments(DocumentSolrMetadataExtractor.java:313)
        at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setExtras(DocumentSolrMetadataExtractor.java:239)
        at org.xwiki.search.solr.internal.metadata.DocumentSolrMetadataExtractor.setFieldsInternal(DocumentSolrMetadataExtractor.java:152)
        at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:166)
        at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:510)
        at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:419)
        at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:384)
        at java.base/java.lang.Thread.run(Thread.java:833)
snazare commented 2 months ago

@ane-gabriela could you please let us know if you reproduce this issue on xwiki 14.10 with the latest version of the app? thank you!

ane-gabriela commented 2 months ago

@snazare Hi! Just tested locally on XWiki 14.10, Chrome 127, Diagram Application (Pro) 1.20.5, Windows 11 Pro and I only get this warnings in the XWiki console

2024-08-07 17:57:51,146 [qtp1295083508-688 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.svg?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:57:51,146 [qtp1295083508-688 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.svg?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:57:51,444 [qtp1295083508-428 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.png?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:57:51,445 [qtp1295083508-428 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.png?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:57:51,667 [qtp1295083508-688 - http://localhost:8080/xwiki/bin/preview/Diagram/Diagram%201/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:57:51,667 [qtp1295083508-688 - http://localhost:8080/xwiki/bin/preview/Diagram/Diagram%201/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:58:00,551 [qtp1295083508-945 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.svg?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:58:00,551 [qtp1295083508-945 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.svg?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:58:00,853 [qtp1295083508-428 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.png?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:58:00,853 [qtp1295083508-428 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.png?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:58:01,094 [qtp1295083508-945 - http://localhost:8080/xwiki/bin/preview/Diagram/Diagram%201/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:58:01,095 [qtp1295083508-945 - http://localhost:8080/xwiki/bin/preview/Diagram/Diagram%201/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:58:08,160 [qtp1295083508-937 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.svg?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:58:08,160 [qtp1295083508-937 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.svg?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:58:08,447 [qtp1295083508-938 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.png?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:58:08,447 [qtp1295083508-938 - http://localhost:8080/xwiki/bin/delattachment/Diagram/Diagram%201/WebHome/diagram.png?form_token=Oz1AbWRt6nQtTBdvgVTCNQ&xredirect=%2Fxwiki%2Fbin%2Fget%2FDiagram%2FDiagram%25201%2F%3FoutputSyntax%3Dplain] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
2024-08-07 17:58:08,659 [qtp1295083508-937 - http://localhost:8080/xwiki/bin/preview/Diagram/Diagram%201/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Warning Code: -1100, SQLState: 02000
2024-08-07 17:58:08,659 [qtp1295083508-937 - http://localhost:8080/xwiki/bin/preview/Diagram/Diagram%201/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - no data
oanalavinia commented 2 months ago

Hi @ane-gabriela ! Thank you! These warnings are known https://github.com/xwikisas/application-diagram/issues/145