Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-14765

Statistics fail to track some stats on MSSQL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • 9.6, 9.8
    • Statistics
    • Windows Server 2012 R2, Jetty-9.4.6.v20170531, MSSQL Express 2012
    • Unknown
    • N/A
    • N/A

    Description

      The statistic app fails to properly track visits to our XWiki running with MSSQL.

      I'm aware that MSSQL is not officially supported but would appreciate if someone has the time to take a short look at it. I'll try to cross check on another DB in the coming days.

      This is what I could get from logs:

      2017-10-04 21:35:19,233 [Statistics storing daemon] WARN  o.h.u.JDBCExceptionReporter    - SQL Error: 8115, SQLState: S0002 
      
      2017-10-04 21:35:19,233 [Statistics storing daemon] ERROR o.h.u.JDBCExceptionReporter    - Arithmetischer Überlauffehler beim Konvertieren von expression in den int-Datentyp. 
      
      2017-10-04 21:35:19,233 [Statistics storing daemon] ERROR .x.x.s.i.x.VisitStatsStoreItem - Failed to save visit statistics object [class com.xpn.xwiki.stats.impl.xwiki.VisitStatsStoreItem XWiki.admin fe80:0:0:0:f5d0:2313:5755:d0e%12Mozilla/5.0 (Windows NT 6.3; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0 CSE8KULNCEZYOWPOEKIJ83BDZYAICRSE] 
      
      com.xpn.xwiki.XWikiException: Error number 3211 in 3: Exception while saving object XWiki.admin
      
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiCollection(XWikiHibernateStore.java:1260)
      
      	at com.xpn.xwiki.stats.impl.xwiki.VisitStatsStoreItem.storeInternal(VisitStatsStoreItem.java:102)
      
      	at com.xpn.xwiki.stats.impl.xwiki.AbstractStatsStoreItem.store(AbstractStatsStoreItem.java:93)
      
      	at com.xpn.xwiki.stats.impl.xwiki.XWikiStatsStoreService.register(XWikiStatsStoreService.java:172)
      
      	at com.xpn.xwiki.stats.impl.xwiki.XWikiStatsStoreService.runInternal(XWikiStatsStoreService.java:124)
      
      	at com.xpn.xwiki.util.AbstractXWikiRunnable.run(AbstractXWikiRunnable.java:133)
      
      	at java.lang.Thread.run(Thread.java:748)
      
      Caused by: org.hibernate.HibernateException: Failed to commit or rollback transaction. Root cause []
      
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:1056)
      
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiCollection(XWikiHibernateStore.java:1254)
      
      	... 6 common frames omitted
      
      Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [com.xpn.xwiki.stats.impl.VisitStats]
      
      	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
      
      	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2454)
      
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2874)
      
      	at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
      
      	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
      
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
      
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
      
      	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      
      	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
      
      	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
      
      	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
      
      	at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
      
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:1048)
      
      	... 7 common frames omitted
      
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Arithmetischer Überlauffehler beim Konvertieren von expression in den int-Datentyp.
      
      	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1655)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:440)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:385)
      
      	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:191)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:166)
      
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:328)
      
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
      
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
      
      	at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
      
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2434)
      
      	... 18 common frames omitted
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            Pako Patrick Koska
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: