# {   "success": false,   "message": "'GMPv227' object has no attribute 'get\_assets'" }

**URL:** <https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585>\
**Category:** Building from Source and Advanced Topics\
**Created:** [July 24, 2025, 9:44am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585 "2025-07-24T09:44:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![efren02](https://forum.greenbone.net/letter_avatar/efren02/32/6_449c533f586939b6e5f246632a46421f.png) [@efren02](https://forum.greenbone.net/u/efren02)\
**Post date:** [July 24, 2025, 9:44am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585/1 "2025-07-24T09:44:44Z")

</div>

it keeps returning GMPv227’ object has no attribute ‘get\_assets’" }

this is my current code:  
async def get\_all\_hosts\_with\_os(args):  
try:  
@run\_gvm\_sync  
def sync\_get\_all\_assets(gmp, \*\*kwargs):  
assets\_list =

```
        assets_xml = gmp.get_assets()
        root = etree.fromstring(assets_xml)

        for asset in root.findall("asset"):
            asset_data = {
                "id": asset.get("id"),
                "name": asset.findtext("name"),
                "ip": asset.findtext("ip"),
                "os": asset.findtext("os") or "Unknown",
                "severity": asset.findtext("highest_threat") or "0.0",
                "first_seen": asset.findtext("first"),
                "last_seen": asset.findtext("last"),
            }
            assets_list.append(asset_data)

        return assets_list

    # ✅ This passes username/password to the wrapper
    result = await asyncio.to_thread(sync_get_all_assets, **vars(args))

    return {
        "success": True,
        "hosts": result,
    }

except Exception as e:
    return {
        "success": False,
        "message": str(e),
    }

```

I’ve checked my gvm it’s all up to date

---

<div class="post-metadata">

**Author:** ![bricks](https://forum.greenbone.net/user_avatar/forum.greenbone.net/bricks/32/46_2.png) [@bricks](https://forum.greenbone.net/u/bricks)\
**Post date:** [July 24, 2025, 9:45am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585/2 "2025-07-24T09:45:58Z")

</div>

Yes because the `GMP` object doesn’t have a `get_assets` method. At least not anymore. There is `get_hosts` and `get_operating_systems` instead.

---

<div class="post-metadata">

**Author:** ![efren02](https://forum.greenbone.net/letter_avatar/efren02/32/6_449c533f586939b6e5f246632a46421f.png) [@efren02](https://forum.greenbone.net/u/efren02)\
**Post date:** [July 24, 2025, 9:59am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585/3 "2025-07-24T09:59:35Z")

</div>

Thank you for this! Has this been removed in the latest versions?

---

<div class="post-metadata">

**Author:** ![bricks](https://forum.greenbone.net/user_avatar/forum.greenbone.net/bricks/32/46_2.png) [@bricks](https://forum.greenbone.net/u/bricks)\
**Post date:** [July 24, 2025, 10:21am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585/4 "2025-07-24T10:21:48Z")

</div>

I really think it got removed a loooooong time ago. I can’t even find a version where it was available quickly.

---

<div class="post-metadata">

**Author:** ![efren02](https://forum.greenbone.net/letter_avatar/efren02/32/6_449c533f586939b6e5f246632a46421f.png) [@efren02](https://forum.greenbone.net/u/efren02)\
**Post date:** [July 24, 2025, 11:22am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585/5 "2025-07-24T11:22:09Z")

</div>

> [@bricks](#):
>
> get\_operating\_systems

I see. Is there a simpler way to fetch this data?  
Currently, I have to parse it from the reports, which is a bit complicated. Ideally, I’d like to extract the OS and host information without going through a complex process.  
I also tried using `get_operating_systems`, but it returns empty. Based on my research, it seems this only works if the OS information was manually entered in the OpenVAS “Operating Systems” section.

---

<div class="post-metadata">

**Author:** ![system](https://forum.greenbone.net/uploads/default/original/2X/4/4660e797edfaea797a8c9965246072ea26732804.png) [@system](https://forum.greenbone.net/u/system)\
**Post date:** [October 22, 2025, 9:45am UTC](https://forum.greenbone.net/t/success-false-message-gmpv227-object-has-no-attribute-get-assets/21585/6 "2025-10-22T09:45:11Z")

</div>

Closed on October 22, 2025, 9:45am UTC

This topic was automatically closed after 90 days. New replies are no longer allowed.
