jamesrwhite / minicron

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

[API Error] Validation failed: Name has already been taken (Minicron::ClientError) #260

Closed SpartanJ closed 7 years ago

SpartanJ commented 7 years ago

Hi! I've installed minicron successfully, imported my old cron jobs but they seem to fail to run. Since i didn't see any execution of my cron jobs i tried to execute it manually to see what was happening and received this error output:

# minicron run 'php /var/www/vhosts/5rhythms.com/sandbox.5rhythms.com/index.php cron clean_user_transaction_log'
[API Error] Validation failed: Name has already been taken

/opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/lib/minicron/transport/client.rb:145:in `send': [API Error] Validation failed: Name has already been taken (Minicron::ClientError)
        from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/lib/minicron/transport/client.rb:37:in `init'
        from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.7.1480251919/lib/minicron/cli/commands.rb:198:in `block (2 levels) in add_run_cli_command'
        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>'

I have no idea what this could mean. But it's happening on two different installations.

Do you have any hint for me?

I've minicron installed on 3 PCs, 2 are giving me this same error, the other one is working ok.

SpartanJ commented 7 years ago

Ok, i found out what was causing the error, the word "cron" is present in my command to execute ( this was the command php /var/www/vhosts/5rhythms.com/sandbox.5rhythms.com/index.php cron clean_user_transaction_log ), for some reason i don't know this causes the error. I just changed the command to not use the word cron and now is working.

jamesrwhite commented 7 years ago

Hmm, I don't think it has anything to do with removing the word cron specifically, more just that you changed the command being run as the error suggests Name has already been taken. The name of a job has to be unique. Are you running this job on more than one server?

jamesrwhite commented 7 years ago

I'm closing due to lack of a reply, please feel free to re-open it if needed.