Can't access Owncloud: An exception occured in driver: SQLSTATE[HY000] [2002]

Ask all your questions regarding OC 8.2 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
steph.morin
Newbie
Posts: 6
Joined: Sat Mar 12, 2016 5:05 pm
ownCloud version: 8.2.3
Webserver: Lighttpd
Database: MySQL
OS: OpenBSD
PHP version: 5.6

Can't access Owncloud: An exception occured in driver: SQLSTATE[HY000] [2002]

Postby steph.morin » Sat Jul 02, 2016 4:14 pm

Steps to reproduce
1. try to connect to owncloud by browser or sync tool

Expected behaviour
Owncloud accessible

Actual behaviour
Internal server error message,

Server configuration
Environment:Home server
Server: lighthttpd on freebsd 10.2
Database: Mysql 5.6
Client: Any
OC-Version: 8.2.5.2
PHP-Version: 5.6

Owncloud became non-responsive (unable to connect with the desktop sync tool and webpage), so I restarted services (restart the jail).

After the restart, I get the following error when accessing Owncloud:

Internal Server Error
The server encountered an internal error and was unable to complete your request.

The events worthy of mention in Owncloud log:

On June 24th, I upgraded the OC version as follow:
"message":"starting upgrade from 8.2.2.2 to 8.2.5.2","level":0

Then the log is quiet until yesterday (July 1):
Exception: {\"Message\":\"HTTP\\\/1.1 423 \\\"Pictures\\\/Lightroom\\\/Lightroom 5 Catalog.lrcat-chunking-121536809-149-148\\\" is locked\"
and
message":"Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused","level":4

Not sure if this has anything to do with the issue, but the file Lightroom 5 Catalog.lrcat is big.

When I try to connect directly to Mysql, I get the following
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I tried to change localhost to 127.0.0.1 as mentionned in some forums, no success.
I tried to stop/start Mysql with the console, but get the following error
"mysql not running? (check /var/db/mysql/owncloud.local.pid)."

Would anyone have suggestions for the next steps to resolve this issue? Or should I simply restore the last backup of the database? (I have a daily backup scheduled with the following command "/usr/local/bin/mysqldump --lock-tables -h localhost -u ....")

Thank you for your help

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Can't access Owncloud: An exception occured in driver: SQLSTATE[HY000] [2002]

Postby RealRancor » Sat Jul 02, 2016 4:28 pm

Hi,

your mysql server is currently not running and causing the shown issue:

Connection refused


Can't connect to local MySQL server through socket '/tmp/mysql.sock'


"mysql not running? (check /var/db/mysql/owncloud.local.pid)."


Its hard to tell from remote why this is happening in your environment and what caused this but those errors might be a good starting point for a research on the net. A FreeBSD community might also be able to help here, maybe its related to your jail setup?
*gone*

steph.morin
Newbie
Posts: 6
Joined: Sat Mar 12, 2016 5:05 pm
ownCloud version: 8.2.3
Webserver: Lighttpd
Database: MySQL
OS: OpenBSD
PHP version: 5.6

Re: Can't access Owncloud: An exception occured in driver: SQLSTATE[HY000] [2002]

Postby steph.morin » Sat Jul 02, 2016 4:36 pm

Hi,

What is odd is that this setup has worked fine for over 2 years.

When checking server processes, Mysql is up and process id's are present. This looks like a table corruption that might have been caused by something in the recent upgrade I made to 8.2.5.

My next step is likely a restore of my backup, but I would like to avoid that as I would lose 1 day of activities

Thanks
sm

steph.morin
Newbie
Posts: 6
Joined: Sat Mar 12, 2016 5:05 pm
ownCloud version: 8.2.3
Webserver: Lighttpd
Database: MySQL
OS: OpenBSD
PHP version: 5.6

Re: Can't access Owncloud: An exception occured in driver: SQLSTATE[HY000] [2002]

Postby steph.morin » Wed Jul 06, 2016 4:37 am

For others that may one day have the same issue.. not sure what caused it, but Mysql would no longer start in the freebsd jail it was running. May have been caused by a update of freebsd or database corruption.. I don't think I'll ever know.

So the fix for me was to rebuild a new jail and reinstall everything from scratch, then restore the database backup I had.

Steph


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.2”

Who is online

Users browsing this forum: No registered users and 1 guest