Skip to content

bug(api): createCounter/deleteCounter functions not working properly #10043

Description

@chrxmvtik
ISSUE TYPE
  • Bug Report
COMPONENT NAME
API
CLOUDSTACK VERSION
4.19.1.3, 4.20.0.0
CONFIGURATION

Basic

OS / ENVIRONMENT

Cloudstack Simulator

SUMMARY
STEPS TO REPRODUCE

Using CMK for API

listCounters result:
    [{
      "id": "1a57158d-acce-11ef-ae80-0242ac110002",
      "name": "Linux System CPU - percentage",
      "provider": "Netscaler",
      "source": "SNMP",
      "value": "1.3.6.1.4.1.2021.11.10.0"
    }]

Delete counter:

deleteCounter id=1a57158d-acce-11ef-ae80-0242ac110002

result:
{
  "success": true
}

Create a counter with the same configuration:

createCounter name="Linux System CPU - percentage" provider="Netscaler" source="SNMP" value="1.3.6.1.4.1.2021.11.10.0"
🙈 Error: (HTTP 530, error code 9999) Entity already exists

Create a counter using different value:

createCounter name="Linux System CPU - percentage" provider="Netscaler" source="SNMP" value="1.3.6.1.4.1.2021.11.12.0"
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 1 [running]:
github.com/apache/cloudstack-cloudmonkey/cmd.pollAsyncJob(0x140013a6780, {0x1400001c270, 0x24})
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cmd/network.go:171 +0x500
github.com/apache/cloudstack-cloudmonkey/cmd.NewAPIRequest(0x140013a6780, {0x14000fc77f0, 0xd}, {0x140013c0210, 0x4, 0x0?}, 0x1)
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cmd/network.go:272 +0x1100
github.com/apache/cloudstack-cloudmonkey/cmd.init.0.func1(0x140013a6780)
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cmd/api.go:80 +0x488
github.com/apache/cloudstack-cloudmonkey/cli.ExecCmd({0x140013c0200?, 0x5, 0x8})
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cli/exec.go:67 +0x238
github.com/apache/cloudstack-cloudmonkey/cli.ExecLine({0x14001802e80, 0x76})
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cli/exec.go:51 +0x1ec
github.com/apache/cloudstack-cloudmonkey/cli.ExecPrompt()
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cli/prompt.go:84 +0x260
main.main()
	/Users/rohit/lab/apache/cloudstack-cloudmonkey/cmk.go:101 +0x6a4

createCounter function causes this error, however in v4.20.0.0 it creates a counter even tho it errored, however in v4.19.1.3 it doesn't create a counter.

EXPECTED RESULTS
createCounter function works properly

deleteCounter function removes counter and allow us to create a counter with the same value
ACTUAL RESULTS
Function causes an error, unable to create/delete a counter properly.

Activity

  1. boring-cyborg commented on Dec 5, 2024

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. added this to the 4.19.2 milestone on Dec 5, 2024
  3. modified the milestones: 4.19.2, 4.19.3 on Feb 13, 2025
  4. yadvr commented on Apr 15, 2025

    @yadvr
    Member

    PR proposed at #10223

  5. modified the milestones: 4.19.3, 4.20.1 on May 7, 2025
  6. added theissue type on May 7, 2025
  7. modified the milestones: 4.20.1, 4.20.2 on Jun 3, 2025
  8. modified the milestones: 4.20.2, 4.22.0 on Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions