Unable to update from 8.6.13 to 8.7: "SQLSTATE[42000]: Syntax error or access violation"

Created on 7 May 2019, about 5 years ago
Updated 10 April 2023, about 1 year ago

Problem/Motivation

I am trying to update from 8.6.13 to 8.7.

When running the database updates, I am getting the following error:

> [notice] Update started: node_update_8700
> [error] Exception thrown while performing a schema update. SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL' at line 1: ALTER TABLE {node_field_data} CHANGE `uid` `uid` NOT NULL; Array
> (
> )
>
> [error] Update failed: node_update_8700

All the other update hooks ran successfully.

Server version: 10.1.38-MariaDB

Steps to reproduce

Proposed resolution

The proposed resolution was to wait until 8.7.2 was release, see #12.

Remaining tasks

If you are experiencing this problem, add a comment including the database and version you are using.
Determine if this is limited to MariaDB, or perhaps database not supplied with Drupal core.

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: outdated

Version

9.4

Component
Node system 

Last updated about 10 hours ago

No maintainer
Created by

🇦🇺Australia Jadelvalia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India piyushc9r36

    "PHP message: Uncaught PHP Exception Drupal\Core\Database\DatabaseExceptionWrapper: "SQLSTATE[42000]: Syntax error or access violation: 1064 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 ') ORDER BY LENGTH(redirect_source__query) DESC' at line 1: SELECT rid FROM "redirect" WHERE hash IN () ORDER BY LENGTH(redirect_source__query) DESC; Array
    (
    )
    " at /var/www/www.hcltech.com/webroot/web/core/modules/mysql/src/Driver/Database/mysql... line 53" while reading response header from upstream

    Anyone please help

  • 🇧🇪Belgium jefw

    Related problem: after loading a backup from two days ago (software and DB), emptying the caches, waiting a few minutes, the website worked for about 10 minutes. Then we got this message on several tables (cache..., watchdog). We can repeat this unlimited. We can assume it's not a syntax error.
    Apache, drupal 9.5.5, PHP 8.1.17, MYSQL 5.7.40
    We are a senior club.
    Thanks in advance.

    The website encountered an unexpected error. Please try again later.
    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user '...............' for table 'watchdog': INSERT INTO "watchdog"

    The website encountered an unexpected error. Please try again later.
    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT, UPDATE command denied to user '................' for table 'cache_config': INSERT INTO "cache_config"

  • 🇧🇪Belgium jefw

    Related problem: after loading a backup from two days ago (software and DB), emptying the caches, waiting a few minutes, the website worked for about 10 minutes. Then we got this message on several tables (cache..., watchdog). We can repeat this unlimited. We can assume it's not a syntax error.
    Apache, drupal 9.5.5, PHP 8.1.17, MYSQL 5.7.40
    We are a senior club.
    Thanks in advance.

    The website encountered an unexpected error. Please try again later.
    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user '...............' for table 'watchdog': INSERT INTO "watchdog"

    The website encountered an unexpected error. Please try again later.
    Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT, UPDATE command denied to user '................' for table 'cache_config': INSERT INTO "cache_config"

Production build 0.69.0 2024