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

CopyToRemote return error: 'proto: cannot parse invalid wire-format data' #293

Open
baiweiguo opened this issue May 6, 2022 · 0 comments

Comments

@baiweiguo
Copy link

baiweiguo commented May 6, 2022

when I use CopyToRemote method,return error: 'copy err: proto: cannot parse invalid wire-format data', whereas copytoremote.txt is created ok in hadoop, but it has no content, I have no idea what's wrong.

image

image

here is my code:

package main

import (
        "fmt"
        "os"

        "github.com/colinmarc/hdfs/v2"
)

func main() {
        options := hdfs.ClientOptions{
                Addresses: []string{"127.0.0.1:9000"},
                User:      "hadoop",
        }
        client, err := hdfs.NewClient(options)
        if err != nil {
                fmt.Println("new err:", err)
                return
        }

        var mode = 0777 | os.ModeDir
        err = client.MkdirAll("/_test", mode)
        if err != nil {
                fmt.Println("mk err:", err)
                return
        }

        err = client.CopyToRemote("./testdata/mobydick.txt", "/_test/copytoremote.txt")
        if err != nil {
                fmt.Println("cp err:", err)
                return
        }
        fmt.Println("ok")
}
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

1 participant