Crontab errors
I know that this is not strictly a loomio issue but as I followed the instructions on using docker on digitalocean I am hoping someone can help.
I am getting the following errors whenever the jobs required by loomio are attempted to run via crontab.
"level="fatal" msg="cannot enable tty mode on non tty input"
any ideas on how to fix?
Thanks @mc0e - I set the crontab entries exactly as above. But also included the option to log the output so I could see what was going on.
I tried the "-t" flag but it is not available.
I will try running "docker exec" shortly and see how that goes. Thanks for your input.
I'd run the commands from the command line first to see why it's looking for input. Maybe it's asking for a password or some such thing?
Running the commands from command line is throwing no errors at all. So could it be permissions that crontab is using? Sorry not strong in linux or rails
The user running those cron commands needs to be able to run docker commands. It's expected to be root, but basically what's needed is to be able to write to Docker's socket, which is group writable by the docker group our some such thing (currently writing on my phone, so haven't checked the detail)
(belatedly)
Those cron commands run in the host environment, but everything after /usr/local/bin/dokku run loomio is a command that gets passed into the docker container.
I'm not clear where you were adding your logging, but without seeing your exact cron command (and knowing a bit of rails stuff) it's not clear how the logging is taking place. Is it happening within the container, or in the host? If in the container, is it logging to stdout or stderr, or is it trying to use syslog, writing direct to some file, or writing to a tty that it presumes to be present?
If this is still an issue, post your exact cron entry.
I'm not entirely sure whether I just missed it before, or if something changed, but as of now I have a mail spool full of messages along the lines of what adam reported.
If dokku has jobs which are intended to run as cron jobs, and they expect to have an attached tty, then I'd say that is a bug which should be fixed.
You should probably post the exact cron entry you are trying to run.
I'm not familiar with digital ocean's documentation (link?), but here's what the loomio docs suggest:
These jobs don't seem to cause a problem like what you describe.
In general, the command you run inside the docker container shouldn't want stdin, or a tty, and ideally you'd make that so. Failing that, there's the '-t' flag to docker. I'm not sure if dokku gives you access to it, but you could base your cron job on
docker exec -tinstead ofdokku run.If your job actually wants something from stdin though it's still going to be in trouble. Maybe try running it from a terminal to see what's happening there.