cron cannot run

Post Reply
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

cron cannot run

Post by diszk »

Hello,

I didn't change anything since months and suddenly this error popped up when cron trying to run:

Fatal error: Uncaught exception 'Exception' with message 'Mysql error:: 1054 (Unknown column 'row' in 'field list') (db_link) in query SELECT sum(row) FROM history WHERE trader = '25.smartcj.tds' . (example.com) ' in /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php:129
Stack trace:
#0 /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php(160): db_error('SELECT sum(row)...', 1054, 'Unknown column ...', 'db_link')
#1 /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php(260): db_query('SELECT sum(row)...', 'db_link')
#2 /var/www/example.com/htdocs/xxx/includes/libs/cj_functions.php(1491): db_value()
#3 /var/www/example.com/htdocs/xxx/bin/cron.php(87): writemembers()
#4 {main}
thrown in /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php on line 129


Tried to upgrade, optimize, no joy. Also tried to rename those files and upgrade, no luck. Also tried to copy those files from a working install, still nothing. When I check the database with describe history, I can see 'raw' row, not 'row' row:)

Could you please tell me what should I try? thanks in advance!
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin »

Somebody changed the DB I guess.
What fields do you have in history table?
Don't forget to run script update
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk »

thanks for the fast reply,

mysql> describe history;
+---------------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-----------------------+------+-----+---------+-------+
| trader | varchar(50) | NO | PRI | NULL | |
| hour | int(10) unsigned | NO | PRI | NULL | |
| raw | int(10) | YES | | NULL | |
| uni | int(10) unsigned | NO | | NULL | |
| out | int(10) unsigned | NO | | NULL | |
| clicks_trade | int(10) unsigned | NO | | NULL | |
| clicks_url | int(10) unsigned | NO | | NULL | |
| quality_trade | int(10) unsigned | NO | | NULL | |
| quality_url | int(10) unsigned | NO | | NULL | |
| proxy | int(10) unsigned | NO | | NULL | |
| proxy_out | int(10) unsigned | NO | | NULL | |
| cheat | int(10) unsigned | NO | | NULL | |
| user_count | int(10) unsigned | NO | | NULL | |
| user_dis | int(10) unsigned | NO | | NULL | |
| next_click | int(10) unsigned | NO | | NULL | |
| last_click | int(10) unsigned | NO | | NULL | |
| time_spent | decimal(5,2) unsigned | NO | | NULL | |
| header | int(10) unsigned | NO | | NULL | |
+---------------+-----------------------+------+-----+---------+-------+
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin »

Looks like one field is changed somehow. Can you rename raw to row?
Don't forget to run script update
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk »

I have changed it, but I checked other installs, and there are 'raw' columns everywhere. Anyway, it generates another error:

Fatal error: Uncaught exception 'Exception' with message 'Mysql error:: 1054 (Unknown column 'hr2' in 'field list') (db_link) in query SELECT hr2 FROM day WHERE h = '25.smartcj.tds' . (example.com) ' in /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php:129
Stack trace:
#0 /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php(160): db_error('SELECT hr2 FROM...', 1054, 'Unknown column ...', 'db_link')
#1 /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php(260): db_query('SELECT hr2 FROM...', 'db_link')
#2 /var/www/example.com/htdocs/xxx/includes/libs/cj_functions.php(1492): db_value()
#3 /var/www/example.com/htdocs/xxx/bin/cron.php(87): writemembers()
#4 {main}
thrown in /var/www/example.com/htdocs/xxx/includes/db_modules/mysql.php on line 129





mysql> describe day;
+---------------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-----------------------+------+-----+---------+-------+
| trader | varchar(50) | NO | PRI | NULL | |
| hour | int(10) unsigned | NO | PRI | NULL | |
| raw | int(10) | YES | | NULL | |
| uni | int(10) unsigned | NO | | NULL | |
| out | int(10) unsigned | NO | | NULL | |
| clicks_trade | int(10) unsigned | NO | | NULL | |
| clicks_url | int(10) unsigned | NO | | NULL | |
| quality_trade | int(10) unsigned | NO | | NULL | |
| quality_url | int(10) unsigned | NO | | NULL | |
| proxy | int(10) unsigned | NO | | NULL | |
| proxy_out | int(10) unsigned | NO | | NULL | |
| cheat | int(10) unsigned | NO | | NULL | |
| user_count | int(10) unsigned | NO | | NULL | |
| user_dis | int(10) unsigned | NO | | NULL | |
| next_click | int(10) unsigned | NO | | NULL | |
| last_click | int(10) unsigned | NO | | NULL | |
| time_spent | decimal(5,2) unsigned | NO | | NULL | |
| header | int(10) unsigned | NO | | NULL | |
+---------------+-----------------------+------+-----+---------+-------+
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin »

Looks like somebody mix DB version 2 and filled version 1... Try to reinstall the script and check DB differences
Don't forget to run script update
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk »

ok, I'll do it at night. However, that somebody must be me as noone managing my server but me. I'm sure that I didn't event check this site since months as I don't really care where it goes. Also another website on the same server with the same DB and such working correctly. So could be the issue is that I mixed the versions when I migrated to the actual server months ago but the error only popped a week ago? I'm asking this because it cannot be possible then someone doing things with my server so I should investigate.

Anyway, many thanks for your time! I'll try to reinstall and such I'll let you know the results anyway, thanks
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin »

I think somebody copied files or something like that ..
Don't forget to run script update
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk »

so finally, I have reinstalled the files and export/import database and everything seems fine, thank you for your help
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin »

NP)
Don't forget to run script update
Post Reply