Hi there,
I have been adding content from an old HTML site to my Drupal 8.1.8 install and added sever hundered pages. Suddenly I get a error message "The website encountered an unexpected error. Please try again later." for any page node add ( but not node/add/article)

Logs give warning and two error messages
Warning: Error while sending QUERY packet. PID=1366 in Drupal\Core\Database\Statement->execute() (line 59 of /var/www/vhosts/esp.andalucia.ws/httpdocs/core/lib/Drupal/Core/Database/Statement.php).

and

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: CREATE TABLE {cache_menu} ( `cid` VARCHAR(255) BINARY CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.', `data` LONGBLOB NULL DEFAULT NULL COMMENT 'A collection of data to cache.', `expire` INT NOT NULL DEFAULT 0 COMMENT 'A Unix timestamp indicating when the cache entry should expire, or -1 for never.', `created` DECIMAL(14, 3) NOT NULL DEFAULT 0 COMMENT 'A timestamp with millisecond precision indicating when the cache entry was created.', `serialized` SMALLINT NOT NULL DEFAULT 0 COMMENT 'A flag to indicate whether content is serialized (1) or not (0).', `tags` LONGTEXT NULL DEFAULT NULL COMMENT 'Space-separated list of cache tags for this entry.', `checksum` VARCHAR(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The tag invalidation checksum when this entry was saved.', PRIMARY KEY (`cid`), INDEX `expire` (`expire`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Storage for the cache API.'; Array ( ) in Drupal\Core\Menu\MenuTreeStorage->loadTreeData() (line 848 of /var/www/vhosts/esp.andalucia.ws/httpdocs/core/lib/Drupal/Core/Menu/MenuTreeStorage.php).

and

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: CREATE TABLE {cache_config} ( `cid` VARCHAR(255) BINARY CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.', `data` LONGBLOB NULL DEFAULT NULL COMMENT 'A collection of data to cache.', `expire` INT NOT NULL DEFAULT 0 COMMENT 'A Unix timestamp indicating when the cache entry should expire, or -1 for never.', `created` DECIMAL(14, 3) NOT NULL DEFAULT 0 COMMENT 'A timestamp with millisecond precision indicating when the cache entry was created.', `serialized` SMALLINT NOT NULL DEFAULT 0 COMMENT 'A flag to indicate whether content is serialized (1) or not (0).', `tags` LONGTEXT NULL DEFAULT NULL COMMENT 'Space-separated list of cache tags for this entry.', `checksum` VARCHAR(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The tag invalidation checksum when this entry was saved.', PRIMARY KEY (`cid`), INDEX `expire` (`expire`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Storage for the cache API.'; Array ( ) in Drupal\Core\Config\CachedStorage->readMultiple() (line 105 of /var/www/vhosts/esp.andalucia.ws/httpdocs/core/lib/Drupal/Core/Config/CachedStorage.php).

Anybody have any ideas?

Thanks

Comments

VM’s picture

did you verify that the MySQL server is running? Do you have the ability to restart the MySQL server?

chrischaplow’s picture

Yes, other pages on the site can be accessed and in PLESK Database servers it seems to be running ok, I also did a db rebuild check and it came back with a no errors found message. Thanks.

chrischaplow’s picture

I added the three lines below to my.cnf file and then restarted MariaDB at command line.
The error remains.

I know there a long list of possible causes but for me the strange things are
Error response is inmediate, no long waiting for a time out.
Other websites on server are ok.
One can create and article on this site, but not a page.

VM’s picture

those settings not already being included in the my.cnf file would make me locate all my.cnf files in the environment to make sure I was editing the file being used.

chrischaplow’s picture

Thanks

I read the articles and it seems the favourite option is to use the following setting in the my.cnf file.

max_allowed_packet = 16M
wait_timeout = 1800
connect_timeout = 120

I tracked down the file and it does not have any of these settings at all.
Do I just add the lines and restart the msql server, or do I have to preceed the lines with something else?