# Snap install successful but "An exception occurred"

**URL:** <https://forum.ansible.com/t/snap-install-successful-but-an-exception-occurred/4498>\
**Category:** Get Help\
**Created:** [March 21, 2024, 3:10pm UTC](https://forum.ansible.com/t/snap-install-successful-but-an-exception-occurred/4498 "2024-03-21T15:10:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![baloe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/baloe/32/2651_2.png) [@baloe](https://forum.ansible.com/u/baloe)\
**Post date:** [March 21, 2024, 3:10pm UTC](https://forum.ansible.com/t/snap-install-successful-but-an-exception-occurred/4498/1 "2024-03-21T15:10:56Z")

</div>

I have `install_packages.yml` reading

```auto
- hosts: ubuntu_desktops
  any_errors_fatal: false
  become: true
  tasks:
  - name: Install Zotero.
    community.general.snap:
      name: zotero-snap

```

When I run `ansible-playbook -i inventory.yml install_packages.yml`  
the taks _Install Zotero._ fails with the following error message:

```plaintext
An exception occurred during task execution. 
To see the full traceback, use -vvv. 
The error was: 
ansible_collections.community.general.plugins.module_utils.mh.exceptions.ModuleHelperException
fatal: [mtbiberkopf]: 
FAILED! => {"changed": false, "channel": null, "classic": false, 
  "cmd": "['state', 'classic', 'channel', 'zotero-snap']",
  "msg": "Ooops! Snap installation failed while executing '['state', 'classic', 'channel', 'zotero-snap']', please examine logs and error output for more details.", 
  "output": {"channel": null, "classic": false, 
    "cmd": "['state', 'classic', 'channel', 'zotero-snap']", 
    "snaps_installed": ["zotero-snap"]}, 
    "snaps_installed": ["zotero-snap"], 
    "vars": {"channel": null, "classic": false, "cmd": "['state', 'classic', 'channel', 'zotero-snap']", "snaps_installed": ["zotero-snap"]}}

```

However, the sofware _does_ actually get installed despite what the error message says. When I log into that machine and run `sudo snap install zotero-snap` I get  
`snap "zotero-snap" is already installed, see 'snap help refresh'`.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [March 21, 2024, 3:25pm UTC](https://forum.ansible.com/t/snap-install-successful-but-an-exception-occurred/4498/2 "2024-03-21T15:25:25Z")

</div>

That doesn’t look like you’re doing anything wrong. In fact, that looks like you probably ran into [Issue #7130](https://github.com/ansible-collections/community.general/issues/7130) or [Issue #7265](https://github.com/ansible-collections/community.general/issues/7265).

From what I can tell, this was partially fixed in community.general:7.3.0, and fully fixed in 7.5.0. You probably just need to upgrade your collection. If you’re already using a newer version than 7.5.0, then you need to submit a new issue to them at Github.

---

<div class="post-metadata">

**Author:** ![baloe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/baloe/32/2651_2.png) [@baloe](https://forum.ansible.com/u/baloe)\
**Post date:** [March 21, 2024, 4:11pm UTC](https://forum.ansible.com/t/snap-install-successful-but-an-exception-occurred/4498/3 "2024-03-21T16:11:59Z")

</div>

Yes, after a

```auto
ansible-galaxy collection install community.general --upgrade

```

the playbook ran through flawlessly. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 20, 2024, 4:12pm UTC](https://forum.ansible.com/t/snap-install-successful-but-an-exception-occurred/4498/4 "2024-04-20T16:12:01Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
