com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'confluence.contentproperties' doesn't exist

Atlassian JIRA | Victor Teoh [Atlassian] | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    h3. *Environment* - *Only happens in Linux and not Windows* - Tested with MySQL - Oracle DB h3. *Steps to reproduce* # Install Confluence 5.10 with MySQL # Go to Confluence Administration >> Scheduled Jobs and run the "Synchronise Unreconciled Content". # You'll find these errors in the atlassian-confluence.log {code:java} 2016-06-21 00:00:00,114 ERROR [scheduler_Worker-3] [plugins.synchrony.job.ContentReconciliationJob] lambda$getDraftContentRequiringReconciliation$3 Error querying for content marked as requiring content reconciliation com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'confluence.contentproperties' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 2016-06-28 00:00:00,231 ERROR [scheduler_Worker-6] [org.quartz.core.JobRunShell] run Job com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin.contentReconciliationJob threw an unhandled Exception: java.lang.NullPointerException at com.atlassian.confluence.plugins.synchrony.job.ContentReconciliationJob.execute(ContentReconciliationJob.java:63) at com.atlassian.confluence.plugin.descriptor.JobModuleDescriptor$DelegatingPluginJob.lambda$execute$0(JobModuleDescriptor.java:112) at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:82) at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:72) at com.atlassian.confluence.plugin.descriptor.JobModuleDescriptor$DelegatingPluginJob.execute(JobModuleDescriptor.java:111) at org.quartz.core.JobRunShell.run(JobRunShell.java:223) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool.lambda$runInThread$0(ConfluenceQuartzThreadPool.java:16) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) {code} h3. *Cause* The {{ContentReconciliationJob.java}} which involves {{com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin.contentReconciliationJob}} code shows : {code:java} 58: public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { 59: 60: 61: 62: List<Long> draftIds = getDraftContentRequiringReconciliation(); 63: log.info("Found {} items requiring content reconciliation", draftIds.size()); 64: 65: ThreadLocalCache.init(); //Needed for permissionManager.withExemption to work through all calls, including generating the JWT token without a user 66: 67: draftIds.stream().forEach(draftId -> { 68: permissionManager.withExemption(() -> 69: transactionTemplate.execute(() -> performReconciliationOnContent(draftId)) 70: ); 71: 72: ThreadLocalCache.flush(); 73: }); 74: 75: ThreadLocalCache.dispose(); 76: 77: log.info("Content reconciliation job finished"); 78: } {code} The problematic line can be found below where it try to find the draft directly from the contentproperties table: {code:java} 80: private List<Long> getDraftContentRequiringReconciliation() { 81: final TransactionalExecutor transactionExecutor = transactionalExecutorFactory 82: .createExecutor() 83: .readOnly() 84: .newTransaction(); 85: 86: return transactionExecutor.execute(connection -> { 87: try { 88: PreparedStatement preparedStatement = connection.prepareStatement("" + 89: "SELECT DISTINCT content.contentid, content.lastmoddate " + 90: "FROM contentproperties properties, content content " + 91: "WHERE content.contentid = properties.contentid " + 92: "AND properties.propertyname = 'sync-rev-source' " + 93: "AND properties.stringval = 'fallback' " + 94: "AND content.content_status = 'draft' " + 95: "ORDER BY content.lastmoddate " +96 "LIMIT 1000"); 96: ResultSet resultSet = preparedStatement.executeQuery(); 97: 98: List<Long> draftIds = new ArrayList<>(); 99: while (resultSet.next()) { 100: draftIds.add(resultSet.getLong(1)); 101: } 102: return draftIds; 103: } catch (SQLException e) { 104: log.error("Error querying for content marked as requiring content reconciliation", e); 105: return null; 106: } 107: }); 108: } {code} The MySQL table in Linux is case sensitive, hence the {{CONTENTPROPERTIES}} table is in capital casing but the Reconciliation Job is querying the lower case table of {{contentproperties}}. *This error does not show in Windows because it is case insensitive.* h3. *Workaround* # Disable the Synchronise Unreconciled Content Scheduled Jobs # Then, go to Confluence Administration >> Manage add-ons and search for {{Confluence Collaborative Editor Plugin}} under System filters and disable it.

    Atlassian JIRA | 8 months ago | Victor Teoh [Atlassian]
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'confluence.contentproperties' doesn't exist
  2. 0

    GitHub comment 36#217539531

    GitHub | 10 months ago | danveno
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect table name 'Plant_habitat_Spring2016_jin_mao_20160506123553_web_grouped_terms'
  3. 0

    MySQL query syntax error, corresponds to your MySQL server version for the right syntax, while ordering table by name

    Stack Overflow | 4 years ago | Hallaz
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from Makanan p where p.name='sego kucing'' at line 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    org.hibernate.util.JDBCExceptionReporter - Unknown column 'postalCode' in 'field list'

    Stack Overflow | 5 years ago | Zach
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'postalCode' in 'field list'
  6. 0

    JDBC SQL Exception: query executes correctly on the MySQL prompt but gives error in java

    Stack Overflow | 4 years ago | user2524652
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

      Table 'confluence.contentproperties' doesn't exist

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0()
    2. Java RT
      DelegatingConstructorAccessorImpl.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      3 frames