cron cannot run

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

cron cannot run

Post by diszk » Sun Feb 10, 2019 7:04 pm

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: 27738
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin » Sun Feb 10, 2019 8:01 pm

Somebody changed the DB I guess.
What fields do you have in history table?
Have you done script update ?

diszk
Posts: 60
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk » Sun Feb 10, 2019 8:41 pm

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: 27738
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin » Mon Feb 11, 2019 12:53 am

Looks like one field is changed somehow. Can you rename raw to row?
Have you done script update ?

diszk
Posts: 60
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk » Mon Feb 11, 2019 7:14 am

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: 27738
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin » Mon Feb 11, 2019 1:44 pm

Looks like somebody mix DB version 2 and filled version 1... Try to reinstall the script and check DB differences
Have you done script update ?

diszk
Posts: 60
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk » Mon Feb 11, 2019 2:55 pm

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: 27738
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin » Mon Feb 11, 2019 3:05 pm

I think somebody copied files or something like that ..
Have you done script update ?

diszk
Posts: 60
Joined: Tue Jan 17, 2012 12:07 am

Re: cron cannot run

Post by diszk » Sat Feb 16, 2019 9:23 am

so finally, I have reinstalled the files and export/import database and everything seems fine, thank you for your help

admin
Site Admin
Posts: 27738
Joined: Wed Sep 10, 2008 11:43 am

Re: cron cannot run

Post by admin » Wed Feb 27, 2019 9:07 am

NP)
Have you done script update ?

Post Reply