Page 1 of 1

update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 11:07
by Sadok
Hi. After latest "git pull" "update_daemon2.php wrote to log:

Code: Select all

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /usr/repo/Tiny-Tiny-RSS/include/db.php on line 80

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /usr/repo/Tiny-Tiny-RSS/include/db.php on line 89
Query <i>INSERT INTO ttrss_error_log
                                (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES
                                (2, 'mysql_result() expects parameter 1 to be resource, boolean given', 'include/db.php', '98', '', NULL, NOW())</i> failed: Cannot add or update a child row: a foreign key constraint fails (`ttrss`.`ttrss_enclosures`, CONSTRAINT `ttrss_enclosures_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `ttrss_entries` (`id`) ON DELETE CASCADE)[06:55:13/52816] removing lockfile (52816)...
Query <i>INSERT INTO ttrss_error_log
                                (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES
                                (2, 'mysql_query(): MySQL server has gone away', 'include/db.php', '65', '', NULL, NOW())</i> failed: MySQL server has gone away[06:55:13/52817] removing lockfile (52817)...
[06:55:13/52815] [reap_children] child 52816 seems active but lockfile is unlocked.
[06:55:13/52815] [reap_children] child 52817 reaped.
[06:55:13/52815] [SIGCHLD] jobs left: 0
[06:55:13/52815] [SIGCHLD] jobs left: 0


MySQL 5.5.30

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 11:29
by fox
update the database

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 12:05
by xtaz
I'm also having it crash on me with a different error. And my database is running 118.sql version which appears to be the latest, it updated to that yesterday afternoon but I'm only having this issue since the latest pull this morning:

Code: Select all

[07:59:50/68419] [SIGCHLD] jobs left: 0
[08:00:49/68419] [MASTER] active jobs: 0, next spawn at 0 sec.
Query <i>INSERT INTO ttrss_error_log
                                (errno, errstr, filename, lineno, context, owner_uid, created_at) VALUES
                                (2, 'Error while sending INIT_DB packet. PID=68419', 'include/db.php', '33', '', NULL, NOW())</i> failed: MySQL server has gone away
[08:00:50/68419] removing lockfile (master)...


And my database definitely hasn't gone away as I'm using it for other things.

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 12:16
by fox
I guess the database handle might get closed which messes with logging.

Edit: or it tries to connect to log something while the script is ending.

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 12:25
by fox
Yeah I think I broke something in there...

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 12:37
by fox
Try updating.

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 12:53
by xtaz
Seems to be working now. Thanks!

Re: update_daemon2.php crash after latest

Posted: 17 Apr 2013, 21:27
by sleeper_service
fox wrote:update the database


is there a way to update the db via command line?

I'm thinking about a script to stop the update daemon, do a git pull, then update the db and start the update daemon back up.

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 21:41
by fox
Yes, check update.php --help.

Re: update_daemon2.php crash after latest

Posted: 17 Apr 2013, 22:48
by feader
sleeper_service wrote:I'm thinking about a script to stop the update daemon, do a git pull, then update the db and start the update daemon back up.

This could be done with a git hook, but I haven't yet figured out which is the right one for this. Then the script could also do a db dump before updating the db, just in case.

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 23:07
by sleeper_service
fox wrote:Yes, check update.php --help.


thank you, good vomiting gnome ;)

Re: update_daemon2.php crash after latest

Posted: 17 Apr 2013, 23:09
by sleeper_service
feader wrote:
sleeper_service wrote:I'm thinking about a script to stop the update daemon, do a git pull, then update the db and start the update daemon back up.

This could be done with a git hook, but I haven't yet figured out which is the right one for this. Then the script could also do a db dump before updating the db, just in case.


the tricky bit will be automating the updating of config.php, I already use diff and patch to add new bits, but so far I've just manually edited out the customized variables from the patch file to keep them from being reset to default.

Re: update_daemon2.php crash after latest "git pull"

Posted: 17 Apr 2013, 23:31
by feader
sleeper_service wrote:the tricky bit will be automating the updating of config.php, I already use diff and patch to add new bits, but so far I've just manually edited out the customized variables from the patch file to keep them from being reset to default.

I recently had to do some … testing, and maybe it is better to do it in the opposite direction (merging -dist into config.php), since ttRSS doesn't complain about to much variables, and the basic definitions (db data, URL) seem stable. Best experience I had so far was an interactive merge, and I don't have a good feeling when this would be done automatically.
But the other parts are doable.

Re: update_daemon2.php crash after latest "git pull"

Posted: 18 Apr 2013, 01:08
by sleeper_service
feader wrote:
sleeper_service wrote:the tricky bit will be automating the updating of config.php, I already use diff and patch to add new bits, but so far I've just manually edited out the customized variables from the patch file to keep them from being reset to default.

I recently had to do some … testing, and maybe it is better to do it in the opposite direction (merging -dist into config.php), since ttRSS doesn't complain about to much variables, and the basic definitions (db data, URL) seem stable. Best experience I had so far was an interactive merge, and I don't have a good feeling when this would be done automatically.
But the other parts are doable.


I'm thinking copy dist over to config, then apply a patch with the variables I have set up... that'd work 'cept for when mr sly fox changes the variable names, like he recently did with the smtp server.