drupal views module mysql error - mysql

i have enabled the view module and get this when i go to structure>views in drupal 7
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {cache_form} WHERE (cid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => form_form-MKcd7j8VJkLHaG7-JGW-vREo_XeUngdnLcqlKOn-02o ) in cache_clear_all() (line 170 of /home/tennis/public_html/includes/cache.inc).
Additional
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:240:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {cache_form} WHERE (cid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => form_form-MKcd7j8VJkLHaG7-JGW-vREo_XeUngdnLcqlKOn-02o ) ";s:9:"%function";s:17:"cache_clear_all()";s:5:"%file";s:43:"/home/tennis/public_html/includes/cache.inc";s:5:"%line";i:170;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://192.168.1.66/~tennis/admin/structure/views [:db_insert_placeholder_7] => http://192.168.1.66/~tennis/user/1 [:db_insert_placeholder_8] => 192.168.1.172 [:db_insert_placeholder_9] => 1309366098 ) in dblog_watchdog() (line 155 of /home/tennis/public_html/modules/dblog/dblog.module).
what maybe my issue?

Here is some information on that error: http://dev.mysql.com/doc/refman/5.1/en/gone-away.html and a similar issue on Drupal.org: http://drupal.org/node/984112
Another helpful post regarding this error: http://madhavvyas.blogspot.com/
It seems that the problem lies with max_allowed_packet in the configuration for MySQL.
From the Drupal issue, another user provides some steps that may assist you (this user is using XAMPP but steps are similar):
How to fix this problem
Go to xampp\mysql\bin
Open my.ini
Change "max_allowed_packet" from "1m" to "16m" (or larger)
Save my.ini Now restart MySql through the XAMPP control panel.

Related

Prestashop: 'Link to database cannot be established'

This is our first time moving a Prestashop Installation from one Domain to another and it has been one hell of a learning curve.
Steps we have taken so far:
Copied the database:
0) New database name: gamingco_ps, user gamingco_ps1
Changed ps_configuration
Changed the ps_shop_url (Domain/Domain SSL)
Amended htcacess to stop any redirects
CPANEL removed all temporary redirects
Changed the /home/gamingco/public_html/app/config/parameters.php :
<?php return array (
'parameters' =>
array (
'database_host' => 'localhost',
'database_port' => '',
'database_name' => 'gamingco_ps',
'database_user' => 'gamingco_ps1',
'database_password' => '{Password}',
'database_prefix' => 'pswy_',
'database_engine' => 'InnoDB',
'mailer_transport' => 'smtp',
'mailer_host' => '127.0.0.1',
'mailer_user' => NULL,
'mailer_password' => NULL,
'secret' => 'dva3atuoqjpqhb8xmjtfwjszkpbwaifombdlbg46qwygbi7e4mpyfgui',
'ps_caching' => 'CacheMemcache',
'ps_cache_enable' => false,
'ps_creation_date' => '2021-01-27',
'locale' => 'en-US',
'use_debug_toolbar' => true,
'cookie_key' => 'zml9yqgynwgixtb1e4c0xh8q8gjeynsp7arnovqw5dhpcthcyfpu89bx',
'cookie_iv' => 'qsembkbmpfbnk5bf3hhxjg3sw1laaa06',
'new_cookie_key' => 'def00000acce4699cd116debb37dc5533dfd6ff201153a61ac3446801d772207548a0f44596a7a01939e9f753e4290f3735373a25516e62b2118322ec7f7cd64e3b347ee',
),
);
We are now receiving error 500 without debug mode and with debugmode we are met with:
Link to database cannot be established: SQLSTATE[28000] [1045] Access denied for user 'gamingco_ps1'#'localhost' (using password: YES)
at line 136 in file classes/db/DbPDO.php
131. public function connect()
132. {
133. try {
134. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
135. } catch (PDOException $e) {
136. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
137. }
138.
139. $this->link->exec('SET SESSION sql_mode = \'\'');
140.
141. return $this->link;```
DbPDOCore->connect - [line 330 - classes/db/Db.php]
DbCore->__construct - [line 241 - classes/db/Db.php] - [4 Arguments]
DbCore::getInstance - [line 47 - config/alias.php]
pSQL - [line 1336 - classes/shop/Shop.php] - [1 Arguments]
ShopCore::findShopByHost - [line 337 - classes/shop/Shop.php] - [1 Arguments]
ShopCore::initialize - [line 118 - config/config.inc.php]
require - [line 27 - index.php] - [1 Arguments]
I gone through all the steps again and I cannot seem to identify where the error maybe.
Error is pretty straighforward here, Prestashop cannot connect to database.
Things to check:
Make sure your var/cache/prod directory does not contain any cache file from previous installation as it can lead to old DB connection with old credentials.
Double check DB data in parameters.php, carefully look for data correctness (case sensitive, correct DB host / port etc.)
If none of above helps, try connecting your box from ssh and check direct db connection from there with :
mysql -u{username} -p{password} {database name}
and post the result.

Use of undefined constant SIGKILL - assumed 'SIGKILL' in Laravel 5.7 queue

I'm getting this error "Use of undefined constant SIGKILL - assumed 'SIGKILL'" from my AJAX request, that starts this artisan command ->
Artisan::call('queue:work', [
'connection' => 'database',
'--memory' => '700',
'--tries' => '1',
'--timeout' => '35000',
'--queue' => 'updates'
]);
I'm using Laravel 5.7 as framework for application.
Jobs are managed from database, configuration ->
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 18000,
],
Problem appeared recently.. That is weird, because troubles wasn't here before and all this "system" worked just fine. Now worker get some jobs done just fine, but then it drops to error, and writes to table "failed_jobs" in DB this ->
ErrorException: PDOStatement::execute(): MySQL server has gone away in /srv/migration-xxxxxx-xxxx-xxxxxx/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458
As DB I'm using Microsoft Azure MySQL DB. Microsoft specialist after consultation find nothing .. server is working correctly. Queries are just fine, not that big to fail.
Please help, don't know what to do, or what is wrong...

Drupal 7: SQLSTATE[23000] ERROR after installing module

after installing and activating "filter_harmonizer" I get the following SQL-error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'bartik-views-standorte-block' for key 'tmd': INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => views [:db_insert_placeholder_1] => standorte-block [:db_insert_placeholder_2] => bartik [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => -1 [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => -1 ) in drupal_write_record() (line 7166 of /is/htdocs/xyz/www/meineseite/includes/common.inc).
Now there is only one node displayed, the others couldn't be found by drupal.
On the admin pages there is the following error shown:
no administrationobjects available
Can anyoune help me how to solve the problem? I'm not an SQL-crack, so I need a bit more help.
Thanks a lot!

vagrant : chef_solo | how i can change log path from mysql server and mongodb?

I'm working with vagrant and chef .
As far as everything goes , only when I use the Logpath of mysql and mongodb change in the vagrant file , I get an error.
if anyone here has a tip and can help me would be happy.
In Vagrantfile I have stated so ...
:mysql => {
:server_root_password => 'password',
:server_debian_password => 'password',
:server_repl_password => 'password',
:allow_remote_root => true,
:log_dir => "/vagrant/www/logs/mysql",
:tunable => {
:log_slow_queries => "/vagrant/www/logs/mysql/slow.log",
:log_error => true,
:log_warnings => true
}
},
:mongodb => {
:logpath => "/vagrant/www/logs/mongodb"
},
================================================================================
Error executing action `create` on resource 'directory[/vagrant/www/logs/mysql]'
================================================================================
Errno::EPERM
------------
Operation not permitted - /vagrant/www/logs/mysql
Resource Declaration:
---------------------
# In /tmp/vagrant-chef/chef-solo-1/cookbooks/mysql/recipes/server.rb
117: directory path do
118: owner 'mysql' unless platform?('windows')
119: group 'mysql' unless platform?('windows')
120: action :create
121: recursive true
122: end
123: end
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef/chef-solo-1/cookbooks/mysql/recipes/server.rb:117:in `block in from_file'
directory("/vagrant/www/logs/mysql") do
provider Chef::Provider::Directory
action [:create]
retries 0
retry_delay 2
path "/vagrant/www/logs/mysql"
recursive true
cookbook_name :mysql
recipe_name "server"
owner "mysql"
group "mysql"
mode 493
end
[2013-10-31T01:03:09-07:00] DEBUG: Re-raising exception: Errno::EPERM - directory[/vagrant/www/logs/mysql] (mysql::server line 117) had an error: Errno::EPERM: Operation not permitted - /vagrant/www/logs/mysql
This line is the key problem: Operation not permitted - /vagrant/www/logs/mysql
which means it does not allow user to create directory under this path. Please check if user mysql is privileged to access directory /vagrant/www/logs. Maybe you need +x on /vagrant
First, I would not advise using this -- slow log writes will slow down most databases and I wouldn't want to do that to myself.
Anyhow, permissions on vagrant shared folders can be a bit tricky -- in some, if not many, cases you need to set owner / permission from the vagrantfile. This is a bit tricky for /vagrant but you could map another folder if you really don't want to vagrant ssh into the server to read the logs. To do so:
config.vm.synced_folder "logs", "/logs", :mount_options => ['dmode=777', 'fmode=777']
777 is probably overkill but you get the idea.

Drupal 7 PDOException: (possibly a max_packet_size issue?)

After saving a View i got this error come up on all pages in Drupal 7. After some research i think it's a problem with the "max allowed packet" in Mysql being set too low...currently 68MB. I have requested it be set to 250MB. But any further diagnosis of the problem would be welcomed.
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT format, type, language FROM {date_format_locale}; Array ( ) in system_date_format_locale() (line 3650 of /home/mysite/public_html/beta1/modules/system/system.module).
Additional
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:132:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT format, type, language FROM {date_format_locale}; Array ( ) ";s:9:"%function";s:27:"system_date_format_locale()";s:5:"%file";s:61:"/home/mysite/public_html/beta1/modules/system/system.module";s:5:"%line";i:3650;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://beta1.mysite.co.uk/ [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 83.244.234.228 [:db_insert_placeholder_9] => 1352306457 ) in dblog_watchdog() (line 157 of /home/mysite/public_html/beta1/modules/dblog/dblog.module).
Uncaught exception thrown in session handler.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 206 of /home/mysite/public_html/beta1/includes/session.inc).
thanks
lee
In order to fix this issue the guys at PlatinumServerManagement.com increased the wait-timeout value in mysql configuration file.
Lee