# Error when using the oneAgentOnAHostClient SDK

**URL:** <https://community.dynatrace.com/t/error-when-using-the-oneagentonahostclient-sdk/39671>\
**Category:** Developer Q&A Forum\
**Tags:** coding-assistance, ad-hoc-functions\
**Created:** [May 10, 2023, 8:50pm UTC](https://community.dynatrace.com/t/error-when-using-the-oneagentonahostclient-sdk/39671 "2023-05-10T20:50:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas\_c](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/thomas_c/32/17633_2.png) [@thomas\_c](https://community.dynatrace.com/u/thomas_c)\
**Post date:** [May 10, 2023, 8:50pm UTC](https://community.dynatrace.com/t/error-when-using-the-oneagentonahostclient-sdk/39671/1 "2023-05-10T20:50:27Z")

</div>

Hi Team,

I try to use the oneAgentOnAHostClient&nbsp;SDK but get the following error from a dashboard ad-hoc function:

 ![thomas_c_1-1683751584970.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5197d4b00ca0935cad22a1eee4d5400db5dd8d98.png)

Similar symptom as in [previous thread&nbsp;210810](https://community.dynatrace.com/topic/210810). As an admin, I expect to be able to read information from the oneAgentOnAHostClient SDK in code tiles.

Would you know what’s the blocker in that case?

Read access to this SDK would permit to inform of deployed OneAgent versions in the monitored environment and ease the preparation of OneAgent upgrade campaigns.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![stefan\_eggersto](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/stefan_eggersto/32/34114_2.png) [@stefan\_eggersto](https://community.dynatrace.com/u/stefan_eggersto)\
**Post date:** [May 11, 2023, 6:38am UTC](https://community.dynatrace.com/t/error-when-using-the-oneagentonahostclient-sdk/39671/2 "2023-05-11T06:38:49Z")

</div>

Hi [@thomas\_c](https://community.dynatrace.com/user/7815)&nbsp;,

I could reproduce this issue. The code is correct, but there are two aspects that lead to this behavior:

- In the current version, the error of ad-hoc functions is not shown. This is already known and will be fixed in a next release.
- Some scopes are not requested by the Dashboards and Notebooks app, which lead to a permission error when using the `client-classic-environment-v1` SDK within these apps. I reported this to the team.

To get your code working, you need to wait until a new version of the apps is deployed.
