Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue during database pull/push with Ansible 2.4.1.0 #9

Closed
partounian opened this issue Dec 12, 2017 · 16 comments
Closed

Issue during database pull/push with Ansible 2.4.1.0 #9

partounian opened this issue Dec 12, 2017 · 16 comments
Labels

Comments

@partounian
Copy link

partounian commented Dec 12, 2017

TASK [Push database dump from development to staging]


System info:
Ansible 2.4.1.0; Darwin
Trellis at "Switch from .dev to .test"

The task includes an option with an undefined variable. The error was: {{
to_host.wordpress_sites[site].local_path }}: 'dict object' has no attribute
'wordpress_sites'

The error appears to have been in '[redacted]/database-push.yml': line 49, column 7,
but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Push database dump from development to {{ env }}
  ^ here

We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

with_items:
  - {{ foo }}

Should be written as:

with_items:
  - "{{ foo }}"

exception type: <class 'ansible.errors.AnsibleUndefinedVariable'>
exception: {{ to_host.wordpress_sites[site].local_path }}: 'dict object' has
no attribute 'wordpress_sites'
fatal: [staging_host]: FAILED! => {"failed": true}

Note: An uploads push worked fine

Edit: This might also help

ERROR! The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'env' is undefined

The error appears to have been in '[redacted]/database-push.yml': line 2, column 3, but may ...

Edit 2: It also happens for pulling.

@partounian partounian changed the title Issue during push to staging Issue during database push to staging Dec 12, 2017
@partounian partounian changed the title Issue during database push to staging Issue during database pull/push to staging Dec 14, 2017
@valentinocossar
Copy link
Owner

Thank you for the feedback, now I have to reproduce the problem and fix it. I'll update the issue with more info as soon as possible.

@partounian
Copy link
Author

No problem, thank you @valentinocossar for the plugin 👍

@partounian
Copy link
Author

Hey @valentinocossar have you had the chance to look at the issue?

@valentinocossar
Copy link
Owner

Hi @partounian, sorry for the delay, I've found that the problem is not related to the tool itself but it's an Ansible bug.
The problem only affects Ansible 2.4.1.0 and it has been fixed in Ansible 2.4.2.0, in fact, the tool works without problems using Ansible 2.4.0.0 or Ansible 2.4.2.0.

These are the issues related to the problem you've reported: #32466, #31758, #31755.
And here you can find the pull request with the fix #32269.

Now I would like to do more tests to ensure everything works well and then I'll update the README with an alert saying not to use Ansible 2.4.1.0 with this tool.

Thank you for the feedback.

@valentinocossar valentinocossar changed the title Issue during database pull/push to staging Issue during database pull/push with Ansible 2.4.1.0 Jan 4, 2018
valentinocossar added a commit that referenced this issue Jan 4, 2018
@partounian
Copy link
Author

Thank you for the update. Funny enough, now it seems like uploads pulling does not work or at least it throws this error "No such file or directory (2)\nrsync: rename failed for"

Upload pushing seems to work but not sure if it's taking a long time for mine to complete or that it does not complete the ansible prompt.

@valentinocossar
Copy link
Owner

I've not modified anything other than the README and I've not plans to release a new version only for this quick improvement. Could you open another issue for this bug with more information? Thank you.

@luckyluggi
Copy link

I still have this bug with ansible version 2.4.3.0
I also tried it with 2.4.0.0, 2.4.1.0, 2.4.2.0 and even 2.5.0.0
i always get this same error:


The task includes an option with an undefined variable. The error was: {{
to_host.wordpress_sites[site].local_path }}: 'dict object' has no attribute
'wordpress_sites'

The error appears to have been in '/home/me/dev/example.com/trellis
/database-push.yml': line 49, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Push database dump from development to {{ env }}
  ^ here

We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

with_items:
  - {{ foo }}

Should be written as:

with_items:
  - "{{ foo }}"

exception type: <class 'ansible.errors.AnsibleUndefinedVariable'>
exception: {{ to_host.wordpress_sites[site].local_path }}: 'dict object' has
no attribute 'wordpress_sites'
fatal: [IP-ADDRESS]: FAILED! => {}
to retry, use: --limit @/home/me/dev/example.com/trellis/database-push.retry

am i doing something wrong? (i try to set this up the fiorst time)
The command i'm running is (inside /trellis)
./bin/database.sh production example.com push

PS: the file pushing works

@valentinocossar
Copy link
Owner

Hi, Trellis version? macOS version?

@luckyluggi
Copy link

Hi,
I'm working on ubuntu 17.10.
The Server is an Ubuntu 16 DO-droplet.
And i don't know where to see my actual trellis version, but since i pulled it 2 days ago it has to be the newest version i think.

@valentinocossar
Copy link
Owner

Sorry, but as reported in the README this tool has been tested only with macOS. I don't have a PC with Ubuntu to test it and unfortunately, I don't have so much time to support other operating systems. If you want, you can provide help to support Ubuntu, feel free to open a new issue or pull request.

@luckyluggi
Copy link

oh shit. i didn't see that its only tested on macos.
Thx anyways!

@valentinocossar
Copy link
Owner

No worries! 🙂

@christophfahle
Copy link

Hey Valentino, thanks for this little tool. It sounds like a really good thing to have. I am running on OSX 10.13.4 with Ansible 2.4.3.0 installed but I still get the same error. Did you ever find out what caused this error or get close to a fix?

Thanks in advance!!!

Christoph

@valentinocossar
Copy link
Owner

Hi @christophfahle, which version of Trellis are you using? Thank you!

@davebowker
Copy link

Adding to this, I opened up a new issue but looks like it could be this issue? Not sure.

Mac OS 10.13.5
Trellis Version 1.0.0-rc.2

@valentinocossar
Copy link
Owner

This issue was related to an Ansible 2.4.1.0 bug, fixed in Ansible 2.4.2.0. So I prefer to investigate your problem in the issue you've opened and close the comments to this one.

Repository owner locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants