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

Ansible play fails due to wrong version #72

Closed
jonathon2nd opened this issue Nov 24, 2020 · 3 comments · Fixed by #74
Closed

Ansible play fails due to wrong version #72

jonathon2nd opened this issue Nov 24, 2020 · 3 comments · Fixed by #74

Comments

@jonathon2nd
Copy link

jonathon2nd commented Nov 24, 2020

Hello, our reoccurring jobs started failing with this error


TASK [stefangweichinger.ansible_rclone : Do stable install] ********************
included: /tmp/awx_17505_4r2_w45k/requirements_roles/stefangweichinger.ansible_rclone/tasks/stable.yml for localhost

TASK [stefangweichinger.ansible_rclone : Check latest stable rclone version number] ***
ok: [localhost] => {"accept_ranges": "bytes", "changed": false, "connection": "close", "content": "rclone v1.53.3\n", "content_length": "15", "content_type": "text/plain; charset=utf-8", "cookies": {}, "cookies_string": "", "date": "Tue, 24 Nov 2020 20:17:29 GMT", "elapsed": 0, "etag": "\"qk20dif\"", "last_modified": "Thu, 19 Nov 2020 17:24:54 GMT", "msg": "OK (15 bytes)", "redirected": false, "server": "Caddy", "status": 200, "url": "https://downloads.rclone.org/version.txt"}

TASK [stefangweichinger.ansible_rclone : Set variable to latest stable version number] ***
ok: [localhost] => {"ansible_facts": {"rclone_version": "1.53.3"}, "changed": false}

TASK [stefangweichinger.ansible_rclone : Get rclone stable version 1.53.3] *****
skipping: [localhost] => {"changed": false, "msg": "skipped, since /tmp/rclone_setup/rclone-v1.53.3-linux-amd64 exists"}

TASK [stefangweichinger.ansible_rclone : Get list of files extracted from the rclone archive] ***
ok: [localhost] => {"changed": false, "examined": 3, "files": [{"atime": 1599987430.0, "ctime": 1601417184.3817184, "dev": 44, "gid": 0, "gr_name": "root", "inode": 101401429, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mode": "0755", "mtime": 1599987430.0, "nlink": 2, "path": "/tmp/rclone_setup/rclone-v1.53.1-linux-amd64", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 92, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": true, "xoth": true, "xusr": true}, {"atime": 1603725122.0, "ctime": 1603727445.8468351, "dev": 44, "gid": 0, "gr_name": "root", "inode": 721795, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mode": "0755", "mtime": 1603725122.0, "nlink": 2, "path": "/tmp/rclone_setup/rclone-v1.53.2-linux-amd64", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 92, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": true, "xoth": true, "xusr": true}, {"atime": 1605806149.0, "ctime": 1605808263.238737, "dev": 44, "gid": 0, "gr_name": "root", "inode": 67936871, "isblk": false, "ischr": false, "isdir": true, "isfifo": false, "isgid": false, "islnk": false, "isreg": false, "issock": false, "isuid": false, "mode": "0644", "mtime": 1605806149.0, "nlink": 2, "path": "/tmp/rclone_setup/rclone-v1.53.3-linux-amd64", "pw_name": "root", "rgrp": true, "roth": true, "rusr": true, "size": 92, "uid": 0, "wgrp": false, "woth": false, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}], "matched": 3, "msg": ""}

TASK [stefangweichinger.ansible_rclone : Validate the version in the archive matches the expected version (1.53.3)] ***
fatal: [localhost]: FAILED! => {"changed": false, "msg": "\"The version of rclone (rclone-v1.53.1-linux-amd64) in the archive does not match the expected version (1.53.3)\"\n"}

PLAY RECAP *********************************************************************
localhost                  : ok=9    changed=0    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0   

I see that there are similar issues recently but this seems different.

@jonathon2nd
Copy link
Author

I was able to resolve this by removing the old folders in /tmp/rclone_setup/, but I find it odd that more than one folder causes an error.

bash-4.4# ls -al /tmp/rclone_setup/
total 4
drwxrwxr-x. 5 root root  108 Nov 19 17:51 .
drwxrwxrwt. 1 root root 4096 Nov 24 20:20 ..
drwxr-xr-x. 2 root root   92 Sep 13 08:57 rclone-v1.53.1-linux-amd64
drwxr-xr-x. 2 root root   92 Oct 26 15:12 rclone-v1.53.2-linux-amd64
drw-r--r--. 2 root root   92 Nov 19 17:15 rclone-v1.53.3-linux-amd64

@stefangweichinger
Copy link
Owner

@jonathon2nd thanks for reporting

I know where this comes from, but I wasn't yet able to find a working solution for both the role itself and the idempotence test within the molecule tests.

The reason is that if more than one extracted archive/subfolder exists in /tmp/rclone_setup/ the new check task in tasks/main.yml fails: the grep only finds the first (and oldest) directory, and that one doesn't match the current/latest/stable release.

I already had added a task to clear the temporary directory with each run, but that lead to a failing molecule test.
I will try to come up with a more solid solution asap.

@mjmayer fyi, maybe you have ideas for a better check here

@stefangweichinger
Copy link
Owner

I decided to remove that check task for now.

It is only relevant for the issue in #66 , which might be solved upstream soon anyway.
For now it is prio 1 to not break the standard usage (install latest stable release, at least I assume that).

@jonathon2nd thx for the report, sorry for the problems. You might be able to test by manually creating some dummy directories in that temporary directory ;-)

I will try to come up with a more solid approach here / or hope for an upstream solution soon (which is already in progress).

@stefangweichinger stefangweichinger linked a pull request Nov 25, 2020 that will close this issue
stefangweichinger added a commit that referenced this issue Nov 25, 2020
* rm that check task for now: only relevant for edge case, fix standard usage

* Revert "rm that check task for now: only relevant for edge case, fix standard usage"

This reverts commit d87847e.

* test: only release code from master branch

* skip idempotence test for this task
ibayer pushed a commit to ibayer/ansible-rclone that referenced this issue Feb 28, 2021
* rm that check task for now: only relevant for edge case, fix standard usage

* Revert "rm that check task for now: only relevant for edge case, fix standard usage"

This reverts commit d87847e.

* test: only release code from master branch

* skip idempotence test for this task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants