Skip to content

Error reporting for syntax errors in recurring.yml #722

@noproblemwiththat

Description

@noproblemwiththat

I had a recurring.yml with a syntax error

production:
  gannets:
    class: 'GannetCronJob'
    queue: 'default'
    schedule: '0 * * * ^'

Fat finger event, entirely my fault, the ^ is the next key to * on my keyboard. When I deployed this by Capistrano which calls systemctl I see

00:42 solid_queue:start
      01 systemctl --user start cpt-city-queue.service
    ✔ 01 cpt-city@phillips.shef.ac.uk 0.267s

but quickly notice there are no workers running and that systemctl status reports that the service is not running. There is nothing reported by journalctl, the queue log files are empty.

Now I can see how this happens, systemctl kicks off the process, that daemonises, reads its configuration (possibly that configures logging, so before logs opened), and errors.

If I start my dev solid-queue with the same syntax error introduced then

$ bundle exec rake solid_queue:start
Invalid recurring tasks:
- gannets: Schedule is not a supported recurring schedule
Exiting...

Nice, but in the systemctl deploy I guess that the error will write to stdout which is not there (or redirected to /dev/null) since daemonised. So it looks like there is a "blind spot" where syntax errors in configuration produce systemctl success and no error output at all.

Now I will be extremely careful editing configuration files in future, but it would be really nice if there were some facility to check the configuration files for validity? (The obvious running of the rake solid_queue:start will only check the development part of the configuration, and will fail for production since there is no DB). Or possibly that is there already and I couldn't find it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions