jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

undefined method `enabled' for # #230

Closed jkryanchou closed 8 years ago

jkryanchou commented 8 years ago

I don't know what operations I have done on Minicron. While I re-install minicron in multiple times. It still occur the issue.

undefined method `enabled' for #

in /jobs/new

default configuration

jamesrwhite commented 8 years ago

I'm fairly sure this is the same issue as https://github.com/jamesrwhite/minicron/issues/231, please see that for an explanation on how to resolve.

jkryanchou commented 8 years ago

OK, I would give it a try based on your suggestion.

Tom-Gorup commented 7 years ago

I having a similar issue when attempting to create a new job; however, when running minicron db:migrate (as mentioned in #231) I get:

Unknown argument db:migrate. See `minicron help db`

/opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/lib/minicron/cli/commands.rb:85:in `block (2 levels) in add_db_cli_command': Unknown argument db:migrate. See `minicron help db` (Minicron::ArgumentError)
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.4.0/lib/commander/runner.rb:68:in `run!'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/lib/minicron/cli.rb:81:in `run'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/bin/minicron:14:in `block in <top (required)>'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/lib/minicron.rb:153:in `capture_output'
    from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/bin/minicron:12:in `<top (required)>'
    from /opt/minicron/lib/vendor/ruby/2.2.0/bin/minicron:23:in `load'
    from /opt/minicron/lib/vendor/ruby/2.2.0/bin/minicron:23:in `<main>'

So, instead I ran minicron db migrate which gave me this output:

$ minicron db migrate
D, [2017-01-12T09:21:59.352993 #24650] DEBUG -- :   ActiveRecord::SchemaMigration Load (0.1ms)  SELECT "schema_migrations".* FROM "schema_migrations"

But, I still ended up getting the same: undefined method `enabled' for #

I also attempted restarting with minicron db setup and minicron db migrate, but with the same result.

Output from server when attempting to create a new job:

D, [2017-01-12T09:28:41.110021 #23596] DEBUG -- :   Minicron::Hub::Host Load (0.2ms)  SELECT  "hosts".* FROM "hosts" WHERE "hosts"."id" = ? LIMIT 1  [["id", 1]]
D, [2017-01-12T09:28:41.111328 #23596] DEBUG -- :    (0.1ms)  begin transaction
D, [2017-01-12T09:28:41.112906 #23596] DEBUG -- :   Minicron::Hub::Job Exists (0.2ms)  SELECT  1 AS one FROM "jobs" WHERE "jobs"."name" = 'testing' LIMIT 1
D, [2017-01-12T09:28:41.114023 #23596] DEBUG -- :   Minicron::Hub::Host Load (0.1ms)  SELECT  "hosts".* FROM "hosts" WHERE "hosts"."id" = ? LIMIT 1  [["id", 1]]
D, [2017-01-12T09:28:41.114828 #23596] DEBUG -- :    (0.1ms)  rollback transaction
D, [2017-01-12T09:28:41.116227 #23596] DEBUG -- :   Minicron::Hub::Host Load (0.2ms)  SELECT "hosts".* FROM "hosts"
D, [2017-01-12T09:28:41.119420 #23596] DEBUG -- :   Minicron::Hub::Execution Load (0.2ms)  SELECT  "executions".* FROM "executions"  ORDER BY "executions"."created_at" DESC, "executions"."started_at" DESC LIMIT 10
x.x.x.x - - [12/Jan/2017:09:28:41 -0500] "POST /jobs/new HTTP/1.1" 200 2341 0.0136