{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/43766","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/43766/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/43766/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/43766/events","html_url":"https://github.com/ansible/ansible/issues/43766","id":348230107,"node_id":"MDU6SXNzdWUzNDgyMzAxMDc=","number":43766,"title":"maven_artifact module. Failed to retrieve the maven metadata file from libs-snapshot-local","user":{"login":"spender0","id":13725789,"node_id":"MDQ6VXNlcjEzNzI1Nzg5","avatar_url":"https://avatars3.githubusercontent.com/u/13725789?v=4","gravatar_id":"","url":"https://api.github.com/users/spender0","html_url":"https://github.com/spender0","followers_url":"https://api.github.com/users/spender0/followers","following_url":"https://api.github.com/users/spender0/following{/other_user}","gists_url":"https://api.github.com/users/spender0/gists{/gist_id}","starred_url":"https://api.github.com/users/spender0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spender0/subscriptions","organizations_url":"https://api.github.com/users/spender0/orgs","repos_url":"https://api.github.com/users/spender0/repos","events_url":"https://api.github.com/users/spender0/events{/privacy}","received_events_url":"https://api.github.com/users/spender0/received_events","type":"User","site_admin":false},"labels":[{"id":835286067,"node_id":"MDU6TGFiZWw4MzUyODYwNjc=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.6","name":"affects_2.6","color":"ededed","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false},{"id":942378949,"node_id":"MDU6TGFiZWw5NDIzNzg5NDk=","url":"https://api.github.com/repos/ansible/ansible/labels/traceback","name":"traceback","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-08-07T09:00:46Z","updated_at":"2018-09-12T09:44:13Z","closed_at":null,"author_association":"NONE","body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nTHIS FORM WILL BE READ BY A MACHINE, COMPLETE ALL SECTIONS AS DESCRIBED.\r\nAlso test if the latest release, and devel branch are affected too.\r\nALWAYS add information AFTER (OUTSIDE) these html comments.\r\nOtherwise it may end up being automatically closed by our bot. -->\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nmaven_artifact module cannot retrieve snapshot artifacts with versions containing timestamp whereas plain mvn cmd works perfectly fine:\r\nmvn dependency:get -DremoteRepositories=https://artifactory.example.com/artifactory/libs-snapshot-local -DartifactId=ARTIFACTNAME -DgroupId=com.foo.bar -Dpackaging=ear -Dversion=1.9.7-SNAPSHOT\r\n\r\nExample of a snapshot version: ARTIFACTNAME-1.9.7-20180625.110358-1.ear\r\nFull location https://artifactory.example.com/artifactory/libs-snapshot-local/com/foo/bar/ARTIFACTNAME/1.9.7-SNAPSHOT/ARTIFACTNAME-1.9.7-20180625.110358-1.ear\r\n\r\nAlso maven_artifact works well with another repositories e.g. libs-release-local where artifacts files have versions without timestamps e.g. 1.9.7-RELEASE\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Insert, BELOW THIS COMMENT, the name of the module, plugin, task or feature.\r\nDo not include extra details here, e.g. \"vyos_command\" not \"the network module vyos_command\" or the full path-->\r\nmaven_artifact\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste, BELOW THIS COMMENT, verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\n2.6.2\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- If using Ansible 2.4 or above, paste, BELOW THIS COMMENT, the results of \"ansible-config dump --only-changed\"\r\nOtherwise, mention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).-->\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Mention, BELOW THIS COMMENT, the OS you are running Ansible from, and the OS you are\r\nmanaging, or say \"N/A\" for anything that is not platform-specific.\r\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.-->\r\nFedora 26\r\n##### STEPS TO REPRODUCE\r\n<!--- For bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used. -->\r\nansible-playbook -i \"localhost\" test-maven-snapshot.yml -vvvvv\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n- hosts: \"localhost\"\r\n  tasks:\r\n  - name: download artifacts \r\n    maven_artifact:\r\n      group_id: com/foo/bar\r\n      artifact_id: ARTIFACTNAME\r\n      version: 1.9.7-SNAPSHOT\r\n      extension: ear\r\n      repository_url: https://artifactory.example.com/artifactory/libs-snapshot-local/\r\n      dest: /tmp/ARTIFACTNAME-1.9.7-SNAPSHOT\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nTASK [download artifacts ] ************************************************************************************************************************************\r\ntask path: /home/user/test-maven-snapshot.yml:3\r\n<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: user\r\n<127.0.0.1> EXEC /bin/sh -c 'echo ~user && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078 `\" && echo ansible-tmp-1533631870.77-268672636160078=\"` echo /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078 `\" ) && sleep 0'\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/_text.py\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/basic.py\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/urls.py\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/six/__init__.py\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/parsing/convert_bool.py\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/parsing/__init__.py\r\nUsing module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/pycompat24.py\r\nUsing module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/language/maven_artifact.py\r\n<127.0.0.1> PUT /home/user/.ansible/tmp/ansible-local-6548ahivpM/tmpqPR9oG TO /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078/maven_artifact.py\r\n<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078/ /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078/maven_artifact.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078/maven_artifact.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/user/.ansible/tmp/ansible-tmp-1533631870.77-268672636160078/ > /dev/null 2>&1 && sleep 0'\r\nThe full traceback is:\r\n  File \"/tmp/ansible_BViBX6/ansible_module_maven_artifact.py\", line 541, in main\r\n    download_error = downloader.download(artifact, verify_download, b_dest)\r\n  File \"/tmp/ansible_BViBX6/ansible_module_maven_artifact.py\", line 379, in download\r\n    url = self.find_uri_for_artifact(artifact)\r\n  File \"/tmp/ansible_BViBX6/ansible_module_maven_artifact.py\", line 305, in find_uri_for_artifact\r\n    content = self._getContent(self.base + path, \"Failed to retrieve the maven metadata file: \" + path)\r\n  File \"/tmp/ansible_BViBX6/ansible_module_maven_artifact.py\", line 343, in _getContent\r\n    response = self._request(url, failmsg, force)\r\n  File \"/tmp/ansible_BViBX6/ansible_module_maven_artifact.py\", line 371, in _request\r\n    raise ValueError(failmsg + \" because of \" + info['msg'] + \"for URL \" + url_to_use)\r\n\r\nfatal: [localhost]: FAILED! => {\r\n    \"changed\": false, \r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"artifact_id\": \"ARTIFACTNAME\", \r\n            \"attributes\": null, \r\n            \"backup\": null, \r\n            \"classifier\": \"\", \r\n            \"content\": null, \r\n            \"delimiter\": null, \r\n            \"dest\": \"/tmp/ARTIFACTNAME-1.9.7-SNAPSHOT\", \r\n            \"directory_mode\": null, \r\n            \"extension\": \"ear\", \r\n            \"follow\": false, \r\n            \"force\": null, \r\n            \"group\": null, \r\n            \"group_id\": \"com/foo/bar\", \r\n            \"http_agent\": null, \r\n            \"keep_name\": false, \r\n            \"mode\": null, \r\n            \"owner\": null, \r\n            \"password\": null, \r\n            \"regexp\": null, \r\n            \"remote_src\": null, \r\n            \"repository_url\": \"https://artifactory.example.com/artifactory/libs-snapshot-local/\", \r\n            \"selevel\": null, \r\n            \"serole\": null, \r\n            \"setype\": null, \r\n            \"seuser\": null, \r\n            \"src\": null, \r\n            \"state\": \"present\", \r\n            \"timeout\": 10, \r\n            \"unsafe_writes\": null, \r\n            \"url_password\": null, \r\n            \"url_username\": null, \r\n            \"username\": null, \r\n            \"validate_certs\": true, \r\n            \"verify_checksum\": \"download\", \r\n            \"version\": \"1.9.7-SNAPSHOT\"\r\n        }\r\n    }, \r\n    \"msg\": \"Failed to retrieve the maven metadata file: /com/foo/bar/ARTIFACTNAME/1.9.7-SNAPSHOT/maven-metadata.xml because of HTTP Error 404: Not Foundfor URL https://artifactory.example.com/artifactory/libs-snapshot-local/com/foo/bar/ARTIFACTNAME/1.9.7-SNAPSHOT/maven-metadata.xml\"\r\n}\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/420582965","html_url":"https://github.com/ansible/ansible/issues/43766#issuecomment-420582965","issue_url":"https://api.github.com/repos/ansible/ansible/issues/43766","id":420582965,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDU4Mjk2NQ==","user":{"login":"tumbl3w33d","id":1982589,"node_id":"MDQ6VXNlcjE5ODI1ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/1982589?v=4","gravatar_id":"","url":"https://api.github.com/users/tumbl3w33d","html_url":"https://github.com/tumbl3w33d","followers_url":"https://api.github.com/users/tumbl3w33d/followers","following_url":"https://api.github.com/users/tumbl3w33d/following{/other_user}","gists_url":"https://api.github.com/users/tumbl3w33d/gists{/gist_id}","starred_url":"https://api.github.com/users/tumbl3w33d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tumbl3w33d/subscriptions","organizations_url":"https://api.github.com/users/tumbl3w33d/orgs","repos_url":"https://api.github.com/users/tumbl3w33d/repos","events_url":"https://api.github.com/users/tumbl3w33d/events{/privacy}","received_events_url":"https://api.github.com/users/tumbl3w33d/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T09:44:13Z","updated_at":"2018-09-12T09:44:13Z","author_association":"CONTRIBUTOR","body":"It hurts me as a developer and even more as an administrator to foster that people use software that's [EOL for 9 years](https://maven.apache.org/maven-2.x-eol.html) (i.e., no security updates). It's the source of a lot of security evil. I'm totally for supporting such dying versions for a while (1-2 years is already quite tolerant in my opinion) so companies got time to act.\r\nThe cost on our end is added complexity in the code (granted, it looks little at first, but it can keep growing and you must consider the old maven whenever you change stuff).\r\n\r\nFrom what I read, maven 3 is even quite backward compatible so it's not like you would have to do a big migration process that keeps folks from transitioning.\r\n\r\nAlso, because it came up in the other issue, the fact that I acknowledged the merge of recent PRs that might haven been maven 2 related doesn't justify repeating mistakes. I wasn't aware they were ONLY necessary for supporting maven 2. The possible use cases of maven are diverse and I'm not aware of each of them and don't use all of them in my daily work (e.g., I don't work much with snapshots at all, even less with non-unique, which seems to be a relict of maven 2).\r\n\r\nI would like to get some opinion of @bcoca or @mattclay or someone else from the team to find out their opinion about how much support ansible should give in such case. When the general guideline is that we should support as many edge cases, I won't sabotage the progress any longer."}}
{"actor":{"display_login":"tumbl3w33d"}}