Loomio
Fri 17 Apr 2020 11:16AM

Poll does not close after that expiration time ends. Bug or my fault?

G Giuseppe Public Seen by 59

Hello Loomio Community.

In my Loomio Instance I observed a problem.

What I want to do:
I am starting to use the advice process in loomio.

The behaviour, which I aspected:
One core aspect is, that at the end of a poll - when a difined expiration date is reached - an outcome field shoud occur to define the final outcome (this is what I saw on the help website).

What I get instead (Problem description):
When the expiratipn date is reached, the poll stays on stats "ends in DATE" ... even if DATE is in the past. The poll does not close and I get no "Outcome" button.

Any idea or help?
Anyone same troubles?

Best regards,

Giuseppe

RG

Robert Guthrie Sun 19 Apr 2020 2:55AM

Hi @Giuseppe. I would first check that your crontab is setup and running. It's an hourly job to close polls.

G

Giuseppe Thu 23 Apr 2020 4:39PM

Hey @Rob Guthrie , thanks for your hint.

I checked with the command "ps -ef | grep crond".
And this is what I get:

ps -ef |grep crond 
gmt       8797  8782  0 18:36 pts/0    00:00:00 grep crond

So for me it seems, that the process is running, right?
This is what is inside the cronetab file when I run"crontab -e":

0 * * * * /snap/bin/docker exec loomio-worker bundle exec rake loomio:hourly_tasks > ~/rake.log 2>&10 
0 * * * ~/loomio-deploy/scripts/create_backup ~/loomio-deploy > ~/backup.log 2>&1; s3cmd put ~/loomio-deploy/back$
0 4 * * * /sbin/shutdown -r +5

Is there something else that I could check?

By the way, I noticed that I do not get any mail that is showing "What happend on Loomio" nor any reminder mail that a due date is beeing to be reached.

Is this a hint that something is not wirking with the crontab package?

G

Giuseppe Mon 27 Apr 2020 6:49PM

Okay. I noticed that by using "crontab -e" the user's crontab file is opened. I got crontab to work by adding the commands into the root crontab file in etc/ folder. There, the cron commands seem to work. I was able to make an automated, nightly reboot and automated nightly backup thorugh the create_backup script.

But still I was not able to get the loomio hourly tasks to run. I noticed, that the folder "/snap/bin/docker" is not available on my system - like in the command in the readme file. Is this normal? What I have is the path "/snap/docker" , but the command does not work with this.

In the "rake.log" file that is created in the cronetab, the following message occurs. Does that help?

Error: No such container: loomio-worker
G

Giuseppe Tue 28 Apr 2020 5:54PM

Hello. I do not know why - but it see,s to work now. Maybe because of some restarts but I get emails and the proposals are ended after the expriation date is reached.

I have only one missing issue - I am getting now every our a notification of a proposal that reached the limit. But I deleted the discission for that. How can I deactivate or find this proposal manually to delete it or deactivate it? Is there a possibility?

RG

Robert Guthrie Wed 29 Apr 2020 3:43AM

Sorry, can you please explain that again for me?

You're getting a proposal closed notification via email each hour? For a poll with the same id/URL each time?

G

Giuseppe Wed 29 Apr 2020 8:23AM

Yes exactly! Like you said.
But in detail, to make it clear - The notification is saying that the poll "ended", not that it was closed.


I did the following steps this morning:

I looked inside the database via psql and I searched in the polls table for the value in the "closing at" and the "closed at" column.

I noticed, that there was a value existend as a date inside the "closing at" cell, but not inside the "closed at" cell - it was empty.

I put manually a value inside, that is the same date as inside "closed at".

I will see, if this is now working and fixed.

I have no idea, how this could happen...
Maybe a reason could be, because the crontab was not working in the past and I "deleted" the proposal without closing it before. So the closed at value was never set. And now, where the crontab is working, it is giving me the notifications.

Could that be?

RG

Robert Guthrie Wed 29 Apr 2020 8:32AM

The cronjob is supposed to fill the closed_at value when it actually closes the poll.

you could run rake loomio:hourly_tasks and see what the output is to learn more about what's happening.

G

Giuseppe Mon 4 May 2020 11:43PM

I ran rake like this:

sudo docker-compose run app rake loomio:hourly_tasks > ~/rake_loomio.log

There are no messages logged.

sudo /snap/bin/docker exec loomio-worker bundle exec rake loomio:hourly_tasks > ~/rake_loomio.log

The command above does not create any outputs as well.

RG

Robert Guthrie Tue 5 May 2020 12:00AM

Can you repeat what issue you are trying to solve please?

G

Giuseppe Tue 5 May 2020 12:22AM

Sure.

- The proposals and polls are not ending automatically.

- No daily "what happend on loomio" is arriving".

I am not sure if my crontab configuration is set up well. If I understood it right, there is a difference if I run crontab -e or sudo crontab -e.

Every of my docker-compose commands, I have to run them as sudo , so that they work.

This is how my crontab look like, when I run crontab -e:

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
#
0 * * * *  root /snap/bin/docker exec loomio-worker bundle exec rake loomio:hourly_tasks > ~/rake_crontab.log 2>&1

0 0 * * *  ~/loomio-deploy/scripts/create_backup ~/loomio-deploy > ~/backup_crontab.log 2>&1

... the sudo crontab -e has no added lines.

The logfile that I get after my crontab -e is executed remains empty.

When I run the command manually as sudo with the command line sudo /snap/bin/docker exec loomio-worker bundle exec rake loomio:hourly_tasks > ~/rake.log 2>&1 , I get the following log:

opened
starting SSL for www.loomio.org:443...
SSL established, protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384
<- "POST /api/v1/usage_reports HTTP/1.1\r\nContent-Type: application/json; charset=utf-8\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nC$
<- "{\"usage_report\":{\"version\":\"2.1.9\",\"groups_count\":9,\"users_count\":38,\"discussions_count\":26,\"comments_count\":64,\"polls_count\":28,\"stances_count\":107,\"visits_count\":$
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Tue, 05 May 2020 00:19:01 GMT\r\n"
-> "Content-Type: application/json\r\n"
-> "Transfer-Encoding: chunked\r\n"
-> "Connection: close\r\n"
-> "Set-Cookie: __cfduid=d37944167e3c80408adb122b0bd6960f01588637940; expires=Thu, 04-Jun-20 00:19:00 GMT; path=/; domain=.loomio.org; HttpOnly; SameSite=Lax\r\n"
-> "X-Frame-Options: SAMEORIGIN\r\n"
-> "X-Xss-Protection: 1; mode=block\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-Download-Options: noopen\r\n"
-> "X-Permitted-Cross-Domain-Policies: none\r\n"
-> "Referrer-Policy: strict-origin-when-cross-origin\r\n"
-> "Cache-Control: no-cache\r\n"
-> "Set-Cookie: ahoy_visitor=0f4dc20b-69a0-47f9-b168-4536b9de7596; path=/; expires=Thu, 05 May 2022 00:19:01 -0000\r\n"
-> "Set-Cookie: ahoy_visit=2ce0a3c7-0174-45c9-9fa7-28355970be41; path=/; expires=Tue, 05 May 2020 00:49:01 -0000\r\n"
-> "Set-Cookie: CSRF-TOKEN=XLuZ2wypDwBMozDIjTWu81iIM8n13GDUl8MauGx5ArshfrThRKaJZU%2Bqh89nK3MtOe2tdOSWzbaVT7TfEOIHIA%3D%3D; path=/\r\n"
-> "Set-Cookie: _loomio=emFSMEtoaWloNTg1Y1FGQ2pucWZXamJrSkJHMms3ZFRBZ0NHK0tZbUp3RzRSOGtaSm5wamt1U0lwdHl6Unl5ZnAyN0t3eksxNUphbTlSY3o3R3ZlVFRNUWFoSjduTFBTK0JlOVNuUVd4T2IzNUZzVWJYZHZycENWUHY1$
-> "X-Request-Id: f2b65e02-3ccf-4245-a9d5-ff824abf4421\r\n"
-> "X-Runtime: 0.019164\r\n"
-> "Vary: Accept-Encoding\r\n"
-> "Content-Encoding: gzip\r\n"
-> "Via: 1.1 vegur\r\n"
-> "CF-Cache-Status: DYNAMIC\r\n"
-> "Expect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\r\n"
-> "Server: cloudflare\r\n"
-> "CF-RAY: 58e64998ad330746-FRA\r\n"
-> "alt-svc: h3-27=\":443\"; ma=86400, h3-25=\":443\"; ma=86400, h3-24=\":443\"; ma=86400, h3-23=\":443\"; ma=86400\r\n"
-> "cf-request-id: 0283cc536800000746e9228200000001\r\n"
-> "\r\n"
-> "19\r\n"
reading 25 bytes...
-> "\x1F\x8B\b\x00\xF5\xB0\xB0^\x00\x03\x00\x00\x00\xFF\xFF\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00"
read 25 bytes
reading 2 bytes...
-> "\r\n"
read 2 bytes
-> "0\r\n"
-> "\r\n"
Conn close

Should I use crontab -e or sudo crontab -e ?

Load More