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

Dapr Init panic: runtime error: invalid memory address or nil pointer dereference #1468

Open
tgermain-impirica opened this issue Nov 22, 2024 · 14 comments
Labels
kind/bug Something isn't working

Comments

@tgermain-impirica
Copy link

I have been using Dapr for a while without a problem on my M1 Mac. A coworker of mine tried installing and running dapr init, he got the error. I uninstalled Dapr and reinstalled (Homebrew) and am now receiving the same error. We are stuck, and are in the middle of some critical development!

Expected Behavior

Dapr init should install components and docker containers

Actual Behavior

~ % dapr init
⌛ Making the jump to hyperspace...
ℹ️ Container images will be pulled from Docker Hub
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x101d75b14]

goroutine 1 [running]:
github.com/hashicorp/go-version.(*Version).String(0x0)
/Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:369 +0x34
github.com/hashicorp/go-version.(*Version).Compare(0x0, 0x140006ae000)
/Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:116 +0x24
github.com/hashicorp/go-version.(*Version).GreaterThan(...)
/Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:298
github.com/dapr/cli/pkg/version.GetLatestReleaseGithub.func1({0x140010fa000, 0x35bebd, 0x41e000})
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:124 +0x1c8
github.com/dapr/cli/pkg/version.GetVersionFromURL({0x14000722120, 0x2f}, 0x102b81b28)
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:102 +0x350
github.com/dapr/cli/pkg/version.GetLatestReleaseGithub({0x14000722120?, 0x2b?})
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:107 +0x28
github.com/dapr/cli/pkg/version.GetDaprVersion()
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:63 +0x60
github.com/dapr/cli/pkg/standalone.Init({0x10219fc59, 0x6}, {0x10219fc59, 0x6}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0x0, ...}, ...)
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/standalone/standalone.go:215 +0x1b8
github.com/dapr/cli/cmd.init.func23(0x103ed13e0, {0x10219cde4?, 0x4?, 0x10219ceac?})
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/cmd/init.go:174 +0x2e8
github.com/spf13/cobra.(*Command).execute(0x103ed13e0, {0x103f2dc00, 0x0, 0x0})
/Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0x81c
github.com/spf13/cobra.(*Command).ExecuteC(0x103ecee80)
/Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/dapr/cli/cmd.Execute({0x10251df40?, 0x10091443c?}, {0x10251df3c?, 0x140000021c0?})
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/cmd/dapr.go:78 +0x150
main.main()
/private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/main.go:27 +0x3c
~ %

Steps to Reproduce the Problem

dapr init

Environment

Mac M1 Pro

Dapr version

~ % dapr version
CLI version: 1.14.1
Runtime version: n/a
~ %

@tgermain-impirica tgermain-impirica added the kind/bug Something isn't working label Nov 22, 2024
@edwardfward
Copy link

edwardfward commented Nov 22, 2024

Received the same error running dapr init -k on a local KIND cluster.

CLI version: 1.14.1 
Runtime version: 1.14.4
go version go1.23.2 darwin/arm64

Installed DAPR CLI using for Mac M2 Ultra

curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash
⌛  Making the jump to hyperspace...
ℹ️  Note: To install Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced

ℹ️  Container images will be pulled from Docker Hub
❌  Deploying the Dapr control plane with latest version to your cluster...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x28 pc=0x106091b14]

goroutine 1 [running]:
github.com/hashicorp/go-version.(*Version).String(0x0)
 /Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:369 +0x34
github.com/hashicorp/go-version.(*Version).Compare(0x0, 0x140006ca190)
 /Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:116 +0x24
github.com/hashicorp/go-version.(*Version).GreaterThan(...)
 /Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/hashicorp/[email protected]/version.go:298
github.com/dapr/cli/pkg/version.GetLatestReleaseGithub.func1({0x140019a2000, 0x35bebd, 0x41e000})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:124 +0x1c8
github.com/dapr/cli/pkg/version.GetVersionFromURL({0x140009b61b0, 0x2f}, 0x106e9db28)
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:102 +0x350
github.com/dapr/cli/pkg/version.GetLatestReleaseGithub({0x140009b61b0?, 0x2b?})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:107 +0x28
github.com/dapr/cli/pkg/version.GetDaprVersion()
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/version/version.go:63 +0x60
github.com/dapr/cli/pkg/kubernetes.getVersion({0x1064b8dc0?, 0x6?}, {0x1064bbc59?, 0x4?})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/kubernetes/kubernetes.go:181 +0x6c
github.com/dapr/cli/pkg/kubernetes.install({0x1064b8dc0, 0x4}, {0x1064bbc59, 0x6}, {0x1064fa573, 0x22}, {{0x1064bbc59, 0x6}, {0x1064bbc59, 0x6}, ...})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/kubernetes/kubernetes.go:298 +0xa0
github.com/dapr/cli/pkg/kubernetes.installWithConsole({0x1064b8dc0, 0x4}, {0x1064bbc59, 0x6}, {0x1064fa573, 0x22}, {0x1064d34c6?, 0x1064af14c?}, {{0x1064bbc59, 0x6}, ...})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/kubernetes/kubernetes.go:142 +0x110
github.com/dapr/cli/pkg/kubernetes.Init({{0x1064bbc59, 0x6}, {0x1064bbc59, 0x6}, {0x1064c5443, 0xb}, 0x1, 0x0, 0x0, {0x108249c00, ...}, ...})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/pkg/kubernetes/kubernetes.go:80 +0x9c
github.com/dapr/cli/cmd.init.func23(0x1081ed3e0, {0x1064b8de4?, 0x4?, 0x1064b8eac?})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/cmd/init.go:145 +0x648
github.com/spf13/cobra.(*Command).execute(0x1081ed3e0, {0x140005f9e70, 0x1, 0x1})
 /Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0x81c
github.com/spf13/cobra.(*Command).ExecuteC(0x1081eae80)
 /Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
 /Users/runner/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/dapr/cli/cmd.Execute({0x106839f40?, 0x104c3043c?}, {0x106839f3c?, 0x140000021c0?})
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/cmd/dapr.go:78 +0x150
main.main()
 /private/tmp/dapr-cli-20240819-5654-e4cfq9/cli-1.14.1/main.go:27 +0x3c

@edwardfward
Copy link

edwardfward commented Nov 22, 2024

Don't have time to dive into it tonight, will try to track down the nil pointer deference somewhere in the call stack below.

https://github.com/dapr/cli/blob/master/pkg/version/version.go#L106

// GetLatestReleaseGithub return the latest release version of dapr from GitHub API.
func GetLatestReleaseGithub(githubURL string) (string, error) {
	return GetVersionFromURL(githubURL, func(body []byte) (string, error) {
		var githubRepoReleases []githubRepoReleaseItem
		err := json.Unmarshal(body, &githubRepoReleases)
		if err != nil {
			return "", err
		}

		if len(githubRepoReleases) == 0 {
			return "", fmt.Errorf("no releases")
		}

		defaultVersion, _ := version.NewVersion("0.0.0")
		latestVersion := defaultVersion

		for _, release := range githubRepoReleases {
			if !strings.Contains(release.TagName, "-rc") {
				cur, _ := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
				if cur.GreaterThan(latestVersion) {
					latestVersion = cur
				}
			}
		}

https://github.com/hashicorp/go-version/blob/v1.6.0/version.go

// Version represents a single version.
type Version struct {
	metadata string
	pre      string
	segments []int64
	si       int
	original string
}
// NewVersion parses the given version and returns a new
// Version.
func NewVersion(v string) (*Version, error) {
	return newVersion(v, versionRegexp)
}

// NewSemver parses the given version and returns a new
// Version that adheres strictly to SemVer specs
// https://semver.org/
func NewSemver(v string) (*Version, error) {
	return newVersion(v, semverRegexp)
}

func newVersion(v string, pattern *regexp.Regexp) (*Version, error) {
	matches := pattern.FindStringSubmatch(v)
	if matches == nil {
		return nil, fmt.Errorf("Malformed version: %s", v)
	}
	segmentsStr := strings.Split(matches[1], ".")
	segments := make([]int64, len(segmentsStr))
	for i, str := range segmentsStr {
		val, err := strconv.ParseInt(str, 10, 64)
		if err != nil {
			return nil, fmt.Errorf(
				"Error parsing version: %s", err)
		}

		segments[i] = val
	}

	// Even though we could support more than three segments, if we
	// got less than three, pad it with 0s. This is to cover the basic
	// default usecase of semver, which is MAJOR.MINOR.PATCH at the minimum
	for i := len(segments); i < 3; i++ {
		segments = append(segments, 0)
	}

	pre := matches[7]
	if pre == "" {
		pre = matches[4]
	}

	return &Version{
		metadata: matches[10],
		pre:      pre,
		segments: segments,
		si:       len(segmentsStr),
		original: v,
	}, nil
}
// GreaterThan tests if this version is greater than another version.
func (v *Version) GreaterThan(o *Version) bool {
	return v.Compare(o) > 0
}

https://github.com/hashicorp/go-version/blob/v1.6.0/version.go#L114

// Compare compares this version to another version. This
// returns -1, 0, or 1 if this version is smaller, equal,
// or larger than the other version, respectively.
//
// If you want boolean results, use the LessThan, Equal,
// GreaterThan, GreaterThanOrEqual or LessThanOrEqual methods.
func (v *Version) Compare(other *Version) int {
	// A quick, efficient equality check
	if v.String() == other.String() {
		return 0
	}
// String returns the full version string included pre-release
// and metadata information.
//
// This value is rebuilt according to the parsed segments and other
// information. Therefore, ambiguities in the version string such as
// prefixed zeroes (1.04.0 => 1.4.0), `v` prefix (v1.0.0 => 1.0.0), and
// missing parts (1.0 => 1.0.0) will be made into a canonicalized form
// as shown in the parenthesized examples.
func (v *Version) String() string {
	var buf bytes.Buffer
	fmtParts := make([]string, len(v.segments))
	for i, s := range v.segments {
		// We can ignore err here since we've pre-parsed the values in segments
		str := strconv.FormatInt(s, 10)
		fmtParts[i] = str
	}
	fmt.Fprintf(&buf, strings.Join(fmtParts, "."))
	if v.pre != "" {
		fmt.Fprintf(&buf, "-%s", v.pre)
	}
	if v.metadata != "" {
		fmt.Fprintf(&buf, "+%s", v.metadata)
	}

	return buf.String()
}

@dlkinney
Copy link

@edwardfward I just ran into this tonight and dug into it. The short of it is that one of the releases returned in the JSON for https://api.github.com/repos/dapr/dapr/releases is vedge which causes version.NewVersion on line 122 of version.go to return (nil, err). (Not that it matters, but err.Error() is "Malformed version: edge", created here.) Unfortunately, the error returned from version.NewVersion is ignored, so cur is nil in the next line's expression cur.GreaterThan(latestVersion), where the receiver is eventually dereferenced and causes the panic.

Details

The stack trace contains a call to version.GetDaprVersion(), so let's start there, on line 62 of pkg/version/version.go. The version.GetDaprVersion() function calls

version.GetLatestReleaseGithub(fmt.Sprintf("https://api.github.com/repos/%s/%s/releases", DaprGitHubOrg, DaprGitHubRepo))

The constants DaprGitHubOrg and DaprGitHubRepo are both the dapr, so the URL resolves to https://api.github.com/repos/dapr/dapr/releases.

Running curl https://api.github.com/repos/dapr/dapr/releases | head -40 returns:

[
  {
    "url": "https://api.github.com/repos/dapr/dapr/releases/186741665",
    "assets_url": "https://api.github.com/repos/dapr/dapr/releases/186741665/assets",
    "upload_url": "https://uploads.github.com/repos/dapr/dapr/releases/186741665/assets{?name,label}",
    "html_url": "https://github.com/dapr/dapr/releases/tag/vedge",
    "id": 186741665,
    "author": {
      "login": "dapr-bot",
      "id": 56698301,
      "node_id": "MDQ6VXNlcjU2Njk4MzAx",
      "avatar_url": "https://avatars.githubusercontent.com/u/56698301?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/dapr-bot",
      "html_url": "https://github.com/dapr-bot",
      "followers_url": "https://api.github.com/users/dapr-bot/followers",
      "following_url": "https://api.github.com/users/dapr-bot/following{/other_user}",
      "gists_url": "https://api.github.com/users/dapr-bot/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/dapr-bot/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/dapr-bot/subscriptions",
      "organizations_url": "https://api.github.com/users/dapr-bot/orgs",
      "repos_url": "https://api.github.com/users/dapr-bot/repos",
      "events_url": "https://api.github.com/users/dapr-bot/events{/privacy}",
      "received_events_url": "https://api.github.com/users/dapr-bot/received_events",
      "type": "User",
      "user_view_type": "public",
      "site_admin": false
    },
    "node_id": "RE_kwDOC3tUwM4LIXOh",
    "tag_name": "vedge",
    "target_commitish": "master",
    "name": "Dapr Runtime vedge",
    "draft": false,
    "prerelease": true,
    "created_at": "2024-11-21T20:25:34Z",
    "published_at": "2024-11-21T21:07:51Z",
    "assets": [
      {
        "url": "https://api.github.com/repos/dapr/dapr/releases/assets/208173642",
        "id": 208173642,

Note that the tag_name of the first release is the string vedge.

Reading through the logic for the loop starting at line 118 of pkg/version/version.go:

defaultVersion, _ := version.NewVersion("0.0.0")
latestVersion := defaultVersion

for _, release := range githubRepoReleases {
    if !strings.Contains(release.TagName, "-rc") {
        cur, _ := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
        if cur.GreaterThan(latestVersion) {
            latestVersion = cur
        }
    }
}

During the first loop, latestVersion is 0.0.0 and release.TagName is vedge. Since vedge does not contain -rc, the if statement's condition on line 122 evaluates to true. Line 123 calls into hashicorp/go-version:

cur, _ := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))

The expression strings.TrimPrefix(release.TagName, "v") resolves to the string edge. Calling version.NewVersion("edge") returns (nil, err), so cur is set to nil and the error is ignored. Therefore, when evaluating the expression cur.GreaterThan(latestVersion) on the following line, the receiver is nil. Since Go allows function calls on nil receivers, we need to dig into the GreaterThan function:

func (v *Version) GreaterThan(o *Version) bool {
    return v.Compare(o) > 0
}

During this function, v is nil and Go allows function calls on nil receivers, so the call v.Compare is processed.

The Compare function function starts:

func (v *Version) Compare(other *Version) int {
    // A quick, efficient equality check
    if v.String() == other.String() {
        return 0
    }

The expression v.String() is calling String on a nil receiver. The String function starts:

func (v *Version) String() string {
    var buf bytes.Buffer
    fmtParts := make([]string, len(v.segments))

The expression v.segments forces v to be dereferenced and since v is nil, the Go runtime panics.


The solutions that leap to my mind are either of the following:

  • Remove the edge release from GitHub. Every call to dapr init for version 1.14.1 or earlier of the CLI (I haven't traced back how far) will panic due to the presence of the edge release, so removing the edge release immediately fixes dapr init for everybody.

  • Release a new version of the CLI that updates the for loop to check the error returned by version.NewVersion and skips the release when there is an error:

    for _, release := range githubRepoReleases {
        if strings.Contains(release.TagName, "-rc") {
            continue
        }
        
        cur, vErr := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
        if vErr != nil {
            continue
        }
            
        if cur.GreaterThan(latestVersion) {
            latestVersion = cur
        }
    }

    Or checks for cur being nil:

    for _, release := range githubRepoReleases {
        if strings.Contains(release.TagName, "-rc") {
            continue
        }
        
        cur, _ := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
        if cur == nil {
            continue
        }
            
        if cur.GreaterThan(latestVersion) {
            latestVersion = cur
        }
    }

    Whichever is more in line with the project's preferred style.

I hope this helps!

@lidalve
Copy link

lidalve commented Nov 22, 2024

same problem with version 1.14.1

os:debian 12

@marcgp
Copy link

marcgp commented Nov 22, 2024

@dlkinney proposed solution works. thanks for your effort on this

@santypr
Copy link

santypr commented Nov 22, 2024

Same problem here

Making the jump to hyperspace...
Container images will be pulled from Docker Hub
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x28 pc=0x2513ab3]

goroutine 1 [running]:
github.com/hashicorp/go-version.(*Version).String(0x0)
C:/Users/runneradmin/go/pkg/mod/github.com/hashicorp/[email protected]/version.go:369 +0x33
github.com/hashicorp/go-version.(*Version).Compare(0x0, 0xc000982000)
C:/Users/runneradmin/go/pkg/mod/github.com/hashicorp/[email protected]/version.go:116 +0x25
github.com/hashicorp/go-version.(*Version).GreaterThan(...)
C:/Users/runneradmin/go/pkg/mod/github.com/hashicorp/[email protected]/version.go:298
github.com/dapr/cli/pkg/version.GetLatestReleaseGithub.func1({0xc00101a000, 0x35bebe, 0x41e000})
D:/a/cli/cli/pkg/version/version.go:124 +0x1d4
github.com/dapr/cli/pkg/version.GetVersionFromURL({0xc00080a690, 0x2f}, 0x30d9ea0)
D:/a/cli/cli/pkg/version/version.go:102 +0x2b5
github.com/dapr/cli/pkg/version.GetLatestReleaseGithub({0xc00080a690?, 0x2b?})
D:/a/cli/cli/pkg/version/version.go:107 +0x1f
github.com/dapr/cli/pkg/version.GetDaprVersion()
D:/a/cli/cli/pkg/version/version.go:63 +0x6a
github.com/dapr/cli/pkg/standalone.Init({0x2f99f75, 0x6}, {0x2f99f75, 0x6}, {0x0, 0x0}, 0x0, {0x0, 0x0}, {0x0, ...}, ...)
D:/a/cli/cli/pkg/standalone/standalone.go:215 +0x21c
github.com/dapr/cli/cmd.glob..func11(0xc000a10d00?, {0x2f97156?, 0x4?, 0x2f9721a?})
D:/a/cli/cli/cmd/init.go:174 +0x2f0
github.com/spf13/cobra.(*Command).execute(0x466a4a0, {0x46f2a80, 0x0, 0x0})
C:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0xaa3
github.com/spf13/cobra.(*Command).ExecuteC(0x4667f40)
C:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
C:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/dapr/cli/cmd.Execute({0x33178a0?, 0x456ab60?}, {0x331789c?, 0xc0000ba000?})
D:/a/cli/cli/cmd/dapr.go:78 +0x159
main.main()
D:/a/cli/cli/main.go:27 +0x2f

CLI version: 1.14.1
Runtime version: n/a

@edwardfward
Copy link

@dlkinney Thanks for digging into this. I completely blanked on the fact Go allows nil receivers. I think both of your solutions are in order.

I forked the master branch, added the error handling you recommended, added print.WarningStatusEvent(os.Stdout, "Failed to parse version: '%s'", curErr) before the continue, compiled, replaced the dapr binary (/usr/local/bin/dapr) with the new binary in the dist` folder and everything worked as advertised.

// GetLatestReleaseGithub return the latest release version of dapr from GitHub API.
func GetLatestReleaseGithub(githubURL string) (string, error) {
	return GetVersionFromURL(githubURL, func(body []byte) (string, error) {
		var githubRepoReleases []githubRepoReleaseItem
		err := json.Unmarshal(body, &githubRepoReleases)
		if err != nil {
			return "", err
		}

		if len(githubRepoReleases) == 0 {
			return "", fmt.Errorf("no releases")
		}

		defaultVersion, _ := version.NewVersion("0.0.0")
		latestVersion := defaultVersion

		for _, release := range githubRepoReleases {
			if !strings.Contains(release.TagName, "-rc") {
				cur, curErr := version.NewVersion(strings.TrimPrefix(release.TagName, "v"))
				if curErr != nil {
					print.WarningStatusEvent(os.Stdout, "Failed to parse version: '%s'", curErr)
					continue
				}
				if cur.GreaterThan(latestVersion) {
					latestVersion = cur
				}
			}
		}

		if latestVersion.Equal(defaultVersion) {
			return "", fmt.Errorf("no releases")
		}

		return latestVersion.String(), nil
	})
}
⌛  Making the jump to hyperspace...
ℹ️  Note: To install Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced

ℹ️  Container images will be pulled from Docker Hub
↙  Deploying the Dapr control plane with latest version to your cluster...⚠  Failed to parse version: 'Malformed version: edge'
✅  Deploying the Dapr control plane with latest version to your cluster...
✅  Deploying the Dapr dashboard with latest version to your cluster...
✅  Success! Dapr has been installed to namespace dapr-system. To verify, run `dapr status -k' in your terminal. To get started, go here: https://docs.dapr.io/getting-started
NAMESPACE            NAME                                                  READY   STATUS    RESTARTS   AGE
dapr-system          dapr-dashboard-6d7744b449-dkvrh                       1/1     Running   0          4m40s
dapr-system          dapr-operator-5bb4bbcbc-n24qf                         1/1     Running   0          4m41s
dapr-system          dapr-placement-server-0                               1/1     Running   0          4m41s
dapr-system          dapr-scheduler-server-0                               1/1     Running   0          4m41s
dapr-system          dapr-sentry-759fffd946-5whw9                          1/1     Running   0          4m41s
dapr-system          dapr-sidecar-injector-74579cbcbb-cdbnt                1/1     Running   0          4m41s

@edwardfward
Copy link

@dlkinney @tgermain-impirica @lidalve @santypr

Looks like the errant tag causing the issue has been changed/removed. Recommend another dapr init -k attempt.

New binary with no errors...should work with the existing binary.

⌛  Making the jump to hyperspace...
ℹ️  Note: To install Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced

ℹ️  Container images will be pulled from Docker Hub
✅  Deploying the Dapr control plane with latest version to your cluster...
✅  Deploying the Dapr dashboard with latest version to your cluster...
✅  Success! Dapr has been installed to namespace dapr-system. To verify, run `dapr status -k' in your terminal. To get started, go here: https://docs.dapr.io/getting-started

@tgermain-impirica
Copy link
Author

Good morning all. My environment is now working. I suspect some form of server side outage that caused an intermittent crash when downloading files.

Thank you all for the speedy and thorough engagement!

@spr-davidkinney
Copy link

Thank you, everyone!

@edwardfward
Copy link

@tgermain-impirica I am not sure it is completely resolved, may be an issue with brew install dapr/tap/dapr-cli

I am still seeing the vedge error when I install dapr via Homebrew.

==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Fetching dapr/tap/dapr-cli
==> Downloading https://github.com/dapr/homebrew-tap/releases/download/v1.14.1/dapr-cli-1.14.1.arm64_sonoma.bottle.tar.gz
Already downloaded: /Users/edward/Library/Caches/Homebrew/downloads/d2d34814cf13853c3c39725e7da6a2ed6d0a6093cba709d983a7c9a910b90c33--dapr-cli-1.14.1.arm64_sonoma.bottle.tar.gz
==> Installing dapr-cli from dapr/tap
==> Pouring dapr-cli-1.14.1.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/dapr-cli/1.14.1: 6 files, 79.8MB
==> Running `brew cleanup dapr-cli`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
(base) edward@Mac sabre-api-go % dapr --version
CLI version: edge 
Runtime version: n/a

No issue when I install dapr via:

curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash

Getting the latest Dapr CLI...

Dapr CLI is detected:
CLI version: edge 
Runtime version: n/a
Reinstalling Dapr CLI - /usr/local/bin/dapr...

Installing v1.14.1 Dapr CLI...
Downloading https://github.com/dapr/cli/releases/download/v1.14.1/dapr_darwin_arm64.tar.gz ...
Password:
dapr installed into /usr/local/bin successfully.
CLI version: 1.14.1 
Runtime version: n/a

@antontroshin
Copy link
Contributor

Thanks, everyone for reporting and troubleshooting the issue!
The PR addressing the non-semver release tags was merged (#1469) and will be released with the upcoming version.

@antontroshin
Copy link
Contributor

@edwardfward Hi, thanks for checking the brew install as well.
I've just run through checking both brew and curl installation methods.
Both worked ok and no vedge version was encountered. The release tag was removed.
One thing I've noticed, after using brew install, dapr alias keeps pointing to brew location even after using curl install again.
To solve it, had to run brew uninstall dapr-cli and the path pointed to curl install location.
Would also recommend reloading the terminal session after the installation.
Here's the output:

➜  ~ dapr version
CLI version: 1.14.1
Runtime version: n/a
➜  ~ which dapr
/usr/local/bin/dapr
➜  ~ brew install dapr/tap/dapr-cli
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Fetching dapr/tap/dapr-cli
==> Downloading https://github.com/dapr/homebrew-tap/releases/download/v1.14.1/dapr-cli-1.14.1.arm64_sonoma.bottle.tar.gz
Already downloaded: /Users/anton/Library/Caches/Homebrew/downloads/d2d34814cf13853c3c39725e7da6a2ed6d0a6093cba709d983a7c9a910b90c33--dapr-cli-1.14.1.arm64_sonoma.bottle.tar.gz
==> Installing dapr-cli from dapr/tap
==> Pouring dapr-cli-1.14.1.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/dapr-cli/1.14.1: 6 files, 79.8MB
==> Running `brew cleanup dapr-cli`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
➜  ~ which dapr
/usr/local/bin/dapr
➜  ~ source ~/.zshrc
➜  ~ which dapr
/opt/homebrew/bin/dapr
➜  ~ curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash
Getting the latest Dapr CLI...

Dapr CLI is detected:
CLI version: 1.14.1
Runtime version: n/a
Reinstalling Dapr CLI - /usr/local/bin/dapr...

Installing v1.14.1 Dapr CLI...
Downloading https://github.com/dapr/cli/releases/download/v1.14.1/dapr_darwin_arm64.tar.gz ...
Password:
dapr installed into /usr/local/bin successfully.
CLI version: 1.14.1
Runtime version: n/a

To get started with Dapr, please visit https://docs.dapr.io/getting-started/
➜  ~ which dapr
/opt/homebrew/bin/dapr
➜  ~ source ~/.zshrc
➜  ~ which dapr
/opt/homebrew/bin/dapr
➜  ~ brew uninstall dapr-cli
Uninstalling /opt/homebrew/Cellar/dapr-cli/1.14.1... (6 files, 79.8MB)
➜  ~ which dapr
/usr/local/bin/dapr
➜  ~ source ~/.zshrc
➜  ~ which dapr
/usr/local/bin/dapr
➜  ~ dapr version
CLI version: 1.14.1
Runtime version: n/a

@edwardfward
Copy link

Thank you, @antontroshin. We appreciate the quick turn on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants