-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduled jobs #23
Comments
Some quick things to check:
|
I ran bin/migration.php - no luck. And I pull from github this morning so I assume I use the latest code. |
Can you add |
Added like this:
Where do I find the log line? |
It should be in PHP's errorlog (possibly /var/log/httpd/error.log). |
Looks like I am getting the same errors as on the console: [26-Sep-2016 22:25:10 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 near "LIMIT": syntax error in /var/www/411/phplib/DB.php:78 |
Do you see a log line with the string "TEST" in it? It should be right before the error. |
I found that log: [Tue Sep 27 09:26:44 2016] [error] [client xxx.xxx.xxx.xxx] info [TEST] SELECT I am running sqlite-3.6.20-1.el6_7.2 - could that be an issue? |
The timestamps are just because the jobs haven't run yet (Jan 1, 1970 == 0) The log line you're looking for should have |
I cannot find a way to output this log line. Do I need to do something different? I rebuilt the site many times, tried different options - no luck. Same error all the time. I mentioned this during install: Please note that, Could that be related to the issue I see? |
Ok, I got this: earray(4) { |
Maybe it is a sqlite issue. I ran that query locally and it works fine. Could you try updating your copy of sqlite3? |
What version do you run? Mine is sqlite-3.6.20-1.el6_7.2 - I think this is most recent one. |
I'm running |
Let me try getting this one and see if this fixes the issue. |
Installed sqlite-3.8.8.1; downgraded php from 7.0 to 5.6. Still the same error. Not sure what I am doing wrong. |
Ran this in SQLite3 and got the same error: sqlite> UPDATE jobs SET state = ?, update_date = ?, tries = tries + 1, completion = 0, last_execution_date = ? WHERE site_id = ? AND archived = 0 AND state = ? AND job_id = ? LIMIT 1; |
That's a parameterized query, so that makes sense. Can you try this query? |
Same error: sqlite> UPDATE jobs SET state = 0, update_date = 0, tries = tries + 1, completion = 0, last_execution_date = 0 WHERE site_id = 0 AND archived = 0 AND state = 0 AND job_id = 0 LIMIT 1; |
sqlite> UPDATE jobs SET state = 0, update_date = 0, tries = tries + 1, I've never tried, but can you use a limit on an update? -Erik- On 09/29/2016 10:41 AM, AGirin wrote:
|
I confirm that removing LIMIT does work but I am not sure why the code works for everybody else? I cannot find an issue on my side so far. |
Looks like UPDATE should work with LIMIT: https://www.sqlite.org/lang_update.html |
I'm at a loss. Running that query on my box definitely works. |
This might answer this: Basically my SQLite does not have SQLITE_ENABLE_UPDATE_DELETE_LIMIT enabled. From the page above: SQLITE_ENABLE_UPDATE_DELETE_LIMIT If this option is defined, then it must also be defined when using the 'lemon' tool to generate a parse.c file. Because of this, this option may only be used when the library is built from source, not from the amalgamation or from the collection of pre-packaged C files provided for non-Unix like platforms on the website. I am using rpm that I found online (tried different ones with no luck). Where did you get yours? Or did you build it yourself? |
Apparently it is a very complicated process to build sqlite3 with that option enabled. I tried this: http://stackoverflow.com/questions/1824490/how-do-you-enable-limit-for-delete-in-sqlite And it worked but... Still LIMIT does not work. I think there at ea bunch of libraires you need to recompile to make this work. Everybody suggest not to use LIMIT with UPDATE statement and use SELECT with LIMIT (UPDATE (SELECT ... LIMIT 1)). Any suggestion on what I can try changing the query to in order to see if the code works? |
Is mysql an option? We actually use 411 with that internally, but released the project with sqlite because it's usually easier to set up. |
Thanks @kiwiz. Could you provide this info? I might be able to work with it. |
I pushed a |
Thanks. I started on a new host and now I am getting this (I am using mysql): bin/create_site.php |
Should be fixed via 5c259b2. |
It is! Thanks! But now this (we are getting there!): bin/create_user.php |
Opps, we were missing a few fields in the schema. Pull + apply one more time. 🎱 |
Did that and it is fixed. Thanks again! Now I am getting this error when I login to site: except [NONE] PDOException: "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' "unixepoch") as |
Also - tried creating new search (ping) and got this: PDOException: "SQLSTATE[42S02]: Base table or view not found: 1146 Table '411.search_filters' doesn't exist" at [/var/www/411/phplib/DB.php:97] 0:[PDOStatement->execute() called at [/var/www/411/phplib/DB.php:97]] 1:[FOO\DB::query() called at [/var/www/411/phplib/Model.php:494]] 2:[FOO\ModelFinder::getByQuery() called at [/var/www/411/phplib/Element.php:134]] 3:[FOO\ElementFinder::getBySearch() called at [/var/www/411/phplib/Search.php:358]] 4:[FOO\Search->getFilters() called at [/var/www/411/phplib/Job/Search.php:66]] 5:[FOO\Search_Job->_run() called at [/var/www/411/phplib/REST/Searches.php:158]] 6:[FOO\Searches_REST->test() called at [/var/www/411/phplib/REST/Searches.php:58]] 7:[FOO\Searches_REST->POST() called at [/var/www/411/phplib/REST.php:108]] 8:[FOO\REST->route() called at [/var/www/411/htdocs/api/searches.php:6]], referer: http://test.test.com/searches/new?type=ping |
Hmm, that's an incompatibility between MySQL and SQLite. Can you create a new ticket for just this issue? The rest of 411 should work fine otherwise. (This only affect the dashboard, afaik). |
Sorry - are you referring to the first error?
|
Yup. |
What about the second one?
|
#37 --> for the first error. |
Another schema change. (Sorry, the schema we were using for MySQL was slightly different) |
Almost there I think. New error now: |
Hopefully the last one. |
Ok, this works! I was able to schedule new job but now this: /var/www/411/bin/cron.php |
Sorry - one more (now with Logstash search): PHP Fatal error: Call to undefined function ESQuery\mb_regex_encoding() in /var/www/411/vendor/kiwiz/esquery/src/Parser.php on line 3796, referer: http://test.test.com/searches/new?type=logstash |
Do you have |
The DB error is pretty vague. Can you grab the query actually being sent to the db? |
So Logstash was fixed by installing php-mbstring (missed it somehow). As far as /var/www/411/bin/cron.php - let me try to get the full string for you. |
One more error unfortunately: When I click on Feed under Alerts tab I get: except [NONE] PDOException: "SQLSTATE[42S02]: Base table or view not found: 1146 Table '411.alert_logs' doesn't exist" at [/var/www/411/phplib/DB.php:97] 0:[PDOStatement->execute() called at [/var/www/411/phplib/DB.php:97]] 1:[FOO\DB::query() called at [/var/www/411/phplib/Model.php:494]] 2:[FOO\ModelFinder::getByQuery() called at [/var/www/411/phplib/REST/Models.php:120]] 3:[FOO\Models_REST->read() called at [/var/www/411/phplib/REST/Models.php:279]] 4:[FOO\Models_REST->GET() called at [/var/www/411/phplib/REST.php:107]] 5:[FOO\REST->route() called at [/var/www/411/htdocs/api/alertlogs.php:6]], Plus with Logstash now I see this (it supposed to create alert and I think it is failing since there is not table with this name): |
I fixed alert_logs error by rename table alertlogs to alert_logs. Could you fix I it in MySQL script? |
Remaining ones should be fixed. |
Got full output of the error when I run /var/www/411/bin/cron.php. Does this help? array(5) { |
I confirm. This is fixed! Thanks a lot for all the help. I am closing the ticket. |
Hi,
It looks like jobs are not running on my system:
[411]$ /var/www/411/bin/cron.php && /var/www/411/bin/worker.php
[+] Scheduler: 1474926082
[+] Maintenance
[+] Search Health
[+] Rollups
[+] Searches
[+] Reports
[+] Summary
[+] Autoclose
[+] Cleanup
[+] Worker
[+] Worker: 1474926093
[+] Job count: 64
PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 near "LIMIT": syntax error in /var/www/411/phplib/DB.php:78
Stack trace:
#0 /var/www/411/phplib/DB.php(78): PDO->prepare('UPDATE
jobs
S...')#1 /var/www/411/phplib/Job.php(167): FOO\DB::query('UPDATE
jobs
S...', Array, 0)#2 /var/www/411/phplib/Worker.php(77): FOO\JobFinder::getAndLock('1', 1474926093)
#3 /var/www/411/bin/worker.php(34): FOO\Worker->processSite(Object(FOO\Site), 1474926093)
#4 {main}
thrown in /var/www/411/phplib/DB.php on line 78
err [411_Worker] Worker error site:[1] ret:[65280]
And I see this in the web UI:
Any ideas on why this is happening?
Thanks!
Andrew
The text was updated successfully, but these errors were encountered: