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

Peer doesn't recognise absolute windows paths for snapshot root dir #2998

Closed
davidkel opened this issue Oct 26, 2021 · 0 comments · Fixed by #3000
Closed

Peer doesn't recognise absolute windows paths for snapshot root dir #2998

davidkel opened this issue Oct 26, 2021 · 0 comments · Fixed by #3000

Comments

@davidkel
Copy link
Contributor

Peer fails to start when a valid windows path is provided for the snapshot root dir

panic: Error in instantiating ledger provider: invalid path: C:\_SourceCode\github-mine\FabricOnWindows\test-env\data\peer-org1\data\snapshots. The path for the snapshot dir is expected to be an absolute path

Looking at the source code in fabric

	if !path.IsAbs(snapshotsRootDir) {
		return errors.Errorf("invalid path: %s. The path for the snapshot dir is expected to be an absolute path", snapshotsRootDir)
	}

But in go, path.IsAbs is implemented as

// IsAbs reports whether the path is absolute.
func IsAbs(path string) bool {
        return len(path) > 0 && path[0] == '/'
}

there is an alternative implementation in path/filepath which has platform specific implementations which should be moved to.
(All other IsAbs in the fabric codebase use filepath)

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

Successfully merging a pull request may close this issue.

1 participant