view · edit · sidebar · attach · print · history

20130717-debug-editing-davatz-com

<< | Index | >>


Summary

  • Debug Problem on MySQL.

Commits / Patches

Index / Status


Debug Update on davaz.com

Continue to setup/debug problem on davaz.com.

Could not setup application in VM as same environment with production.

[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: Wed Jul 17 12:01:35 +0900 2013 - 69942409887600 - DRb::DRbUnknownError - Mysql::
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /usr/local/lib/ruby/1.8/drb/drb.rb:1093:in `method_missing'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /home/yasuhiro/.work/usr/ywesee/src/sbsm/lib/cgi/drbsession.rb:20:in `initialize'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /usr/local/lib/ruby/1.8/cgi/session.rb:274:in `new'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /usr/local/lib/ruby/1.8/cgi/session.rb:274:in `initialize'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /home/yasuhiro/.work/usr/ywesee/src/sbsm/lib/sbsm/request.rb:161:in `new'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /home/yasuhiro/.work/usr/ywesee/src/sbsm/lib/sbsm/request.rb:161:in `drb_process'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /home/yasuhiro/.work/usr/ywesee/src/sbsm/lib/sbsm/request.rb:66:in `process'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /var/www/davaz.yasuhiro.ch/doc/index.rbx:12
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /usr/local/lib/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Wed Jul 17 12:01:35 2013] [error] access to /en/personal/home failed for (null), reason: /usr/local/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler'

cannot load object.
Restored data (on backup disk) was old data.

Then I restored from db_backup.sql

Link

Debug Updating/Editing

2013-07-17 14:13:48.539665500 error in SBSM::Session#to_html: /en/gallery/ajax_movie_gallery/artobject_id/1713
2013-07-17 14:13:48.539669500 NoMethodError
2013-07-17 14:13:48.539673500 undefined method `-' for nil:NilClass
2013-07-17 14:13:48.539677500 /var/www/davaz.yasuhiro.ch/src/view/art_object.rb:117:in `last'
2013-07-17 14:13:48.539681500 /var/www/davaz.yasuhiro.ch/src/view/art_object.rb:200:in `last'
2013-07-17 14:13:48.539685500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:141:in `send'
2013-07-17 14:13:48.539712500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:141:in `create'
2013-07-17 14:13:48.539716500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:122:in `compose'
2013-07-17 14:13:48.539720500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:119:in `each'
2013-07-17 14:13:48.539724500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:119:in `compose'
2013-07-17 14:13:48.539731500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:55:in `init'
2013-07-17 14:13:48.539736500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/component.rb:139:in `initialize'
2013-07-17 14:13:48.539739500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:138:in `new'
2013-07-17 14:13:48.539748500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:138:in `create'
2013-07-17 14:13:48.539752500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:33:in `compose'
2013-07-17 14:13:48.539756500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `each'
2013-07-17 14:13:48.539761500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `compose'
2013-07-17 14:13:48.539782500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:55:in `init'
2013-07-17 14:13:48.539796500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/component.rb:139:in `initialize'
2013-07-17 14:13:48.539800500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:138:in `new'
2013-07-17 14:13:48.539804500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:138:in `create'
2013-07-17 14:13:48.539812500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:33:in `compose'
2013-07-17 14:13:48.539816500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `each'
2013-07-17 14:13:48.539820500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `compose'
2013-07-17 14:13:48.539829500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:55:in `init'
2013-07-17 14:13:48.539833500 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/component.rb:139:in `initialize'

Error on ArtObject view

  @4000000051e62a2f3880801c error in SBSM::Session#to_html: /en/gallery/ajax_movie_gallery/artobject_id/882
  @4000000051e62a2f388093a4 NoMethodError
  @4000000051e62a2f38809f5c undefined method `empty?' for nil:NilClass
  @4000000051e62a2f3880aefc /var/www/davaz.yasuhiro.ch/src/view/art_object.rb:74:in `wordpress_url'
  @4000000051e62a2f3880be9c /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:141:in `send'
  @4000000051e62a2f38813f84 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:141:in `create'
  @4000000051e62a2f3881530c /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:33:in `compose'
  @4000000051e62a2f388162ac /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `each'
  @4000000051e62a2f3881724c /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `compose'
  @4000000051e62a2f38818da4 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:55:in `init'
  @4000000051e62a2f3881a12c /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/component.rb:139:in `initialize'
  @4000000051e62a2f3881b0cc /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:112:in `new'
  @4000000051e62a2f3881c06c /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:112:in `davaz_view_artobjectinnercomposite_artobject'
  @4000000051e62a2f3881e394 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:141:in `send'
  @4000000051e62a2f3881f334 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:141:in `create'
  @4000000051e62a2f388202d4 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:33:in `compose'
  @4000000051e62a2f38821274 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `each'
  @4000000051e62a2f388231b4 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/divcomposite.rb:13:in `compose'
  @4000000051e62a2f38824154 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/composite.rb:55:in `init'
  @4000000051e62a2f388250f4 /usr/local/lib/ruby/gems/1.8/gems/htmlgrid-1.0.3/lib/htmlgrid/component.rb:139:in `initialize'
  @4000000051e62a2f38826094 /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `new'
  @4000000051e62a2f38827bec /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/state.rb:245:in `view'
  @4000000051e62a2f38828b8c /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/state.rb:181:in `to_html'
  @4000000051e62a2f38829b2c /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/session.rb:447:in `to_html'
  @4000000051e62a2f3882ba6c /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/session.rb:173:in `drb_process'
  @4000000051e62a2f3882ca0c /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/session.rb:171:in `synchronize'
  @4000000051e62a2f3882d9ac /usr/local/lib/ruby/gems/1.8/gems/sbsm-1.2.3/lib/sbsm/session.rb:171:in `drb_process'
...
commits

And I repaired file permission and .git/config file.


Debug UPDATE SQL running

SQL is running. But Data is not updated.

by old sql script
mysql> UPDATE artobjects SET text='&nbsp;', tool_id='71', country_id='R', artgroup_id='MOV', date='2006-7-14', location='Tolbachik, Kamchatka', url='http://youtu.be/NyUEAixkcfQ', wordpress_url='', serie_id='AAC', price='20', size='15:00', serie_position='1', material_id='48', title="061 / TOLBACHIK - Ludmilla\\'s Volcano", language='English' WHERE artobject_id='883';
ERROR 1054 (42S22): Unknown column 'wordpress_url' in 'field list'

Then I updated to use following structure.

mysql> show fields from artobjects;
+----------------+-----------------------------------+------+-----+------------+----------------+
| Field          | Type                              | Null | Key | Default    | Extra          |
+----------------+-----------------------------------+------+-----+------------+----------------+
| artobject_id   | int(6) unsigned                   | NO   | PRI | NULL       | auto_increment |
| artgroup_id    | varchar(3)                        | NO   | MUL |            |                |
| tool_id        | tinyint(4) unsigned               | NO   |     | 0          |                |
| material_id    | tinyint(4) unsigned               | NO   |     | 0          |                |
| country_id     | varchar(3)                        | NO   |     |            |                |
| date           | date                              | NO   |     | 1901-01-01 |                |
| size           | text                              | NO   |     | NULL       |                |
| location       | text                              | NO   |     | NULL       |                |
| language       | text                              | NO   |     | NULL       |                |
| title          | text                              | NO   |     | NULL       |                |
| serie_id       | varchar(3)                        | NO   |     | AAA        |                |
| serie_position | varchar(4)                        | NO   |     |            |                |
| public         | tinyint(1) unsigned               | NO   |     | 1          |                |
| movie_type     | enum('original','trailor','none') | NO   |     | none       |                |
| text           | text                              | NO   |     | NULL       |                |
| price          | int(10) unsigned                  | YES  |     | NULL       |                |
| url            | text                              | NO   |     | NULL       |                |
| wordpress_url  | text                              | YES  |     | NULL       |                |
| author         | text                              | NO   |     | NULL       |                |
| charset        | varchar(10)                       | YES  |     | NULL       |                |
+----------------+-----------------------------------+------+-----+------------+----------------+
20 rows in set (0.00 sec)

Maybe, about Table-Structure (Collumn-Type and Default value)

  • dumped SQL files (davaz.sql, db_backup.sql and scripts/data/database_backup.sql) has old structure.
  • backup data in thinpower is backup of another database. (maybe old database was davaz, but application had used new database.)
  • there is no complete backup data. (Because MySQL chnange by Import/Export, maybe.)

Some tries

mysql> alter table artobjects add column wordpress_url TEXT after url;
Query OK, 1240 rows affected (0.04 sec)
Records: 1240  Duplicates: 0  Warnings: 0

And I changed DEFAULT VALUE (allowd Null) for

  • size
  • location
  • language
  • title
  • wordpress_url #=> This is bug. This is needed as NULL = YES
mysql> alter table artobjects modify column wordpress_url text null default null;
Query OK, 1521 rows affected (0.01 sec)
Records: 1521  Duplicates: 0  Warnings: 0

MySQL Version problem

Production use MySQL 5.5.
This was problem ruby 1.8.6 (and mysql 2.8.1 gem)

connection will close after few sec. (and connection was very slow).
And some collum-tye was changed by Import.

Then I downgrade MySQL to 5.1.on production.

fastpower new.davaz.com $ mysql --version
mysql  Ver 14.14 Distrib 5.1.66, for pc-linux-gnu (x86_64) using readline 5.1

Restored User permission problem

I found permission error in MySQL.

Mysql::Error
UPDATE command denied to user 'xxx'@'localhost' for table 'artobjects'

This user was read only.

mysql> show grants for 'xxx'@'localhost';
+--------------------------------------------------------------------------------------------------------------+
| Grants for xxxxx@localhost                                                                                   |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'xxx'@'localhost' IDENTIFIED BY PASSWORD '*xxxxx'                                      |
| GRANT SELECT ON `xxxx`.* TO 'xxx'@'localhost'                                                            |
+--------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Then I give this user permission.

mysql> grant all privileges on xxxx.* to 'xxxx'@'xxxx';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Finaly, Update to prevent/rescue some errors.

commit
view · edit · sidebar · attach · print · history
Page last modified on July 17, 2013, at 05:52 PM