Drupal Menu Throws SQL Error - drupal

I have this weird problem with Drupal Menus. When I try to add a link to any drupal menu, it throws the following SQL exception. I can create a new menu or delete an existing one, but I can't add any links :-) Any help?
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => tr [:source] => Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters. [:context] => ) in locale() (line 684 of /home/predra/public_html/modules/locale/locale.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:495:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => tr [:source] => Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters. [:context] => ) ";s:9:"%function";s:8:"locale()";s:5:"%file";s:53:"/home/predra/public_html/modules/locale/locale.module";s:5:"%line";i:684;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://predra.com/admin/structure/menu/manage/menu-header-menu/add [:db_insert_placeholder_7] => http://predra.com/doktor/haldun-san [:db_insert_placeholder_8] => 78.180.179.155 [:db_insert_placeholder_9] => 1348828684 ) in dblog_watchdog() (line 154 of /home/predra/public_html/modules/dblog/dblog.module).

Please change max_allowed_packet to 20M or more in mysql\bin\my.ini (depends on your mysql server config path.)
It works!

Related

COMMERCE ORDER - PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Here is my error message
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when
trying to get lock; try restarting transaction:
UPDATE {commerce_order} SET
order_number=:db_update_placeholder_0, revision_id=:db_update_placeholder_1,
type=:db_update_placeholder_2, uid=:db_update_placeholder_3,
mail=:db_update_placeholder_4, status=:db_update_placeholder_5,
created=:db_update_placeholder_6, changed=:db_update_placeholder_7,
placed=:db_update_placeholder_8, hostname=:db_update_placeholder_9,
data=:db_update_placeholder_10 WHERE (order_id = :db_condition_placeholder_0) ;
Array ( [:db_update_placeholder_0] => 201805822 [:db_update_placeholder_1] => 16807
[:db_update_placeholder_2] => commerce_order [:db_update_placeholder_3] => 0
[:db_update_placeholder_4] => [:db_update_placeholder_5] => checkout_checkout
[:db_update_placeholder_6] => 1540480400 [:db_update_placeholder_7] =>
1540481979 [:db_update_placeholder_8] => 0 [:db_update_placeholder_9] =>
128.199.161.50 [:db_update_placeholder_10] => a:4:
{s:17:"last_cart_refresh";i:1540481976;s:16:"shipping_service";s:17:"shipping_custom|1";s:14:"with_backorder";s:0:"";s:17:"backorder_service";s:5:"_none";}
[:db_condition_placeholder_0] => 5056 ) in drupal_write_record() (line 7387 of ~/public_html/includes/common.inc).
anyone can help me? whats wrong with that things?
The best fix is changing your transaction isolation level (to READ COMMITTED).
Try adding this to your settings.php. It's a common problem in high read/write Drupal sites with many fields.
$databases['default']['default']['init_commands'] = array(
'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'"
);

Suddenly, google's API service says I'm in the wrong country

I have several analytics API calls
that have been performing great up until recently. Now,
I've tried two servers, with different IP's and get the same result from my
queries. The IP and Results are below.
Both servers are in the USA, and I've even filled out the form located here https://support.google.com/websearch/contact/ip with no change.
The server IP information: https://geoiptool.com/en/?ip=69.12.70.137
I've even tried a different PHP client, same result.
The error received:
Array
(
[http_code] => 403
[error] => Array
(
[errors] => Array
(
[0] => Array
(
[domain] => global
[reason] => countryBlocked
[message] => This service is not available from
your country
)
)
[code] => 403
[message] => This service is not available from your country
)
)
This should be fixed for your IP, 69.12.70.137. Sorry about the trouble!

Corrupt Drupal menu

Running Drupal 7.26 with nothing fancy and have started to encounter a corruption issue with the menu system. We started seeing the following error (truncated to fit). Doing a drush or a manual clear cache doesn't fix it, setting menu_router.weight to NULL yes, truncating both the menu_links and menu_router tables still produces the error. Links oddly menu still appear on the site, but only some not all.
I suspect that the issue might be caused by a page view (using views3) with a set path, but I can't see why that would be as it is again just a normal path.
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column
'weight' at row 9: INSERT INTO {menu_router} (path, load_functions, to_arg_functions,
access_callback, access_arguments, page_callback, page_arguments, delivery_callback, fit,
number_parts, context, tab_parent, tab_root, title, title_callback, title_arguments,
theme_callback, theme_arguments, type, description, position, weight, include_file) VALUES
.... (truncated) ....
(:db_insert_placeholder_184, :db_insert_placeholder_185, :db_insert_placeholder_186,
:db_insert_placeholder_187, :db_insert_placeholder_188, :db_insert_placeholder_189,
:db_insert_placeholder_190, :db_insert_placeholder_191, :db_insert_placeholder_192,
:db_insert_placeholder_193, :db_insert_placeholder_194, :db_insert_placeholder_195,
:db_insert_placeholder_196, :db_insert_placeholder_197,); Array (
.... (truncated) ....
[:db_insert_placeholder_180] => Ajax callback for view loading.
[:db_insert_placeholder_181] => [:db_insert_placeholder_182] => 0
[:db_insert_placeholder_183] => sites/all/modules/contrib/views/includes/ajax.inc
[:db_insert_placeholder_184] => volunteering/opportunities [:db_insert_placeholder_185] =>
[:db_insert_placeholder_186] => [:db_insert_placeholder_187] => ctools_access_menu
[:db_insert_placeholder_188] => a:1:{i:0;a:2:{s:4:"type";s:4:"none";s:8:"settings";N;}}
[:db_insert_placeholder_189] => page_manager_page_execute [:db_insert_placeholder_190] =>
a:1:{i:0;s:13:"volunteering_";} [:db_insert_placeholder_191] =>
[:db_insert_placeholder_192] => 3 [:db_insert_placeholder_193] => 2
[:db_insert_placeholder_194] => 0 [:db_insert_placeholder_195] =>
[:db_insert_placeholder_196] => volunteering/opportunities [:db_insert_placeholder_197] =>
Volunteering opportunities [:db_insert_placeholder_198] => t [:db_insert_placeholder_199]
=> [:db_insert_placeholder_200] => [:db_insert_placeholder_201] => a:0:{} ) in
_menu_router_save() (line 3837 of /var/mysite/dev/includes/menu.inc).
For some strange reason the function page_manager_list_page() in ctools page manager > page_manager.admin.inc wasn't setting a numeric weight. Not sure how or why it isn't checking it is not a an integer, but it doesn't which caused the issue.

Change prefix of tables once platform is installed

I'm working on a new website. A friend of mine configured Drupal 7 on our hosting service and we started to work. Unfortunately he forgot to add, during the setting phase, a prefix to Drupal standard tables.
Is it possible to change this configuration after having installed Drupal (in order to dont loose the work we have already done after the installation)?
I could do it via SQL code, but I guess that the platform will crash in this way because the code is generated according to the initial settings, right?
(PS: I dont have so much experience with Drupal).
Thanks!
I have similar issue, I found it is very easy to do this in phpmyadmin.
I assume your table prefix is "drupal_", and the target prefix is "new_"
step 1: login to phpmyadmin, chose your database;
step 2: under table list bottom , click "check all" checkbox;
step 3: select action "Replace table prefix";
step 4: Type "drupal_" into "From" and "new_" to "To", click "Go"
You can see the prefix was change to new_tablename
enjoy : )
oh, don't forget to change your settings.php:
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'prefix' => 'new_', // <-- add your prefix here
);
If you change the table names via SQL commands (add the prefix), you can set the prefix in your site's settings.php file. Assuming you have just one site, your settings.php file would be in your sites/default/ directory.
Look for your database configurations that would look something like the following and add your desired prefix:
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'prefix' => '', // <-- add your prefix here
);

Decrypting Drupal / Ubercart Credit Card Info Externally

Right now I have a simple PHP script outside of my drupal installation that just compiles a CSV for my client of orders and the credit card type (Visa, Mastercard..)
It seems like an older version of Drupal 6 just had this part of data serialized in the database "cc_card" however now it seems to be encrypted.
Is there a way to decrypt this data (Stored in us_orders.data) so that I could see the card type?
The uc_credit_cache() function should do what you want:
$order = uc_order_load($order_id);
$cc_data = uc_credit_cache('save', $order->data['cc_data'], TRUE);
$cc_data should look something like this:
Array
(
[cc_type] => visa
[cc_owner] =>
[cc_number] => 4111111111111111
[cc_start_month] =>
[cc_start_year] =>
[cc_exp_month] => 9
[cc_exp_year] => 2012
[cc_issue] =>
[cc_cvv] => 222
[cc_bank] =>
)

Resources