Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

'monit http interface is not enabled' error while restarting sidekiq #81

Closed
inket opened this issue May 23, 2017 · 2 comments
Closed

'monit http interface is not enabled' error while restarting sidekiq #81

inket opened this issue May 23, 2017 · 2 comments

Comments

@inket
Copy link

inket commented May 23, 2017

Hi! First of all, thank you for this awesome cookbook 👍

I'm having an issue during setup because monit is expected some configuration in order to respond to commands like restart. I need to start sidekiq; This is the first deploy.

Here's the relevant log:

[2017-05-23T02:30:23+00:00] INFO: Processing execute[start puma] action run (opsworks_ruby::deploy line 55)
[2017-05-23T02:30:24+00:00] INFO: execute[start puma] ran successfully
[2017-05-23T02:30:24+00:00] INFO: Processing execute[monit restart sidekiq_redacted-1] action run (opsworks_ruby::deploy line 42)
[2017-05-23T02:30:24+00:00] INFO: Retrying execution of execute[monit restart sidekiq_redacted-1], 2 attempt(s) left
[2017-05-23T02:30:26+00:00] INFO: Retrying execution of execute[monit restart sidekiq_redacted-1], 1 attempt(s) left
[2017-05-23T02:30:28+00:00] INFO: Retrying execution of execute[monit restart sidekiq_redacted-1], 0 attempt(s) left
 
================================================================================
Error executing action `run` on resource 'execute[monit restart sidekiq_redacted-1]'
================================================================================
 
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of monit restart sidekiq_redacted-1 ----
STDOUT: 
STDERR: /etc/monit/monitrc:290: Include failed -- Success '/etc/monit/conf-enabled/*'
Action restart not possible - monit http interface is not enabled, please add the 'set httpd' statement
---- End output of monit restart sidekiq_redacted-1 ----
Ran monit restart sidekiq_redacted-1 returned 1

Any idea what's wrong?

@ajgon
Copy link
Owner

ajgon commented May 26, 2017

Action restart not possible - monit http interface is not enabled, please add the 'set httpd' statement

This is the problem. For monit CLI to work, it needs to connect to monit API daemon, which uses HTTP requests/responses. But this is weird, IIRC correctly, preinstalled monit on AWS servers should have this configured.

Are you using Ubuntu or Amazon Linux? Can you paste me your stack.json as well (just don't forget to remove all sensitive information :) )

Also, there is a workaround - I'm provisioning this, when using vanilla Ubuntu in tests - so you can add a opsworks_ruby::provision to your setup phase - this should enable httpd on monit.
From my side, I think it's a good idea, to add it to setup phase as well, since obviously Amazon changed something in the process (again).

@inket
Copy link
Author

inket commented May 29, 2017

Exactly. I don't think monit is preinstalled because it gets installed on the first run. I'm using Ubuntu 16.04 LTS. I've fixed the issue on my fork some days ago: inket@d6b2e31

The stack.json is very basic so I don't think it's affecting it:

{
  "deploy": {
    "appname": {
      "global": {
        "environment": "staging",
        "rollback_on_error": false
      },
      "database": {
        "adapter": "postgresql",
        [redacted]
      },
      "framework": {
        "envs_in_console": true,
        "assets_precompile": false
      },
      "worker": {
        "adapter": "sidekiq",
        "process_count": 1
      }
    }
  }
}

But like you said, it would be a good idea to include it in the setup phase.

@ajgon ajgon closed this as completed in 6e299d8 May 30, 2017
ajgon added a commit that referenced this issue May 31, 2017
ajgon added a commit that referenced this issue May 31, 2017
dotnofoolin pushed a commit to dotnofoolin/opsworks_ruby that referenced this issue Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants