cuttlefish icon indicating copy to clipboard operation
cuttlefish copied to clipboard

Can't deploy cuttlefish

Open olegbliaher opened this issue 6 years ago • 10 comments

Hi all,

I've been trying to deploy Cuttlefish locally on a few different Ubuntu machines, 14.04 and 18.04, both virtual and physical. On all of them I get the following when I try to run ./provision_production.sh:

root@server:~/cuttlefish# ./provision_production.sh
SSH password:
ERROR! the role 'newrelic.newrelic-infra' was not found in /root/cuttlefish/provisioning/roles:/root/cuttlefish/provisioning/roles:/root/cuttlefish/provisioning/roles:/root/cuttlefish/provisioning

The error appears to have been in '/root/cuttlefish/provisioning/roles/cuttlefish-app/meta/main.yml': line 125, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - role: cuttlefish-postfix
  - role: newrelic.newrelic-infra
    ^ here

When I try to run bundle exec cap deploy:setup, I get the following error:

root@cuttlefish:~/cuttlefish# bundle exec cap deploy:setup
DEPRECATED: requiring honeybadger/capistrano has been deprecated. Require capistrano/honeybadger instead.
Traceback (most recent call last):
        29: from /usr/share/rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `<main>'
        28: from /usr/share/rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
        27: from /usr/share/rvm/gems/ruby-2.5.1/bin/cap:23:in `<main>'
        26: from /usr/share/rvm/gems/ruby-2.5.1/bin/cap:23:in `load'
        25: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/bin/cap:4:in `<top (required)>'
        24: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/cli/execute.rb:14:in `execute'
        23: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/cli/execute.rb:31:in `execute!'
        22: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/cli/execute.rb:65:in `load_recipes'
        21: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/cli/execute.rb:65:in `each'
        20: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
        19: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:86:in `load'
        18: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:86:in `each'
        17: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:86:in `block in load'
        16: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:89:in `load'
        15: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
        14: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:93:in `load'
        13: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
        12: from Capfile:5:in `load'
        11: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:86:in `load'
        10: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:86:in `each'
         9: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:86:in `block in load'
         8: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:89:in `load'
         7: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
         6: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:93:in `load'
         5: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
         4: from ./config/deploy.rb:36:in `load'
         3: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/namespaces.rb:76:in `namespace'
         2: from /usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/namespaces.rb:76:in `instance_eval'
         1: from ./config/deploy.rb:37:in `block in load'
/usr/share/rvm/gems/ruby-2.5.1/gems/capistrano-2.15.9/lib/capistrano/configuration/namespaces.rb:92:in `task': expected a block (ArgumentError)

What am I doing wrong? I've installed all the required dependencies. Any ideas are welcome.

olegbliaher avatar Oct 08 '18 11:10 olegbliaher

It's trying to use Ansible but the external roles haven't been added yet.

Can you try running the below from the cuttlefish root before running ./provision_production.sh ansible-galaxy install -r provisioning/requirements.yml -p roles

You may want to replace the secret variables located in provisioning/roles/cuttlefish-app/vars/main.yml as well to avoid the need for a ~/.cuttlefish_ansible_vault_pass.txt

benrfairless avatar Oct 08 '18 12:10 benrfairless

If I just run the command as you said, I get the following error:

[WARNING]: - rvm_io.ruby was NOT installed successfully: - sorry, rvm_io.ruby was not found on https://galaxy.ansible.com.

I've tried running it with --ignore-errors, but that doesn't help, I still get exactly the same error after running ./provision_production.sh

olegbliaher avatar Oct 08 '18 12:10 olegbliaher

I've just raised a PR to fix that - Ansible changed the name of the requirement recently, if you make the change in my PR then you'll get past that error.

benrfairless avatar Oct 08 '18 12:10 benrfairless

I've done that, I changed rvm_io.ruby to rvm.ruby in all the relevant Ansible files.I still get this error when I run ./provision_production.sh:

ERROR! the role 'newrelic.newrelic-infra' was not found in
/root/cuttlefish/provisioning/roles:/root/cuttlefish/provisioning/roles:/root/cuttlefish/provisioning/roles:/root/cuttlefish/provisioning

The error appears to have been in
'/root/cuttlefish/provisioning/roles/cuttlefish-app/meta/main.yml': line
125, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - role: cuttlefish-postfix
  - role: newrelic.newrelic-infra
    ^ here

On Mon, 8 Oct 2018 at 15:02, Ben Fairless [email protected] wrote:

I've just raised a PR to fix that - Ansible changed the name of the requirement recently, if you make the change in my PR then you'll get past that error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mlandauer/cuttlefish/issues/324#issuecomment-427821842, or mute the thread https://github.com/notifications/unsubscribe-auth/AcZbP16_KKipS5eQZGplOwoKH9zgMRccks5ui0zLgaJpZM4XMyBm .

olegbliaher avatar Oct 08 '18 13:10 olegbliaher

My apologies, my above command was wrong.

Correct one is: ansible-galaxy install -r provisioning/requirements.yml -p provisioning/roles

benrfairless avatar Oct 08 '18 13:10 benrfairless

Excellent, it helped!! Now the Ansible playbook is running. However, I now get the following error:

TASK [newrelic.newrelic-infra : setup agent config]
****************************************************************************************************************************************fatal:
[cuttlefish.internal.bluetest.se]: FAILED! => {"changed": false,
"msg": "AnsibleError: An unhandled exception occurred while templating
'{u'license_key': u'{{ new_relic_license_key
}}'}'. Error was a <class 'ansible.parsing.vault.AnsibleVaultError'>,
original message: Decryption failed (no vault secrets were found that
could decrypt)"}
        to retry, use: --limit @/root/cuttlefish/provisioning/playbook.retry

PLAY RECAP *********************************************************************************************************************************************************************************cuttlefish.internal.bluetest.se
: ok=11   changed=0    unreachable=0    failed=1

Does it really need New Relic? Does that mean I must purchase it? Or can I just comment out the lines with NewRelic-related directives? On Mon, 8 Oct 2018 at 15:30, Ben Fairless [email protected] wrote:

My apologies, my above command was wrong.

Correct one is: ansible-galaxy install -r provisioning/requirements.yml -p provisioning/roles

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

olegbliaher avatar Oct 08 '18 13:10 olegbliaher

I suspect that the Ansible Script is setup to work with the OAF version of Cuttlefish, and I know that OAF use NewRelic.

You will probably need to reconfigure the Ansible Playbook to deploy the software as you would like, or use Docker to deploy a development instance.

— Ben Fairless

OpenAustralia Foundation

openaustralia | planningalerts | electionleaflets | righttoknow | theyvoteforyou | morph

--- original message ---

Mon, 8 Oct at 9:47 pm, [email protected] wrote:

Excellent, it helped!! Now the Ansible playbook is running. However, I

now get the following error:

TASK [newrelic.newrelic-infra : setup agent config]

****************************************************************************************************************************************fatal:

[cuttlefish.internal.bluetest.se]: FAILED! => {"changed": false,

"msg": "AnsibleError: An unhandled exception occurred while templating

'{u'license_key': u'{{ new_relic_license_key

}}'}'. Error was a <class 'ansible.parsing.vault.AnsibleVaultError'>,

original message: Decryption failed (no vault secrets were found that

could decrypt)"}

to retry, use: --limit @/root/cuttlefish/provisioning/playbook.retry

PLAY RECAP *********************************************************************************************************************************************************************************cuttlefish.internal.bluetest.se

: ok=11 changed=0 unreachable=0 failed=1

Does it really need New Relic? Does that mean I must purchase it? Or

can I just comment out the lines with NewRelic-related directives?

On Mon, 8 Oct 2018 at 15:30, Ben Fairless [email protected] wrote:

My apologies, my above command was wrong.

Correct one is: ansible-galaxy install -r provisioning/requirements.yml -p provisioning/roles

You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub, or mute the thread.

You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or mute the thread. --- end of original message ---

benrfairless avatar Oct 09 '18 04:10 benrfairless

Ok, so commenting out the line that had to do with New Relic helped. Now the Ansible script gets hungup on the following task:

TASK [cuttlefish-backup : Copy database-backup configuration] *****************************************************************************************************************************fatal: [fishfish.internal.bluetest.se]: FAILED! => {"changed": false, "msg": "AnsibleError: An unhandled exception occurred while templating '{{ encrypted_backup_passphrase }}'. Error was a <class 'ansible.parsing.vault.AnsibleVaultError'>, original message: Decryption failed (no vault secrets were found that could decrypt)"}
        to retry, use: --limit @/root/cuttlefish/provisioning/playbook.retry

I've created ~/.cuttlefish_ansible_vault_pass.txt and used a long string as a vault pass. What am I missing?

I had also tried running cuttlefish from docker, but couldn't figure out where I can find the login credentials. Do I need to "hack" the database somehow?

olegbliaher avatar Oct 09 '18 10:10 olegbliaher

I ran into this as well - Does this mean that cuttlefish cannot be set up with ansible like it says in the readme.md? I put my little test project with cuttlefish on hold until I hear back from someone in the know :)

I really need a sendgrid/mailgun alternative :P I would rather have a nice interface with statistics than just run a postfix server...

daath avatar Nov 18 '18 22:11 daath

@daath I know what you mean, been looking around a bit. I can really recommend this one: https://github.com/atech/postal

Easy to set up and working like a charm.

olegbliaher avatar Nov 19 '18 07:11 olegbliaher