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

Data too long for column 'check_command' #22

Open
sethmay opened this issue Sep 11, 2019 · 2 comments
Open

Data too long for column 'check_command' #22

sethmay opened this issue Sep 11, 2019 · 2 comments

Comments

@sethmay
Copy link

sethmay commented Sep 11, 2019

We were working through problems with StatusEngine not picking up a number of our Nagios services and ran into a number of log entries like the following:

Data too long for column 'check_command' at row X

Seen in both syslog and when running "/opt/statusengine/worker/bin/StatusengineWorker.php" directly.

To fix this, we increased the size of the "check_command" columns in both "statusengine_servicestatus" and "statusengine_hoststatus" from VARCHAR(255) to VARCHAR(512). Once we made the change, the errors disappeared and the missing services appeared.

This may be a change that should be made to to database SQL file.

@nook24
Copy link
Member

nook24 commented Sep 12, 2019

Thanks for reporting this.

I think as long as this field is using a VARCHAR, it’s hard to define a default length that fits for all users.
Unfortunately I hadn’t time to benchmark TEXT vs VARCHAR but if I remember right a TEXT column will force MySQL to create tmp tables on disk because the memory storage engine don’t support type TEXT.

I also want to update the MySQL schema to adding better indices and a primary key to some columns. But that has a low priority for me right now so I don’t know when I find the time for all the required bench marking.

I guess for now it’s the best if you adjust the length to fit your needs.

@sethmay
Copy link
Author

sethmay commented Sep 12, 2019

Got it. And you're right: VARCHAR is stored on-row and TEXT is stored off-row (and may need a disk read to fetch), so potentially a factor on performance. Often you'll just pick a VARCHAR length that should reasonably never be exceeded, in these cases that seems to be a pretty trial and error process. At least with this issue report, anyone else should be able to find our fix.

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

No branches or pull requests

2 participants