Skip to content

Bug: accountv2Client.List() always throws Error: Request failed with status code: 500, internal_error #432

@ParthaI

Description

@ParthaI

Hello Team,

I'm attempting to retrieve a list of all accounts on my IBM Cloud using the List() API call from the accountv2 package. Unfortunately, I keep encountering the following error: Error: Request failed with status code: 500, internal_error.

Below is the source code I've been working with:

package main

import (
	"fmt"

	"github.com/IBM-Cloud/bluemix-go"
	"github.com/IBM-Cloud/bluemix-go/api/account/accountv2"
	"github.com/IBM-Cloud/bluemix-go/session"
)

func main() {
	conf := &bluemix.Config{
		BluemixAPIKey: "YOUR_IBMCLOUD_API_KEY",
	}

	s, err := session.New(conf)
	if err != nil {
		panic("Error in session creation: " + err.Error())
	}

	svc, err := accountv2.New(s)
	if err != nil {
		panic("Error in Account client: " + err.Error())
	}
	client := svc.Accounts()
	res, err := client.List()

	if err != nil {
		panic("Error in Account List API call: " + err.Error())
	}

	for _, acc := range res {
		fmt.Printf("Account Name: %s", acc.Name)
	}

}

If there are any corrections needed or best practices I might have overlooked, I'd greatly appreciate your guidance. This issue is currently a significant obstacle in our project's progress, so any expedited advice or solutions would be immensely valuable.

Thank you for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions