sipcapture / homer5-docker

HOMER 5 Docker Containers (OBSOLETE)
http://sipcapture.org
40 stars 61 forks source link

New tables for Homer data are not created. #24

Closed leftyb closed 8 years ago

leftyb commented 8 years ago

Looks like an issue at the homer-cron container.

5(21) ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver error on query: Table 'homer_data.sip_capture_registration_20161001' doesn't exist (1146)
5(21) ERROR: [db_query.c:235]: db_do_insert_cmd(): error while submitting query
5(21) ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver error on query: Table 'homer_data.sip_capture_registration_20161001' doesn't exist (1146)

When I restart the containers, the tables are created properly for 3 days time.

lmangani commented 8 years ago

saint @dougbtv could you take a peek?

leftyb commented 8 years ago

Hi any progress on that issue? Thank you .

dougbtv commented 8 years ago

I started to take a cursory glance but hadn't returned to it -- any chance you can try running the cron script by hand (enter the container, crontab -l, run that script) and show us the output [if any]).

(my apologies that I've been on the road / some life changes slowing me down here!)

-Doug

On Mon, Oct 10, 2016, 7:55 AM Lefteris Banos notifications@github.com wrote:

Hi any progress on that issue? Thank you .

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/sipcapture/homer-docker/issues/24#issuecomment-252597843, or mute the thread https://github.com/notifications/unsubscribe-auth/AFN_vdGLARYKKhESUPWV5abAQcxLvvd6ks5qyie2gaJpZM4KNhTP .

leftyb commented 8 years ago

Hi @dougbtv,

Thank you very much for you response. Actually after I run the script manually tables created properly. Looks like that the cron job is not run at all. My crontab -l :

crontab -l
30 3 * * * /opt/new/homer_rotate >> /var/log/cron.log 2>&1

That is a known issue on docker and ubuntu. Will try to provide more information on that.

Thanks again.

leftyb commented 8 years ago

Hi @dougbtv,

At the hommer-cron output that message is appearing : "Cannot make/remove an entry for the specified session"

And looks same with the issue that is solved here: http://stackoverflow.com/questions/21926465/issues-running-cron-in-docker-on-different-hosts

Will test and update.

Thank you.

leftyb commented 8 years ago

Ok the solution is to add:

# Init rotation
/opt/new/homer_rotate

# Ensure cron is allowed to run
sed -i 's/^\(session\s\+required\s\+pam_loginuid\.so.*$\)/# \1/g' /etc/pam.d/cron

at the end of cron/run.sh

dougbtv commented 8 years ago

Nice sleuthing! I'll look into adding that (and trying to write a Travis test for it) soon, or feel free to submit a pull request, too.

Appreciate it.

On Mon, Oct 10, 2016, 8:52 AM Lefteris Banos notifications@github.com wrote:

Ok the solution is to add:

Init rotation

/opt/new/homer_rotate

Ensure cron is allowed to run

sed -i 's/^(session\s+required\s+pam_loginuid.so.*$)/# \1/g' /etc/pam.d/cron

at the end of cron/run.sh

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/sipcapture/homer-docker/issues/24#issuecomment-252609955, or mute the thread https://github.com/notifications/unsubscribe-auth/AFN_vajXa-I5eZy1GfIy3nOXtc-XdS4Lks5qyjUTgaJpZM4KNhTP .

lmangani commented 8 years ago

Thanks @dougbtv and @leftyb for nailing this down!

dougbtv commented 8 years ago

Alright, thanks again for the contribution of the fix. I went ahead and put in some tests for Travis to verify that the cron job runs... I've got it in PR #27

dougbtv commented 8 years ago

Alright, I went ahead and made the tests more reproducible, so, I think this should close out the issue. If anyone has any questions / comments, feel free to add 'em, otherwise I'm closing for now. Thanks again.