Showing entries 1 to 8
Displaying posts with tag: errors (reset)
MySQL error handling on server side: a NO GO!

There is no reasonable way to catch and diagnose errors on server side. It is nearly impossible to know exactly what went wrong.

To illustrate, consider the following query:

INSERT INTO my_table (my_column) VALUES (300);

What could go wrong with this query?

  • We might hit a UNIQUE KEY violation
  • Or a FOREIGN KEY violation
  • my_column could be TINYINT UNSIGNED, and with strict sql_mode this makes for out-of-range
  • Or, similarly, it could be an ENUM (2,3,5,8)

Is that it? Not remotely:

  • This could be a read-only MyISAM table
  • We may have issued a LOCK TABLES my_table READ -- this violates our lock
  • Or this could be an InnoDB table, and this INSERT would make for a …
[Read more]
MySQL errors

Next time you have an error whilst running an sql script into mysql using the pretty easy redirect into eg: mysql -uroot -pmsandbox -h127.0.0.1 -P3306 dbname < filename you might want to give the -v option a shot.

MySQL normally outputs an error with the line number like:

[mysql@dcassar-ubuntu /mysql/dumps/stored_procs 11:10:12]$ mysql -uroot -pmsandbox -h127.0.0.1 -P5151 test < file
ERROR 1267 (HY000) at line 375: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_cs,IMPLICIT) for operation '='

But 375 is not including comments and stuff so it’s a bit hard to go through the file to locate the exact section which is failing.

Run the same command with -v:

[mysql@dcassar-ubuntu /mysql/dumps/stored_procs 11:10:30]$ mysql -uroot -pmsandbox -h127.0.0.1 -P5151 -v test < file | tail -5
ERROR 1267 (HY000) at line 375: Illegal mix …

[Read more]
Kontrollbase – error adding hosts/user/client

If you are having an issue with adding hosts/clients/users on revision 162 it’s because of the INSERT DELAYED sql command being used. Before I release a new version, please change the following lines in the file “system/application/models/mode_app.php” Incorrect code line 70: $sql0="INSERT DELAYED INTO server_list ( line 139: $sql0="INSERT DELAYED INTO `server_client` ( line 177: $sql0="INSERT DELAYED INTO `system_users` [...]

Kontrollbase VMware virtual appliance – update

Had to fix a service process error on the original release of the appliance. It’s now fixed and the machine export is running. I’ll have the new file uploaded and ready for use at approximately 20:00PST (GMT +8).

MySQL Error of the day

Just spotted the following posting from Paul DuBois on the internals mailing list:

I'm engaged in a project (WL#3403) to compile information that will provide better information about our errors and error messages:

  • What an error means
  • Likely causes of the error
  • How to rectify or work around the error

The general idea is to provide our users something more than a list of error codes and the messages from errmsg.txt, such as the manual currently includes here:

[Read more]
Kontrollbase rev51 – code fix for model_main.php

Came across an error on the sql for the overview.php page. It wasn’t correctly displaying aggregate data on the charts. So here’s the fix for rev50 to rev51. This isn’t a deal breaker on the release but if you’re inclined to open system/application/models/model_main.php and replace one line it’s easier than waiting for our next release.

2001c2001
< $sql = "select $xval,DATE_FORMAT(Creation_time,'%m-%d %H:%i') as Date from server_statistics WHERE Creation_time BETWEEN '$sday' AND '$eday' GROUP BY DAY(Creation_time),HOUR(Creation_time) ORDER BY Creation_time";
---
> $sql = "select max($xval) as $xval,DATE_FORMAT(Creation_time,'%m-%d %H:%i') as Date from server_statistics WHERE Creation_time BETWEEN '$sday' AND '$eday' GROUP BY DAY(Creation_time),HOUR(Creation_time) ORDER BY Creation_time";

More IE7 fixes – header.php

Fixed a lingering JS issue with the ExtJS code in header.php file that was preventing IE7 from loading the main.php page. It was….. an extra comma! If you are inclined to edit one file here is the diff change, otherwise like other bug fixes it will be included with the next release. The file is system/application/views/header.php and the change is for line #327 for revision 42+.

< {id: 'innodb_total', header: "innodb_total", width: 75, sortable: true, renderer: 'fileSize', dataIndex: 'innodb_total'},
---
> {id: 'innodb_total', header: "innodb_total", width: 75, sortable: true, renderer: 'fileSize', dataIndex: 'innodb_total'}

Kontrollbase – IE7 login error fixed

If you run IE7 and have tried Kontrollbase you may have noticed an infinite progress bar for the authentication. While login works on all other browsers, it was broken on IE7. The change has been committed to the repo and will be available in the next release. If you are inclined to edit one file here is the diff change. The file is system/application/controllers/login.php and the change is for line #68.

68c68
< $user_system_user_id = $this->session->userdata('user_system_user_id');
---
> $user_system_user_id = $this->phpsession->get('user_system_user_id');

Showing entries 1 to 8