# Create OneAgent custom plugin / extension : fail to command line upload on Cluster

**URL:** <https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272>\
**Category:** Extensions\
**Tags:** extensions, oneagent-sdk\
**Created:** [November 14, 2022, 3:54pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272 "2022-11-14T15:54:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [November 14, 2022, 3:54pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/1 "2022-11-14T15:54:13Z")

</div>

Hello.

Based on [Develop your own Extensions — Dynatrace Docs](https://www.dynatrace.com/support/help/extend-dynatrace/extensions/oneagent-extensions/oneagent-extensions-hands-on) I built, uploaded manually on cluster, and deployed on a sand box OneAgent my custom extension. Fine.

Now I am trying to upload the extension on the cluster through command line as documented on [Develop your own Extensions — Dynatrace Docs](https://www.dynatrace.com/support/help/extend-dynatrace/extensions/oneagent-extensions/oneagent-extensions-hands-on#upload-your-extension)

It says : plugin\_sdk upload\_plugin --plugin\_zip…&nbsp; --server …

But :

- what is supposed to be --server option value ? I cannot find this.
- I guessed /api/v1/remoteplugins but I cannot find API tester for this : where is it ?
- when I try to run the plugin\_sdk upload\_plugin --plugin\_zip /tmp/custom.python.my\_plugin.zip … I get a :

```java
server https://xxx.xxx.xxx/e/<env_id>/api/v1/remoteplugins/ returned status code: 400 {"error":{"code":400,"message":"Plugin *.zip file name should match plugin id."}}​

```

and I cannot make sens of this.

Does any one know how to command line upload a OneAgent custom extension ?

Regards.

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [November 14, 2022, 4:13pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/2 "2022-11-14T16:13:00Z")

</div>

BTW, plugin\_sdk upload\_plugin tell me

```markup
Please execute oneagent_verify_plugin before upload to validate plugin.json against the schema

```

which

- I did : oneagent\_verify\_plugin =\> Plugin custom.python.myplugin is valid
- I also did : plugin\_sdk verify\_plugin =\> also says ok, and looks like it is the same command

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [November 14, 2022, 4:36pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/3 "2022-11-14T16:36:53Z")

</div>

Also FYI :

my plugin.json&nbsp; file says

```java
{
  "name": "custom.python.my_plugin",

```

and my plugin file is

```java
/tmp/custom.python.my_plugin.zip

```

I am puzzled.

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [November 15, 2022, 10:15am UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/4 "2022-11-15T10:15:51Z")

</div>

The problem is you are uploading a OneAgent extension but have&nbsp; **/api/v1/remoteplugin** at the end of the server URL, which is for AG extensions. For oneagent extensions it is&nbsp; **/api/v1/plugins.**

But you can leave out the API Endpoint and enter the server as&nbsp;_**[https://XXXXXX.live.dynatrace.com/](https://XXXXXX.live.dynatrace.com/)**&nbsp;_ or_&nbsp;&nbsp;**[https://xxx.xxx.xxx/e/env\_id/](https://xxx.xxx.xxx/e/env%5C_id/)**&nbsp;_and it will pick the correct API endpoint depending on if you are building an activegate or oneagent extension.

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [November 15, 2022, 12:57pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/5 "2022-11-15T12:57:41Z")

</div>

Hello.

Shouldn’t it be someone different to set an answer as a solution ? 🙂

At least in my case this is not the solution :

```markup
plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --server https://my.dynatrace.server/e/<env_id>/ --token dt0c01....
The server endpoint https://my.dynatrace.server/e/<env_id>/ is not designed for plugin upload

plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --server https://my.dynatrace.server/ --token dt0c01....
The server endpoint https://my.dynatrace.server/ is not designed for plugin upload

```

At last :

```markup
plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --server https://my.dynatrace.server/e/<env_id>/api/v1/plugins --token dt0c01....
Attempting to send plugin to server https://my.dynatrace.server/e/<env_id>/api/v1/plugins
plugin has been uploaded successfully

```

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [November 15, 2022, 1:01pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/6 "2022-11-15T13:01:30Z")

</div>

If you set it with --server you need to add the correct API endpoint.

Or you can just leave out the --server all together and enter it as mentioned above when prompted, that will select the correct endpoint then.

---

<div class="post-metadata">

**Author:** ![gilles\_tabary](https://avatars.discourse-cdn.com/v4/letter/g/eb9ed0/32.png) [@gilles\_tabary](https://community.dynatrace.com/u/gilles_tabary)\
**Post date:** [November 15, 2022, 1:06pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/7 "2022-11-15T13:06:07Z")

</div>

Not functionning in my case :

```markup
plugin_sdk upload_plugin --plugin_zip custom.python.my_oneagent_plugin.zip --token dt0c01....
File: /etc/init.d/dynatracefunctions not found - Remote Plugin Module is detected
Could not read file /var/lib/dynatrace/oneagent/agent/config/plugin_sdk.conf: No such file or directory - Neither OneAgent nor Remote Plugin Module is detected
server upload endpoint is missing

```

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [November 15, 2022, 3:50pm UTC](https://community.dynatrace.com/t/create-oneagent-custom-plugin-extension-fail-to-command-line-upload-on-cluster/37272/8 "2022-11-15T15:50:53Z")

</div>

Looks like _ **plugin\_sdk upload\_plugin** _ needs the --server parameter.

So for a oneagent plugin&nbsp; you’d have to use:

```markup
plugin_sdk upload_plugin --server https://XXXXXX.live.dynatrace.com/api/v1/plugins -t dt0c01.XXX.XXX

```

Or you can do it without the --server when building the plugin which would query:

```markup
oneagent_build_plugin -t dt0c01.XXX.XXX
...
...
Enter server address, exemplary address: https://demo.dev.dynatracelabs.com, or for managed include the tenant ID in the path: https://latest.managed-dev.dynalabs.io/e/5c6cf54c-5fe3-47e8-af18-54439090370b:

```
