Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile Picture upload -> SQLSTATE[HY000]: General error: 2006 MySQL server has gone away #8319

Closed
Githopp192 opened this issue Feb 12, 2018 · 3 comments

Comments

@Githopp192
Copy link

Steps to reproduce

  1. Go to Personal Settings
  2. Choose Upload Profile Picture
  3. Upload Picture

Expected behavior

Picture should upload in a few seconds, and website is refreshing

Actual behavior

Picture is uploading, but process will hung
After switching the website context, and go back to the Personal Settings the Profile Picture was uploaded properly.

Server configuration detail

Operating system: Linux 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64

Webserver: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.13 (apache2handler)

Database: mysql 5.5.56

PHP version: 7.1.13
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, imap, intl, json, ldap, exif, mcrypt, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, redis, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xml, wddx, xmlreader, xmlwriter, xsl, memcached, zip, Zend OPcache

Nextcloud version: 12.0.5 - 12.0.5.3

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from an older Nextcloud

Where did you install Nextcloud from:

From the official website

Signing status

Array

List of activated apps
Enabled:
 - activity: 2.5.2
 - admin_notifications: 1.0.1
 - announcementcenter: 3.1.1
 - apporder: 0.4.1
 - bruteforcesettings: 1.0.3
 - calendar: 1.5.7
 - circles: 0.13.6
 - comments: 1.2.0
 - contacts: 2.1.0
 - dav: 1.3.1
 - deck: 0.3.0
 - external: 2.0.3
 - federatedfilesharing: 1.2.0
 - federation: 1.2.0
 - files: 1.7.2
 - files_clipboard: 0.7.1
 - files_external: 1.3.0
 - files_pdfviewer: 1.1.1
 - files_sharing: 1.4.0
 - files_texteditor: 2.4.1
 - files_trashbin: 1.2.0
 - files_versions: 1.5.0
 - files_videoplayer: 1.1.0
 - firstrunwizard: 2.1
 - gallery: 17.0.0
 - impersonate: 1.0.2
 - issuetemplate: 0.3.0
 - keeweb: 0.4.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.0.0
 - mood: 0.3.3
 - music: 0.5.5
 - nextcloud_announcements: 1.1
 - notes: 2.3.2
 - notifications: 2.0.0
 - oauth2: 1.0.5
 - ownbackup: 17.5.0
 - passman: 2.1.4
 - password_policy: 1.2.2
 - polls: 0.8.1
 - provisioning_api: 1.2.0
 - quota_warning: 1.1.1
 - rainloop: 5.0.6
 - ransomware_protection: 1.0.5
 - serverinfo: 1.2.0
 - sharebymail: 1.2.0
 - sharepoint: 1.1.0
 - socialsharing_diaspora: 1.0.2
 - socialsharing_email: 1.0.3
 - socialsharing_facebook: 1.0.2
 - socialsharing_googleplus: 1.0.2
 - socialsharing_twitter: 1.0.2
 - spreed: 2.0.2
 - survey_client: 1.0.0
 - systemtags: 1.2.0
 - tasks: 0.9.6
 - theming: 1.3.0
 - twofactor_backupcodes: 1.1.1
 - updatenotification: 1.2.0
 - workflowengine: 1.2.0
Disabled:
 - admin_audit
 - appvncsafe
 - audioplayer
 - encryption
 - lsd
 - ojsxc
 - spreedme
 - user_external
 - user_ldap
 - weather

Configuration (config/config.php)
{
    "memcache.local": "\\OC\\Memcache\\APCu",
    "filelocking.enabled": true,
    "redis": {
        "host": "\/var\/run\/redis.sock",
        "port": 0,
        "dbindex": 0,
        "timeout": 1.5
    },
    "instanceid": "ocnudqtqmhau",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "***REMOVED SENSITIVE VALUE***",
        "***REMOVED SENSITIVE VALUE***",
        "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "\/media",
    "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "12.0.5.3",
    "dbname": "nextcloud",
    "dbhost": "localhost",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "maintenance": false,
    "theme": "",
    "loglevel": 1,
    "updater.release.channel": "production",
    "auth.bruteforce.protection.enabled": true,
    "check_for_working_htaccess": true,
    "data-fingerprint": "***REMOVED SENSITIVE VALUE***",
    "mail_from_address": "NextCloud",
    "mail_smtpmode": "smtp",
    "mail_smtpauthtype": "LOGIN",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpsecure": "tls",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "***REMOVED SENSITIVE VALUE***",
    "session_lifetime": 600,
    "session_keepalive": false,
    "logtimezone": "Europe\/Zurich",
    "logfile": "\/media\/nextcloud.log",
    "log_rotate_size": 104857600,
    "knowledgebaseenabled": false
}

Are you using external storage, if yes which one: local/smb/sftp/...

no

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

LDAP configuration (delete this part if not used)

NO LDAP Config

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Dragon/52.15.25.665 Chrome/52.0.2743.82 Safari/537.36

Operating system:

Logs

Browser log
Insert your webserver log here 
Nextcloud log
Insert your Nextcloud log here

{"reqId":"***REMOVED SENSITIVE VALUE***","level":3,"time":"2018-02-12T15:11:47+01:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"no app in context","method":"POST","url":"\/index.php\/avatar\/cropped","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'UPDATE `oc_cards` SET `carddata` = ?, `lastmodified` = ?, `size` = ?, `etag` = ? WHERE (`uri` = ?) AND (`addressbookid` = ?)' with params [\\\"BEGIN:VCARD\\\\r\\\\nVERSION:3.0\\\\r\\\\nPRODID:-\\\\\\\/\\\\\\\/Sabre\\\\\\\/\\\\\\\/Sabre VObject 4.1.2\\\\\\\/\\\\\\\/EN\\\\r\\\\nUID:***REMOVED SENSITIVE VALUE***\\\\r\\\\nFN:***REMOVED SENSITIVE VALUE***\\\\r\\\\nN:***REMOVED SENSITIVE VALUE***;;;;\\\\r\\\\nEMAIL;TYPE=OTHER:xxxxxxxxxxxxxxx\\\\r\\\\nPHOTO;ENCODING=b;TYPE=image\\\\\\\/jpeg:\\\\\\\/9j\\\\\\\/4AAQSkZJRgABAQAAAQABAAD\\\\\\\/\\\\\\\/gA7Q1JFQVRPUj\\\\r\\\\n o

{"reqId":"WoGgl9OOsy5TXXriH4-pSgAAAAQ","level":3,"time":"2018-02-12T15:11:47+01:00","remoteAddr":"15.203.137.73","user":"REMOVED SENSITIVE VALUE","app":"core","method":"POST","url":"/index.php/avatar/cropped","message":"Exception: {"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing 'SELECT fileid, storage, path, path_hash, parent, name, mimetype, mimepart, size, mtime,\n\t\t\t\t\t storage_mtime, encrypted, etag, permissions, checksum\n\t\t\t\tFROM oc_filecache WHERE storage = ? AND path_hash = ?' with params [24, \"d86b35adda1aedc00873efeac3fabb30\"]:\n\nSQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":0,"Trace":"#0 \/var\/www\/html\/nextcloud\/3rdparty\/doct

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT fileid, storage, path, path_hash, parent, name, mimetype, mimepart, size, mtime, storage_mtime, encrypted, etag, permissions, checksum FROM oc_filecache WHERE storage = ? AND path_hash = ?' with params [24, "d86b35adda1aedc00873efeac3fabb30"]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

  1. /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
  2. /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 855: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'SELECT fileid...', Array)
  3. /var/www/html/nextcloud/lib/private/DB/Connection.php - line 192: Doctrine\DBAL\Connection->executeQuery('SELECT fileid...', Array, Array, NULL)
  4. /var/www/html/nextcloud/lib/private/Files/Cache/Cache.php - line 137: OC\DB\Connection->executeQuery('SELECT fileid...', Array)
  5. /var/www/html/nextcloud/lib/private/Files/Cache/HomeCache.php - line 76: OC\Files\Cache\Cache->get('cache/tmpAvatar')
  6. /var/www/html/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php - line 70: OC\Files\Cache\HomeCache->get('cache/tmpAvatar')
  7. /var/www/html/nextcloud/lib/private/Files/Cache/Updater.php - line 156: OC\Files\Cache\Wrapper\CacheWrapper->get('cache/tmpAvatar')
  8. /var/www/html/nextcloud/lib/private/Files/View.php - line 327: OC\Files\Cache\Updater->remove('cache/tmpAvatar')
  9. /var/www/html/nextcloud/lib/private/Files/View.php - line 1171: OC\Files\View->removeUpdate(Object(OCA\RansomwareProtection\StorageWrapper), 'cache/tmpAvatar')
  10. /var/www/html/nextcloud/lib/private/Files/View.php - line 721: OC\Files\View->basicOperation('unlink', '/tmpAvatar', Array)
  11. /var/www/html/nextcloud/lib/private/Cache/File.php - line 146: OC\Files\View->unlink('tmpAvatar')
  12. /var/www/html/nextcloud/core/Controller/AvatarController.php - line 336: OC\Cache\File->remove('tmpAvatar')
  13. [internal function] OC\Core\Controller\AvatarController->postCroppedAvatar(Array)
  14. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
  15. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Core\Controller\AvatarController), 'postCroppedAvat...')
  16. /var/www/html/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Core\Controller\AvatarController), 'postCroppedAvat...')
  17. /var/www/html/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\Core\Control...', 'postCroppedAvat...', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
  18. [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
  19. /var/www/html/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
  20. /var/www/html/nextcloud/lib/base.php - line 1004: OC\Route\Router->match('/avatar/cropped')
  21. /var/www/html/nextcloud/index.php - line 48: OC handleRequest()
  22. {main}
Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@blizzz
Copy link
Member

blizzz commented Feb 27, 2018

MySQL server has gone away

indicates that your database was unreachable. Is it reproducible?

@Githopp192
Copy link
Author

yes .. thx for the comment .. i will tell that to one of my users, who already did this kind of action.

By the way .. i saw some other options to setup ... --->

You can add a wait_timeout line to the mysqld section of your my.cnf configuration file.
The value is specified in seconds. For example, to set the timeout to 24 hours:

[mysqld]

wait_timeout = 86400

But i'm not sure of the consquences .. so i think .. i will wait for other opinions, before implementing.

@MorrisJobke
Copy link
Member

@Githopp192 Are you using SSL for the mysql connection? Maybe try to disable this as it was reported in #3709 that it solved the issue. Beside that it is best to continue with those MySQL server has gone away in #8863. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants