Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndefined: logrus.TraceLevel && multiple-value uuid.NewV4() in single-value context #2

Closed
Rizbe opened this issue May 7, 2019 · 3 comments

Comments

@Rizbe
Copy link

Rizbe commented May 7, 2019

Trying to run the below example from the OpsGenie site:
https://docs.opsgenie.com/docs/opsgenie-go-api-v2

package main

import (
	"fmt"

	"github.com/opsgenie/opsgenie-go-sdk-v2/alert"
	"github.com/opsgenie/opsgenie-go-sdk-v2/client"
	"github.com/opsgenie/opsgenie-go-sdk-v2/policy"
)

func main() {

	//create a policy client
	policyClient, err := policy.NewClient(&client.Config{ApiKey: "your api key"})

	if err != nil {
		fmt.Println("error occured while creating policy client")
		return
	}

	//create a request object
	createAlertPolicyRequest := &policy.CreateAlertPolicyRequest{
		MainFields: policy.MainFields{
			Name:              "my alert policy",
			Enabled:           false,
			PolicyDescription: "a policy",
		},
		Message:  "a message",
		Continue: false,
		Alias:    "an alias",
		Priority: alert.P1,
	}

	//function call to process the request
	createAlertPolicyResult, err := policyClient.CreateAlertPolicy(nil, createAlertPolicyRequest)

	if err != nil {
		fmt.Printf("error: %s\n", err)
	} else {
		fmt.Sprintf("result: %v+: ", createAlertPolicyResult)
	}

}

Getting the following error

../../go/src/github.com/opsgenie/opsgenie-go-sdk-v2/client/config.go:90:14: undefined: logrus.TraceLevel
../../go/src/github.com/opsgenie/opsgenie-go-sdk-v2/client/metric.go:104:29: multiple-value uuid.NewV4() in single-value context
@metehanozturk
Copy link
Contributor

It seems like that you should update your dependencies. Old versions of some packages were used in your environment somehow.

@zsgilber
Copy link

@metehanozturk

It looks like the the client package is using github.com/satori/go.uuid for uuid generation, which had a breaking change to the uuid.NewV4() function.

Also, the satori uuid package should likely be replaced with another package, as it has effectively been abandoned - see satori/go.uuid#84.

@cglrkn
Copy link
Contributor

cglrkn commented Jul 10, 2019

@zsgilber We fixed the problem. Thanks!

@cglrkn cglrkn closed this as completed Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants