I just updated my Ubuntu server and I kept a blank page in Drupal with this message:

The website encountered an unexpected error. Please try again later.

What should I do ?

Type 	php
Date 	Mardi, 23 juillet, 2019 - 01:25
User 	administrateur
Emplacement 	https://www.example.com/fr/article
Référent 	
Message 	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 'member ON member.entity_id = thread.id AND member.members_target_id = '1' JOIN g' at line 1: SELECT COUNT(DISTINCT thread.id) FROM {private_messages} AS message JOIN {private_message_thread__private_messages} AS thread_message ON message.id = thread_message.private_messages_target_id JOIN {private_message_threads} AS thread ON thread_message.entity_id = thread.id JOIN {private_message_thread__members} AS member ON member.entity_id = thread.id AND member.members_target_id = :uid JOIN {private_message_thread__last_access_time} AS last_access ON last_access.entity_id = thread.id JOIN {pm_thread_access_time} as access_time ON access_time.id = last_access.last_access_time_target_id AND access_time.owner = :uid AND access_time.access_time <= thread.updated WHERE thread.updated > :timestamp AND message.created > :timestamp AND message.owner <> :uid; Array ( [:uid] => 1 [:timestamp] => 1563519558 ) dans Drupal\private_message\Mapper\PrivateMessageMapper->getUnreadThreadCount() (ligne 266 de /var/www/www-example-com/web/modules/contrib/private_message/src/Mapper/PrivateMessageMapper.php).
Severity 	Erreur

If I disable the Private Message notification block, the site works.

Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Issue summary: View changes
zenimagine’s picture

I am currently in version 8.0.17 which does not work with private message. I need to go back to version 8.0.16 for not having this bug.

ravi.shankar’s picture

Status: Active » Needs review
StatusFileSize
new4.5 KB

This patch will fix this issue.

anmolgoyal74’s picture

zenimagine
In the latest release of MySQL version 8.017, "member" is now a reserved keyword. Please review the patch.
Thanks Ravi for the patch.

zenimagine’s picture

Thank you, but impossible to apply the patch :

ubuntu@www-example-com /var/www/www-example-com $ composer update --with-dependencies
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
- Installing drupal/private_message (dev-2.x c6ed8e9): Cloning c6ed8e955e from cache
- Applying patches for drupal/private_message
https://www.drupal.org/files/issues/2019-02-20/private_message-2985224-5... (The display of the path private messages is not correct)
https://www.drupal.org/files/issues/2019-07-26/3069507-4.patch (Fatal error since MySQL update)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2019-07-26/3069507-4.patch

phjou’s picture

Ok did the patch on the dev branch, tell me if it applies. I didn't test it.

zenimagine’s picture

@phjou Great, thanks, it works

  • anmolgoyal74 committed b370760 on 8.x-2.x authored by phjou
    Issue #3069507 by ravi.shankar, phjou, zenimagine: Fatal error since...
anmolgoyal74’s picture

Status: Needs review » Fixed

Thanks for the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

bajah1701’s picture

For some reason this patch didn't work for me. It says "Cannot apply patch"

bajah1701’s picture

Figured out why the patch didn't work. Apparently the maintainer added most of the changes made in the patch except the last one. line 254 still says member, whereas all the others were changed.