Page 1 of 1

cron cannot run

Posted: Sun Feb 10, 2019 7:04 pm
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!

Re: cron cannot run

Posted: Sun Feb 10, 2019 8:01 pm
by admin
Somebody changed the DB I guess.
What fields do you have in history table?

Re: cron cannot run

Posted: Sun Feb 10, 2019 8:41 pm
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 | |
+---------------+-----------------------+------+-----+---------+-------+

Re: cron cannot run

Posted: Mon Feb 11, 2019 12:53 am
by admin
Looks like one field is changed somehow. Can you rename raw to row?

Re: cron cannot run

Posted: Mon Feb 11, 2019 7:14 am
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 | |
+---------------+-----------------------+------+-----+---------+-------+

Re: cron cannot run

Posted: Mon Feb 11, 2019 1:44 pm
by admin
Looks like somebody mix DB version 2 and filled version 1... Try to reinstall the script and check DB differences

Re: cron cannot run

Posted: Mon Feb 11, 2019 2:55 pm
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

Re: cron cannot run

Posted: Mon Feb 11, 2019 3:05 pm
by admin
I think somebody copied files or something like that ..

Re: cron cannot run

Posted: Sat Feb 16, 2019 9:23 am
by diszk
so finally, I have reinstalled the files and export/import database and everything seems fine, thank you for your help

Re: cron cannot run

Posted: Wed Feb 27, 2019 9:07 am
by admin
NP)