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

MySQL: catching storage engine errors #1211

Closed
robocoder opened this issue Mar 18, 2010 · 3 comments
Closed

MySQL: catching storage engine errors #1211

robocoder opened this issue Mar 18, 2010 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@robocoder
Copy link
Contributor

When an SQL query fails due to a storage engine error, it doesn't return an (expected) SQLSTATE error, e.g., 42S01. Instead, we get an internal errno, e.g.,

Mysqli statement execute error : Got error 28 from storage engine

where 28 is often defined in errno.h as ENOSPC, i.e., no disk space left on volume.

Can we catch errors like this and provide a more user-friendly error message to users (via php's posix_strerror() function, if available)?

Note: in the case of ENOSPC, this wouldn't necessarily be limited to INSERTs. SELECTs (e.g., JOINs) and disk-based temporary tables could also be the trigger.

Note: it looks like -1 (though not a defined errno) is also a possible "errno" that could be returned.

Keywords: outofscope

@robocoder
Copy link
Contributor Author

I'm going to mark this as a wontfix for now. Proactive system monitoring falls within the sysadmin's scope of responsibilities, especially in a shared hosting (shared resources) environment.

At present, we generally don't try to catch errors on INSERT/UPDATE/SELECT queries. Implication: big patch, small benefit (warning) for a rare occurrence, requires user to check the Piwik dashboard (meanwhile other applications could be failing)

If a storage engine error occurs while the tracker executes, it could go undetected for a while. Implication: lost tracking, pain point

@robocoder
Copy link
Contributor Author

Running out of disk space is also an issue for disk-based session files. This would be visible to someone using the UI.

@robocoder
Copy link
Contributor Author

Another symptom that users might encounter:

SQLSTATE[HY000]: General error: 1 Can't create/write to file '/mysql/tmp/mysql-xyz/#sql_xyz_0.MYI' (Errcode: 2)

@robocoder robocoder added this to the Future releases milestone Jul 8, 2014
@robocoder robocoder self-assigned this Jul 8, 2014
@mattab mattab removed the wontfix label Aug 3, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants