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

rados: Operation not supported #95

Closed
qrpike opened this issue Aug 8, 2019 · 6 comments
Closed

rados: Operation not supported #95

qrpike opened this issue Aug 8, 2019 · 6 comments
Labels

Comments

@qrpike
Copy link

qrpike commented Aug 8, 2019

I am trying to get a basic version working on my local ceph installation. However, I keep getting operation not supported, however it seems luminous is supported by this library. Any help would be greatly appreciated.

Go code:

package main

import (
	"fmt"
	"flag"
	rados "github.com/ceph/go-ceph/rados"
)

var addr *string = flag.String("addr", "", "a string")

func main(){

	flag.Parse()
	fmt.Println("Starting")
	conn, err := rados.NewConn(); if err != nil {
		panic( err )
	}
	fmt.Println("Connection created")
	err = conn.ParseCmdLineArgs( []string{ "--mon-host", *addr } ); if err != nil {
		panic( err )
	}
	err = conn.ReadDefaultConfigFile(); if err != nil {
		panic( err )
	}
	fmt.Println("Read Default Config")
	err = conn.Connect(); if err != nil {
		panic( err )
	}
	fmt.Println("Connected")

	pools, _ := conn.ListPools()
	fmt.Println(pools)

}

Build Script:

#/bin/bash
export CGO_CPPFLAGS="-I/ceph/src/include"
export CGO_LDFLAGS="-L/ceph/build/lib"
go build .

Ceph Versions:

$ ceph osd versions
{
    "ceph version 12.2.1 (3e7492b9ada8bdc9a5cd0feafd42fbca27f9c38e) luminous (stable)": 63
}
$ ceph mon versions
{
    "ceph version 12.2.2 (cf0baeeeeba3b47f9427c6c97e2144b094b7e5ba) luminous (stable)": 3
}

Application output:

Starting
Connection created
Read Default Config
panic: rados: Operation not supported

goroutine 1 [running]:
main.main()
	/go/src/github.com/org/repo/main.go:29 +0x3b1
@qrpike
Copy link
Author

qrpike commented Aug 12, 2019

Bump? Is there any additional information I can provide to help add context around the issue?

@dotnwat
Copy link
Contributor

dotnwat commented Aug 12, 2019

@qrpike this is a little strange. can you find out what version of the rados library you are linking to?

@qrpike
Copy link
Author

qrpike commented Aug 12, 2019

@noahdesu Sure, here is the output:

$ apt show libcephfs-dev librados-dev librbd-dev
Package: libcephfs-dev
Version: 12.2.12-1xenial
Priority: optional
Section: libdevel
Source: ceph
Maintainer: Ceph Maintainers <ceph-maintainers@lists.ceph.com>
Installed-Size: 89.1 kB
Depends: libcephfs2 (= 12.2.12-1xenial)
Conflicts: libceph-dev, libceph1-dev, libcephfs2-dev
Replaces: libceph-dev, libceph1-dev, libcephfs2-dev
Homepage: http://ceph.com/
Download-Size: 18.3 kB
APT-Manual-Installed: yes
APT-Sources: https://download.ceph.com/debian-luminous xenial/main amd64 Packages
Description: Ceph distributed file system client library (development files)
 Ceph is a massively scalable, open-source, distributed
 storage system that runs on commodity hardware and delivers object,
 block and file system storage.  This is a
 shared library allowing applications to access a Ceph distributed
 file system via a POSIX-like interface.
 .
 This package contains development files needed for building applications that
 link against libcephfs.

Package: librados-dev
Version: 12.2.12-1xenial
Priority: optional
Section: libdevel
Source: ceph
Maintainer: Ceph Maintainers <ceph-maintainers@lists.ceph.com>
Installed-Size: 2623 kB
Depends: librados2 (= 12.2.12-1xenial), libc6 (>= 2.16), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2)
Conflicts: librados1-dev, librados2-dev
Replaces: librados1-dev, librados2-dev
Homepage: http://ceph.com/
Download-Size: 578 kB
APT-Manual-Installed: yes
APT-Sources: https://download.ceph.com/debian-luminous xenial/main amd64 Packages
Description: RADOS distributed object store client library (development files)
 RADOS is a reliable, autonomic distributed object storage cluster
 developed as part of the Ceph distributed storage system.  This is a
 shared library allowing applications to access the distributed object
 store using a simple file-like interface.
 .
 This package contains development files needed for building applications that
 link against librados.

Package: librbd-dev
Version: 12.2.12-1xenial
Priority: optional
Section: libdevel
Source: ceph
Maintainer: Ceph Maintainers <ceph-maintainers@lists.ceph.com>
Installed-Size: 78.8 kB
Depends: librados-dev (= 12.2.12-1xenial), librbd1 (= 12.2.12-1xenial)
Conflicts: librbd1-dev
Replaces: librbd1-dev
Homepage: http://ceph.com/
Download-Size: 16.3 kB
APT-Manual-Installed: yes
APT-Sources: https://download.ceph.com/debian-luminous xenial/main amd64 Packages
Description: RADOS block device client library (development files)

N: There are 3 additional records. Please use the '-a' switch to see them.

Also, here is the Docker file I'm using to build this image:

FROM golang:1.12.7

RUN apt-get update && apt-get install -y \
  apt-transport-https \
  git \
  software-properties-common \
  uuid-runtime \
  wget

ARG CEPH_REPO_URL=https://download.ceph.com/debian-luminous/
RUN wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
RUN apt-add-repository "deb ${CEPH_REPO_URL} xenial main"

RUN apt-get update
RUN apt-get install libcephfs-dev librados-dev librbd-dev -y

RUN go get github.com/ceph/go-ceph

@dotnwat
Copy link
Contributor

dotnwat commented Aug 12, 2019

what happens if you remove the ParseCmdLineArgs line and get the monitor address from the default ceph.conf file? does the local rados cli tool work for you on the same node by reading the default ceph.conf?

@gopherunner
Copy link

I'm also having troubles (same error msg = "Operation not supported") trying to establish a connection while passing one of the MON ip addr:

client, err := NewCephClient(cephConfig.MonHost, cephConfig.MonPort)
	if err != nil {
		fmt.Printf("[ERROR] While trying to establish the connection to the ceph cluster %s\n", err.Error())
	}

	defer client.Destroy()

any ideas?, basically I want to establish a connection to get some space info from the cluster

@phlogistonjohn
Copy link
Collaborator

@qrpike and @gopherunner are you still having issues with this topic? If the issues are resolved or no longer relevant to you I'd like to close this issue. If the issue remains idle for a couple of weeks I will also close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants