-
Notifications
You must be signed in to change notification settings - Fork 255
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
Input/Output Errors When Reading/Writing Files After Successfully Mounting CephFS Using go-ceph/cephfs #1041
Comments
Wow, these are both quite old and not maintained anymore. There is a very similar existing test: Lines 80 to 96 in 2c86010
I have added an extra t.Run("writeAndReadInDir", func(t *testing.T) {
dirname := "/TestDir"
dfname := dirname + "/" + fname
err := mount.MakeDir(dirname, 0777)
assert.NoError(t, err)
defer func() { assert.NoError(t, mount.RemoveDir(dirname)) }()
// idempotent open for read and write
f1, err := mount.Open(dfname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
n, err := f1.Write([]byte("yello world!"))
assert.NoError(t, err)
assert.EqualValues(t, 12, n)
err = f1.Close()
assert.NoError(t, err)
defer func() { assert.NoError(t, mount.Unlink(dfname)) }()
buf := make([]byte, 1024)
f2, err := mount.Open(dfname, os.O_RDONLY, 0)
n, err = f2.Read(buf)
assert.NoError(t, err)
assert.EqualValues(t, 12, n)
assert.Equal(t, "yello world!", string(buf[:n]))
}) After that, running
This probably indicates a permission or other configuration mistake on the Ceph cluster. Maybe logs from the MDS or OSD processes give a hint on what could be wrong? Have you used the same credentials for mounting with kernel or fuse CephFS, and did that work? |
I'll 2nd the "wow that's really old" comment from @nixpanic - it's so old that I hesitate to invest a lot of effort here. Please consider upgrading to something more recent & supported by the upstream projects. I will add that ceph has various debugging option that can be loaded via a ceph.conf or config set functions. See https://docs.ceph.com/en/latest/rados/troubleshooting/log-and-debug/ |
Oh, I should add I generally find it simpler to turn them all on to level 10. It produces a huge amount of output but I never seem to be able to guess the proper subsystem name for what I am looking for and so I just prefer to cast a wide net. |
@nixpanic Thank you for your reply.
And I used ceph-fuse to mount the cephfs manually and can read/write the file successfully. |
@phlogistonjohn Thank you for your reply.
|
Hello,
I am encountering input/output errors when trying to read and write files after successfully mounting the Ceph File System (CephFS) using the go-ceph/cephfs library.
Context:
I have successfully mounted the CephFS manually, and I can create directories and files without any issues.
However, when using the go-ceph/cephfs interface to perform read and write operations, I encounter input/output errors.
Error Output:
go run -tags luminous test.go
Success creating CephFS mount
Success reading default config file
Success mounting CephFS
Directory created successfully.
Error writing to file: cephfs: ret=5, Input/output error
Details:
go-ceph v0.4.0
ceph luminous
Could anyone provide insights or suggestions on why this might be happening? Any help would be greatly appreciated!
Thank you!
the code is attached.
code.md
The text was updated successfully, but these errors were encountered: