I am now getting mysql errors after updating ubercart to 6.x-2.4, and it has broken downloads. I need help asap.

Here are the errors:


Warning: MySQL server has gone away query: INSERT INTO drupal_watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:90:\"MySQL server has gone away\nquery: SELECT * FROM drupal_uc_files_s3 WHERE bid='1'\";s:5:\"%file\";s:96:\"/usr/home/client/Websites/example.com/sites/all/modules/uc_file_s3/uc_file_s3.module\";s:5:\"%line\";i:1308;}', 3, '', 'http://example.com/node/36/edit/features/file_s3/3', 'http://example.com/node/36/edit/features', '96.53.60.174', 1294350949) in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT * FROM drupal_system WHERE type = 'theme' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT data, created, headers, expire, serialized FROM drupal_cache WHERE cid = 'theme_registry:' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:7:{s:7:\"content\";a:1:{s:13:\"content_field\";O:8:\"stdClass\":3:{s:8:\"filename\";s:69:\"sites/all/modules/cck/includes/panels/content_types/content_field.inc\";s:8:\"basename\";s:17:\"content_field.inc\";s:4:\"name\";s:13:\"content_field\";}}s:6:\"ctools\";a:53:{s:16:\"vocabulary_terms\";O:8:\"stdClass\":3:{s:8:\"filename\";s:86:\"sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc\";s:8:\"basename\";s:20:\"vocabulary_terms.inc\";s:4:\"name\";s:16:\"vocabulary_terms\";}s:14:\"profile_fields\";O:8:\"stdClass\":3:{s:8:\"filename\";s:78:\"sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc\";s:8:\"basename\";s:18:\"profile_fields.inc\";s:4:\ in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:3:{s:6:\"ctools\";a:0:{}s:13:\"views_content\";a:0:{}s:6:\"panels\";a:4:{s:21:\"region_rounded_shadow\";O:8:\"stdClass\":3:{s:8:\"filename\";s:99:\"sites/all/modules/panels/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc\";s:8:\"basename\";s:25:\"region_rounded_shadow.inc\";s:4:\"name\";s:21:\"region_rounded_shadow\";}s:16:\"region_plain_box\";O:8:\"stdClass\":3:{s:8:\"filename\";s:89:\"sites/all/modules/panels/plugins/style_bases/region/region_plain_box/region_plain_box.inc\";s:8:\"basename\";s:20:\"region_plain_box.inc\";s:4:\"name\";s:16:\"region_plain_box\";}s:19:\"pane_rounded_shadow\";O:8:\"stdClass\":3:{s:8:\"filename\";s:93:\"sites/all/modules/panels/plugins/style_bases/pane/pane_ro in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SHOW TABLES LIKE 'drupal_date_format_types' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT * FROM drupal_system WHERE type = 'theme' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:2:{s:6:\"panels\";a:9:{s:14:\"twocol_stacked\";O:8:\"stdClass\":3:{s:8:\"filename\";s:74:\"sites/all/modules/panels/plugins/layouts/twocol_stacked/twocol_stacked.inc\";s:8:\"basename\";s:18:\"twocol_stacked.inc\";s:4:\"name\";s:14:\"twocol_stacked\";}s:13:\"twocol_bricks\";O:8:\"stdClass\":3:{s:8:\"filename\";s:72:\"sites/all/modules/panels/plugins/layouts/twocol_bricks/twocol_bricks.inc\";s:8:\"basename\";s:17:\"twocol_bricks.inc\";s:4:\"name\";s:13:\"twocol_bricks\";}s:6:\"twocol\";O:8:\"stdClass\":3:{s:8:\"filename\";s:58:\"sites/all/modules/panels/plugins/layouts/twocol/twocol.inc\";s:8:\"basename\";s:10:\"twocol.inc\";s:4:\"name\";s:6:\"twocol\";}s:25:\"threecol_33_34_33_stacked\&qu in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT * FROM drupal_panels_layout t__0 WHERE plugin = 'flexible' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:2:{s:6:\"panels\";a:6:{s:15:\"rounded_corners\";O:8:\"stdClass\":3:{s:8:\"filename\";s:67:\"sites/all/modules/panels/plugins/styles/corners/rounded_corners.inc\";s:8:\"basename\";s:19:\"rounded_corners.inc\";s:4:\"name\";s:15:\"rounded_corners\";}s:5:\"block\";O:8:\"stdClass\":3:{s:8:\"filename\";s:49:\"sites/all/modules/panels/plugins/styles/block.inc\";s:8:\"basename\";s:9:\"block.inc\";s:4:\"name\";s:5:\"block\";}s:7:\"default\";O:8:\"stdClass\":3:{s:8:\"filename\";s:51:\"sites/all/modules/panels/plugins/styles/default.inc\";s:8:\"basename\";s:11:\"default.inc\";s:4:\"name\";s:7:\"default\";}s:4:\"list\";O:8:\"stdClass\":3:{s:8:\"filename\";s:48:\"sites/a in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT * FROM drupal_stylizer t__0 in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:2:{s:6:\"panels\";a:0:{}s:12:\"page_manager\";a:12:{s:9:\"blog_user\";O:8:\"stdClass\":3:{s:8:\"filename\";s:65:\"sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc\";s:8:\"basename\";s:13:\"blog_user.inc\";s:4:\"name\";s:9:\"blog_user\";}s:4:\"blog\";O:8:\"stdClass\":3:{s:8:\"filename\";s:60:\"sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc\";s:8:\"basename\";s:8:\"blog.inc\";s:4:\"name\";s:4:\"blog\";}s:12:\"contact_site\";O:8:\"stdClass\":3:{s:8:\"filename\";s:68:\"sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc\";s:8:\"basename\";s:16:\"contact_site.inc\";s:4:\"name\";s:12:\"contact_site\";}s:12:\"contact_user\";O:8:\&qu in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_variable SET value = 'a:7:{s:9:\"arguments\";a:1:{s:7:\"display\";N;}s:4:\"type\";s:6:\"module\";s:10:\"theme path\";s:14:\"modules/system\";s:8:\"function\";s:21:\"theme_better_messages\";s:13:\"include files\";a:0:{}s:11:\"theme paths\";a:1:{i:0;s:14:\"modules/system\";}s:20:\"preprocess functions\";a:2:{i:0;s:19:\"template_preprocess\";i:1;s:16:\"skinr_preprocess\";}}' WHERE name = 'drupal_tweaks_status_messages_theme_callback' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: DELETE FROM drupal_cache WHERE cid = 'variables' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:681:{s:12:\"webform_view\";a:7:{s:9:\"arguments\";a:5:{s:4:\"node\";N;s:6:\"teaser\";N;s:4:\"page\";N;s:4:\"form\";N;s:7:\"enabled\";N;}s:4:\"type\";s:6:\"module\";s:10:\"theme path\";s:25:\"sites/all/modules/webform\";s:8:\"function\";s:18:\"theme_webform_view\";s:13:\"include files\";a:0:{}s:11:\"theme paths\";a:1:{i:0;s:25:\"sites/all/modules/webform\";}s:20:\"preprocess functions\";a:2:{i:0;s:19:\"template_preprocess\";i:1;s:16:\"skinr_preprocess\";}}s:21:\"webform_view_messages\";a:7:{s:9:\"arguments\";a:6:{s:4:\"node\";N;s:6:\"teaser\";N;s:4:\"page\";N;s:16:\"submission_count\";N;s:14:\"limit_exceeded\";N;s:13:\"allowed_roles\";N;}s:4:\"type\";s:6:\"mo in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: INSERT INTO drupal_watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'backtrace', 'Type: php\n
%message in %file on line %line.
\nBacktrace:
\ntrigger_error(a:2:{i:0;s:90:\"MySQL server has gone away\nquery: SELECT * FROM drupal_uc_files_s3 WHERE bid='1'\";i:1;i:512;})[database.mysqli.inc:135];
\n._db_query(a:1:{i:0;s:46:\"SELECT * FROM drupal_uc_files_s3 WHERE bid=\'1\'\";})[database.mysql-common.inc:42];
\n..db_query(a:2:{i:0;s:42:\"SELECT * FROM {uc_files_s3} WHERE bid=\'%d\'\";i:1;s:1:\"1\";})[uc_file_s3.module:1308];
\n..._uc_file_s3_prune_files(a:0:{})[uc_file_s3.module:1366];
\n....uc_file_s3_refresh(a:0:{})[uc_file_s3.module:760];
\n.....uc_file_s3_feature_form(array)[?:?];
\n......call_user_func_array(array)[form.inc:378];< in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135 Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 204801 bytes) in /usr/home/client/Websites/example.com/sites/all/modules/amazon_s3/s3.inc on line 1273 Warning: MySQL server has gone away query: INSERT INTO drupal_watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:285:\"MySQL server has gone away\nquery: UPDATE drupal_sessions SET uid = 1, cache = 0, hostname = '96.53.60.174', session = 'S2wnxmApnPJxHfNNGXVM1xljTl-WP32Vkf0Jajk6sjAn8fhF8hx8AYX1DFSD0jh0', timestamp = 1294351030 WHERE sid = '1998be188d12f35824dc6f8ef914c2db'\";s:5:\"%file\";s:70:\"/usr/home/client/Websites/example.com/includes/session.inc\";s:5:\"%line\";i:70;}', 3, '', 'http://example.com/node/36/edit/features/file_s3/3', 'http://example.com/node/36/edit/features', '96.53.60.174', 1294351030) in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135 Warning: require_once(./sites/all/modules/drupal_tweaks/drupal_tweaks.inc) [function.require-once]: failed to open stream: No such file or directory in /usr/home/client/Websites/example.com/includes/module.inc on line 274 Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/drupal_tweaks/drupal_tweaks.inc' (include_path='.:/usr/local/lib/php') in /usr/home/client/Websites/example.com/includes/module.inc on line 274

Any help would be great. Thanks.

Comments

bmx269’s picture

Here is a shorter version:

Warning: MySQL server has gone away query: INSERT INTO drupal_watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (1, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:90:\"MySQL server has gone away\nquery: SELECT * FROM drupal_uc_files_s3 WHERE bid='1'\";s:5:\"%file\";s:96:\"/usr/home/client/Websites/example.com/sites/all/modules/uc_file_s3/uc_file_s3.module\";s:5:\"%line\";i:1308;}', 3, '', 'https://example.com/admin/store/products/files-s3/streakerfilmasia', 'https://example.com/admin/store/products/files-s3', '96.53.60.174', 1294363506) in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT * FROM drupal_system WHERE type = 'theme' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SELECT data, created, headers, expire, serialized FROM drupal_cache WHERE cid = 'theme_registry:' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: SHOW TABLES LIKE 'drupal_date_format_types' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_variable SET value = 'a:7:{s:9:\"arguments\";a:1:{s:7:\"display\";N;}s:4:\"type\";s:6:\"module\";s:10:\"theme path\";s:14:\"modules/system\";s:8:\"function\";s:21:\"theme_better_messages\";s:13:\"include files\";a:0:{}s:11:\"theme paths\";a:1:{i:0;s:14:\"modules/system\";}s:20:\"preprocess functions\";a:1:{i:0;s:19:\"template_preprocess\";}}' WHERE name = 'drupal_tweaks_status_messages_theme_callback' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: DELETE FROM drupal_cache WHERE cid = 'variables' in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

Warning: MySQL server has gone away query: UPDATE drupal_cache SET data = 'a:596:{s:18:\"aggregator_wrapper\";a:8:{s:9:\"arguments\";a:1:{s:7:\"content\";N;}s:4:\"file\";s:20:\"aggregator.pages.inc\";s:8:\"template\";s:37:\"modules/aggregator/aggregator-wrapper\";s:4:\"type\";s:6:\"module\";s:10:\"theme path\";s:18:\"modules/aggregator\";s:13:\"include files\";a:1:{i:0;s:41:\"./modules/aggregator/aggregator.pages.inc\";}s:11:\"theme paths\";a:1:{i:0;s:18:\"modules/aggregator\";}s:20:\"preprocess functions\";a:2:{i:0;s:19:\"template_preprocess\";i:1;s:38:\"template_preprocess_aggregator_wrapper\";}}s:27:\"aggregator_categorize_items\";a:8:{s:9:\"arguments\";a:1:{s:4:\"form\";N;}s:4:\"file\";s:20:\"aggregator.pages.inc\";s:4:\"type\";s:6:\"module\";s:10:\"theme pat in /usr/home/client/Websites/example.com/includes/database.mysqli.inc on line 135

deggertsen’s picture

Can anybody else confirm this? I am not having the same problem.

bmx269’s picture

I am not sure what is causing this, as it broke the downloads. I can view the buckets in the S3 module interface, but when I go to the View S3 Downloads, and click on a bucket to view the files. This is the ubercart part for sure. I have patched the module with the fopen -> s3 change as well.

bmx269’s picture

I have moved the site, and an old backup database to a testing server, and the result is the same, the file download buckets are listed, but not able to be accessed. I really need help fixing this, or an alternative to this module to DL files sold through S3. Thanks

deggertsen’s picture

Unfortunately I do not have the expertise to fix this problem. I recommend you post a bounty in the paid-services forum at http://drupal.org/paid-services in order to get somebody to fix your problem and hopefully contribute a patch. I know the maintainer and he hasn't had any time to work on the module.

torgospizza’s picture

When do you get these errors? On every page load? On the Purchased Files page in the Account (/user) section?

It looks like two things are happening: 1) You are running out of memory. ("Memory exhausted" error). 2) Mysql "has gone away" error is usually a result of a timeout, as discussed in #227445: MySQL server has gone away. Read that thread for some things you can do to try to solve it.

These aren't really Drupal issues, but could be exacerbated by slow queries or processes that are hanging up your server. To fix 1), you should increase your php memory limit from 100M to 128M as tends to be the standard with larger sites. This *should* fix 2) but you might also want to take an inventory with the modules you are running and start disabling some, as that's usually the main culprit behind large memory footprints in Drupal - that and Apache / PHP modules that are enabled, but that you don't need.

If doing the above still throws these errors, I'd be surprised, but we'll need more info to further track this down.

johnnydarkko’s picture

@bmx269 any luck on this? Did torgosPizza's suggestions clear this up for you?
I'm using ubercart-6.x-2.4 and I haven't had this issue, but I don't look forward to customers not being able to download their purchases =X

johnnydarkko’s picture

Ah scratch that... in /user/1/purchased-files-s3, I clicked on the filename to download the file and the Downloads counter increments but nothing is downloaded.

torgospizza’s picture

Any errors in Watchdog? I don't think this is the same issue.

johnnydarkko’s picture

Version: » 6.x-1.x-dev

No errors. We traced it and found that in uc_file_s3.pages.inc, it's skipping the while loop on line 292.

torgospizza’s picture

Which is this bit:

$fp = fsockopen($aws_bucket . ".s3.amazonaws.com", 80, $errno, $errstr, 30);

/// ... set a bunch of headers, etc.
 while (!feof($fp)) {
...

So it's trying to open your file as a stream and failing. Do you have some kind of ACL setup on the file? If you go to admin/build/amazon-s3, can you read your buckets and the files within?

You might also check out the patch at the end of #772930-12: Remove fsockopen(), use s3->getAuthenticatedUrl to get files as a force-download. Download the CVS code, or apply the patches in #12, which will get rid of the code that's causing you this error, and will instead generate a signed URL for the file, and set the headers as a force-download. If that still doesn't work then it's a problem with your bucket, most likely.

johnnydarkko’s picture

Awesome, thanks torgosPizza! that patch worked perfectly for me. I didn't think the problem I had was related to that issue. Thanks for providing that patch and pointing me in the right direction!

torgospizza’s picture

They're really only related in the sense that you're trying to read a stream from Amazon S3, but I think this approach is bad (which is why the original patch was written), because I think it makes assumptions about the configuration of your S3 bucket. Whereas if we simply generate a URL with headers that we provide, we know what to expect every time.

Hopefully the UC File S3 maintainer will be in touch with me as these patches should get applied sometime soon.

torgospizza’s picture

Status: Active » Fixed

Marking as fixed since the OP hasn't returned, and the issue was not related to this module anyway.

bmx269’s picture

I am still here, the client is holding off on me working on the site, as we feel it is the hosting that is causing the problem. I will post if the error is fixed when the hosting is resolved.

torgospizza’s picture

Sounds good! Feel free to re-open this thread if you find there is an issue.

Status: Fixed » Closed (fixed)

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