{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/495","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/495/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/495/events","html_url":"https://github.com/ansible/ansible-modules-extras/issues/495","id":76742771,"number":495,"title":"bower_module thrown an error if bower_components dir already exists","user":{"login":"bocharsky-bw","id":3317635,"avatar_url":"https://avatars.githubusercontent.com/u/3317635?v=3","gravatar_id":"","url":"https://api.github.com/users/bocharsky-bw","html_url":"https://github.com/bocharsky-bw","followers_url":"https://api.github.com/users/bocharsky-bw/followers","following_url":"https://api.github.com/users/bocharsky-bw/following{/other_user}","gists_url":"https://api.github.com/users/bocharsky-bw/gists{/gist_id}","starred_url":"https://api.github.com/users/bocharsky-bw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bocharsky-bw/subscriptions","organizations_url":"https://api.github.com/users/bocharsky-bw/orgs","repos_url":"https://api.github.com/users/bocharsky-bw/repos","events_url":"https://api.github.com/users/bocharsky-bw/events{/privacy}","received_events_url":"https://api.github.com/users/bocharsky-bw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-05-15T14:24:49Z","updated_at":"2015-07-14T17:40:35Z","closed_at":null,"body":"I run next task in my playbook:\r\n``` yaml\r\n    - name: install bower vendor dependencies\r\n      bower: path=\"/path/to/project\" state=latest\r\n```\r\n\r\nAnd if `bower_components` dir not exists in `/path/to/project`, it download all dependencies and works fine, but if I run this task again, I get a next error:\r\n```\r\n< TASK: install bower vendor dependencies >\r\n<transformation.server.ndv.net.ua> ESTABLISH CONNECTION FOR USER: srvadmin\r\n<transformation.server.ndv.net.ua> REMOTE_MODULE bower path=\"/var/www/sites/transformation/web\" state=latest\r\n<transformation.server.ndv.net.ua> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=\"/home/victor/.ansible/cp/ansible-ssh-%h-%p-%r\" -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=srvadmin -o ConnectTimeout=10 transformation.server.ndv.net.ua /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340 && echo $HOME/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340'\r\n<transformation.server.ndv.net.ua> PUT /tmp/tmpjZzhjm TO /home/srvadmin/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340/bower\r\n<transformation.server.ndv.net.ua> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=\"/home/victor/.ansible/cp/ansible-ssh-%h-%p-%r\" -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=srvadmin -o ConnectTimeout=10 transformation.server.ndv.net.ua /bin/sh -c 'sudo -k && sudo -H -S -p \"[sudo via ansible, key=vilcuzdrghmtlvfndvzibzqgxnyjsrmj] password: \" -u root /bin/sh -c '\"'\"'echo BECOME-SUCCESS-vilcuzdrghmtlvfndvzibzqgxnyjsrmj; LANG=C LC_CTYPE=C /usr/bin/python /home/srvadmin/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340/bower; rm -rf /home/srvadmin/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340/ >/dev/null 2>&1'\"'\"''\r\n\r\nfailed: [localhost] => {\"failed\": true, \"parsed\": false}\r\n\r\nBECOME-SUCCESS-vilcuzdrghmtlvfndvzibzqgxnyjsrmj\r\nTraceback (most recent call last):\r\n  File \"/home/srvadmin/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340/bower\", line 1786, in <module>\r\n    main()\r\n  File \"/home/srvadmin/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340/bower\", line 173, in main\r\n    installed, missing, outdated = bower.list()\r\n  File \"/home/srvadmin/.ansible/tmp/ansible-tmp-1431673951.26-168306551298340/bower\", line 121, in list\r\n    elif data['dependencies'][dep]['pkgMeta']['version'] != data['dependencies'][dep]['update']['latest']:\r\nKeyError: 'version'\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to transformation.server.ndv.net.ua closed.\r\n```\r\n\r\nIt looks like a bug.\r\n\r\nP.S. I run playbook with `-vvvv` key. Remote machine is Ubuntu 12.04, bower is installed and work correctly if I run it manually with `bower install` or `bower update`\r\n\r\nMy workaround is to remove manually `bower_components` folder first if exists and then execute `install bower vendor dependencies` task."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/121318793","html_url":"https://github.com/ansible/ansible-modules-extras/issues/495#issuecomment-121318793","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/495","id":121318793,"user":{"login":"makmanalp","id":161965,"avatar_url":"https://avatars.githubusercontent.com/u/161965?v=3","gravatar_id":"","url":"https://api.github.com/users/makmanalp","html_url":"https://github.com/makmanalp","followers_url":"https://api.github.com/users/makmanalp/followers","following_url":"https://api.github.com/users/makmanalp/following{/other_user}","gists_url":"https://api.github.com/users/makmanalp/gists{/gist_id}","starred_url":"https://api.github.com/users/makmanalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makmanalp/subscriptions","organizations_url":"https://api.github.com/users/makmanalp/orgs","repos_url":"https://api.github.com/users/makmanalp/repos","events_url":"https://api.github.com/users/makmanalp/events{/privacy}","received_events_url":"https://api.github.com/users/makmanalp/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T17:40:35Z","updated_at":"2015-07-14T17:40:35Z","body":"OK, I removed \"version\" from the bower.json in cidcons, tagged a new version, specified it in bower.json like `    \"cidcons\": \"cid-harvard/cidcons#0.3.1\",` and bower installed. This now caused the `bower list -j` output to have a \"version\" for cidcons. It's very odd that the package previously was not missing but didn't have a version either. I have solved my own issue but if you folks need help, I'd be happy to try to lend you a hand to reproduce more things."}}