Coder Social home page Coder Social logo

jacquayj / gorods Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 5.0 5.94 MB

Golang binding for iRODS C API: An iRODS client library written in Golang + C

Home Page: https://godoc.org/github.com/jjacquay712/GoRODS

License: BSD 3-Clause "New" or "Revised" License

Go 65.71% C 33.14% C++ 0.87% Dockerfile 0.28%
irods golang golang-bindings irods-client

gorods's Introduction

Hi there, I'm John Jacquay ๐Ÿ‘‹

๐Ÿฉบ Writing medical device software, cloud infrastructure, & ML tools โš•๏ธ

gorods's People

Contributors

jacquayj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gorods's Issues

Implement Collection.Delete()

Following on from the ability to create collections, we're going to need to be able to delete collections from iRODS, similar to the iRODS irm function.

https://docs.irods.org/4.1.8/icommands/user/#irm

Likely options we'll need would include:

  • Recursive option, delete all subcollections, data objects, etc (though Im not sure what happens to any subcollections, etc. if you don't do a recursive delete, do these become 'orphan' files?), default would be false
  • Force option, skip sending deleted items to the trash first, default would be false

The method signature might be something like this:

func (col *Collection) Delete(force bool, recursive bool) error

S.

Reported: Additional packages required to build GoRods

The only package that should be required is irods-dev-4.1.8, but this might not be the case. Needs further investigation.

Lib Dependencies, seems to be covered by "rpm -ql irods-dev":

 /usr/lib/libirods_client.a
 /usr/lib/libirods_client_api.a
 /usr/lib/irods/externals/libboost_thread.a
 /usr/lib/irods/externals/libboost_system.a
 /usr/lib/irods/externals/libboost_filesystem.a
 /usr/lib/irods/externals/libboost_program_options.a
 /usr/lib/irods/externals/libboost_chrono.a
 /usr/lib/irods/externals/libboost_regex.a
 /usr/lib/irods/externals/libjansson.a
 /usr/lib/libirods_client_core.a
 /usr/lib/libirods_client_plugins.a

 -lz -lssl -lcrypto -ldl -lpthread -lm -lrt -lstdc++ -rdynamic -Wno-write-strings -DBOOST_SYSTEM_NO_DEPRECATED

compilation problem

Following the instructions, compilation fails on
$ go get github.com/jjacquay712/GoRODS

github.com/jjacquay712/GoRODS

/usr/bin/ld: cannot find -lc++
/usr/bin/ld: cannot find -lc++abi
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status

Standard ubuntu 18.04.1 LTS image

HTTP Download appears to require Write access to the data object or collection

I have a collection and a group which has READ access to that collection. From the command line, the group members can read files (iget, etc) but cannot upload (iput) files into that collection.

If I use GoRods to access the collection they can see the files but if I kick off an http download then this fails with a lack of permissions error. However, if I grant iRODS WRITE access to that collection then http now downloads work. This doesn't seem to be how this is meant to work as now my READ-only collection has to be R/W in order for users to Read (download) the files via the web.

The relevant parts of the http handler code are below, is GoRods writing any temp data anywhere during the ReadChunk() (NB writer is an http.ResponseWriter object, I don't imagine this is influenced by the iRODS write permissions in any way)

obj, err := con.DataObject(filePath)
            if err != nil {
                http.Redirect(writer, request, request.Referer(), http.StatusNotFound)
                return
            }

            attachmentString := "attachment; filename=\"" + file + "\""
            writer.Header().Set("Content-Disposition", attachmentString)
            writer.Header().Set("Pragma", "public")
            writer.Header().Set("Cache-Control", "must-revalidate, post-check=0, pre-check=0")
            writer.Header().Set("Content-Length", strconv.FormatInt(obj.Size, 10))

            obj.ReadChunk(4096, func(chunk []byte) {
                writer.Write(chunk)
            })

Ability to extract archive files (zip, tar, etc) into collections

The ibun command allows iRODS to expand and compress standard archive file formats such as tar, zip, etc.

https://docs.irods.org/4.1.8/icommands/user/#ibun

Similar functionality in GoRods would be useful to allow the upload of a .zip archive and then have the ability for GoRods to extract it into a new collection along the same lines as ibun -x. This would be of great use as a way for users to load groups of files into iRODS - they could archive files locally, then upload into iRODS and extract them there as needed.

Supporting >1 metadata object with the same Attribute

iRODS doesn't care if you have more than one AVU with the same attribute. GoRods, however, appears to make the assumption that there can be only one Metadata AVU with a given Attribute associated with a particular collection or data object.

e.g. the Add() function checks to see if an AVU with this attribute already exists and if so, it prevents a new one being added:
https://github.com/jjacquay712/GoRods/blob/master/meta.go#L310

Supporting iRODS' functionality would seem to be the route to take though this will require some refactoring, etc. to support handling potentially 0..many returned metadata objects as opposed to the current assumption of just ne.

Implement iRods Connection Pooling

Proposed syntax:

gorods.connpool.New(int connExpire, int maxConn) // create connection pool, specify timeout (s) for connections, maximum connections (calls Expire() first and then closes oldest connection when none were expired on each Open() after maxxConn is reached)
gorods.connpool.Expire() // close/disconnect all expired connections
gorods.connpool.Open(string userName, etc... ) // calls gorods.New() for a given iRODS user and registers them in the pool, timestamped for expiration, etc.
gorods.connpool.Close(string userName) // explicit close/disconect of a connection (from logout, etc.) from the pool
gorods.connpool.Get(string userName) // returns the GoRods connection for the username

Are authentification plugins supported?

I was trying to use the openid plugin from
https://github.com/irods-contrib/irods_auth_plugin_openid

but I'm getting a totally different input from command line iinit and from gorods's iinit.
With command line, I get 8 copies of
NOTICE: created irodsHome=/tempZone/home/rods
NOTICE: created irodsCwd=/tempZone/home/rods
and then
entering openid_auth_client_start
openid_auth_client_start,_context_string: provider=keycloak_openid
NOTICE: using provided context string
NOTICE: attempting to update context from client
client using provider: keycloak_openid
entering read_sess_file
entering sess_filename()
calling getRodsEnvAuthFileName()
trying to call getenv(HOME)
HOME: /root

after some further messages, I get a URL to log in.

However, from gorods, I'm getting only 4 copies of
NOTICE: created irodsHome=/tempZone/home/rods
NOTICE: created irodsCwd=/tempZone/home/rods
followed by
rcAuthResponse failed with error -826000 CAT_INVALID_AUTHENTICATION
ERROR: 2019/09/23 11:56:53 /root/go/src/code.it4i.cz/lexis/wp8/dataset-management-interface/server/main.go:127 Error initializing irods client: 2019-09-23 11:56:53.237681954 +0000 UTC m=+0.131362935: Fatal - iRODS Connect Failed: clientLoginWithPassword error, invalid password? CAT_INVALID_AUTHENTICATION ... Exiting

This is a similar output to what I get from the command line when I remove
"irods_authentication_scheme": "openid",
from the .irods/irods_environment.json.

The documentation seems to indicate that plugins are supported, though.

Can you confirm if authentification plugins (and specifically the openid plugin) should theoretically work with gorods? Or are deep changes in the gorods source code needed?

Problem creating new metadata for data objects

I'm having some issues with creating new metadata using either dataObject.AddMeta() or mc.Add(). It seems that regardless of how I fill out the Attribute/Value/Units I get an error suggesting that I don't have the Attribute and Value (they are there), or that the attribute already exists (it doesn't, at least not in iRODS)

Snippet of relevant code, the attribute comes from the triple (which is a[]string) and in this particular example I am deliberately specifying the value and units so I know that they exist (ignoring the values of triple[1] and triple[2] for debugging purposes).

info("New metadata, Creating ", triple)
_, err := theThing.AddMeta(gorods.Meta{
  Attribute: triple[0],
  Value:     "test",
  Units:     "data",
})
if err != nil {
  warning("Problem creating metadata: ", triple, ", error: ", err)
}

the relevant log messages when I pass in a three element array containing the AVU, essentially trying to add a new A:V:U of Organism:test:data (though triple itself is ["Organism","Mouse, ""] )

New metadata, Creating  [Organism Mouse ]
WARNING 2016/07/13 13:17:24 utils.go:122: Problem creating metadata:  [Organism Mouse ] , error:  2016-07-13 13:17:24.664335411 +0000 UTC: Fatal - iRods Add Meta Failed: Please specify Attribute and Value fields or the attribute already exists

triple[0] = 'Organism' and the value and units are provided as strings so are specified, if I look in iRODS using imeta there is no 'Organism' metadata AVU triple that already exists for this object.

Any suggestions for what I might be missing? I haven't tried to see if this creation of new metadata objects work in a more isolated example, i.e. to see if there is something odd/unique about my code or environment as a whole that is the issue.

On the flips side, editing metadata triples that are already in iRODS (added via imeta) using the following approach is working fine, its just the creation of new metadata triples that appears to be causing the issue.

meta := dataObj.Attribute(attribute_name)
meta.SetValue(val)
meta.SetUnits(units)

Implement iquest functionality

https://docs.irods.org/master/icommands/user/#iquest

Idea:
ORM/DAO abstraction on top of the functions that accept SQL queries/query fragments. Maybe something similar to ActiveRecord but more iRods specific, like this:

import (
     "github.com/jjacquay712/GoRods"
     .   "github.com/jjacquay712/GoRods/orm"
)

rodsConnection.FindObjs().Where(
    And(
        MetaAttr("projectName").Equals("MyScienceProject"),
        ObjSize().GreaterThan(1024)
    )
).Each(func (obj gorods.DataObj) {
      // Do something here
})


// or this for iquest "select META_DATA_ATTR_NAMEโ€

rodsConnection.MetaAttrs().Unique().Each(...)

Fix memory leak in DataObj.ReadChunk()

Serving file over HTTP causes massive memory leak:

func main() {

    irods, err := gorods.New(gorods.ConnectionOptions {
        Type: gorods.UserDefined,

        Host: "localhost",
        Port: 1247,
        Zone: "tempZone",

        Username: "admin",
        Password: "-redacted-",
    })


    if err != nil {
        fmt.Printf("Error connecting to server: %v\n", err)
        os.Exit(1)
    }

    homeDir, err := irods.Collection("/tempZone/home/admin", false)
    if err != nil {
        p(err)
        os.Exit(1)
    }

    fileForDownload := homeDir.Get("centos.iso")


    r := mux.NewRouter()

    // Routes consist of a path and a handler function.
    r.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {


        w.Header().Set("Content-Disposition", "attachment; filename=centos.iso")
        w.Header().Set("Content-type", "application/octet-stream")
        w.Header().Set("Content-Length", strconv.FormatInt(fileForDownload.Size, 10))

        fileForDownload.ReadChunk(4096, func(chunk []byte) {
            w.Write(chunk)
        })


    })


    l, err := net.Listen("tcp4", ":8080")
    if err != nil {
        log.Fatal(err)
    }
    log.Fatal(http.Serve(l, r))


}

QueryMeta() crashes with query strings containing spaces

Calling Connection.QueryMeta() with a query string like "name = Bill" works fine, using a query string that looks like "name = Bill Smith" causes things to come crashing down. Quoting didn't seem to help (e.g. "name = 'Bill Smith'")

Here's the stack trace that I see, the first line is the log record for the POST to the search form, then the fun begins.

S.

POST /search/results HTTP/1.1
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x7f037a3ef65c]

runtime stack:
runtime.throw(0xb32780, 0x2a)
    /usr/local/go/src/runtime/panic.go:530 +0x90
runtime.sigpanic()
    /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x5a
runtime.asmcgocall(0xc8201dce70, 0x481fba)
    /usr/local/go/src/runtime/asm_amd64.s:586 +0x70

goroutine 5 [syscall, locked to thread]:
runtime.cgocall(0x811a10, 0xc8201dced8, 0x0)
    /usr/local/go/src/runtime/cgocall.go:123 +0x11b fp=0xc8201dcea0 sp=0xc8201dce70
github.com/jjacquay712/GoRods._Cfunc_free(0xbb54de)
    ??:0 +0x36 fp=0xc8201dced8 sp=0xc8201dcea0
github.com/jjacquay712/GoRods.(*Connection).QueryMeta(0xc82044c3f0, 0xc8201f7ae0, 0x12, 0x0, 0x0, 0x0, 0x7f037bf29b40, 0xc82044c450)
    /home/alice/go/src/github.com/jjacquay712/GoRods/connection.go:368 +0x808 fp=0xc8201dd060 sp=0xc8201dced8
main.results(0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/github.com/bioteam/dai/route_search.go:73 +0x8cc fp=0xc8201dd428 sp=0xc8201dd060
net/http.HandlerFunc.ServeHTTP(0xb71528, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc8201dd448 sp=0xc8201dd428
goji.io/internal.ContextWrapper.ServeHTTPC(0x7f037bf27bc0, 0xb71528, 0x7f037bf28e60, 0xc82044c1e0, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/internal/http.go:18 +0x4f fp=0xc8201dd480 sp=0xc8201dd448
goji.io/internal.(*ContextWrapper).ServeHTTPC(0xc82005d790, 0x7f037bf28e60, 0xc82044c1e0, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    <autogenerated>:2 +0xca fp=0xc8201dd4c0 sp=0xc8201dd480
goji%2eio.dispatch.ServeHTTPC(0x7f037bf28e60, 0xc82044c1e0, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/dispatch.go:17 +0xfa fp=0xc8201dd518 sp=0xc8201dd4c0
goji%2eio.(*dispatch).ServeHTTPC(0x100b198, 0x7f037bf28e60, 0xc82044c1e0, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    <autogenerated>:2 +0xbf fp=0xc8201dd550 sp=0xc8201dd518
main.authHandler.func1(0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/github.com/bioteam/dai/middleware.go:37 +0x3c4 fp=0xc8201dd858 sp=0xc8201dd550
goji%2eio.HandlerFunc.ServeHTTPC(0xc8200cb320, 0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/goji.go:93 +0x4e fp=0xc8201dd888 sp=0xc8201dd858
main.alogger.func1(0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/github.com/bioteam/dai/middleware.go:53 +0x24a fp=0xc8201dd938 sp=0xc8201dd888
goji%2eio.HandlerFunc.ServeHTTPC(0xc8200cb340, 0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/goji.go:93 +0x4e fp=0xc8201dd968 sp=0xc8201dd938
main.Apply404.func1(0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/github.com/bioteam/dai/middleware.go:66 +0x202 fp=0xc8201dda08 sp=0xc8201dd968
goji%2eio.HandlerFunc.ServeHTTPC(0xc8200cb360, 0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/goji.go:93 +0x4e fp=0xc8201dda38 sp=0xc8201dda08
goji%2eio.(*Mux).ServeHTTPC(0xc820080080, 0x7f037bf28ee0, 0xc82044c090, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/mux.go:87 +0x276 fp=0xc8201ddb08 sp=0xc8201dda38
goji%2eio.(*Mux).ServeHTTP(0xc820080080, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /home/alice/go/src/goji.io/mux.go:76 +0x82 fp=0xc8201ddb60 sp=0xc8201ddb08
net/http.serverHandler.ServeHTTP(0xc820080300, 0x7f037bf28de8, 0xc8201395f0, 0xc820160b60)
    /usr/local/go/src/net/http/server.go:2081 +0x19e fp=0xc8201ddbc0 sp=0xc8201ddb60
net/http.(*conn).serve(0xc8201c4000)
    /usr/local/go/src/net/http/server.go:1472 +0xf2e fp=0xc8201ddf88 sp=0xc8201ddbc0
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8201ddf90 sp=0xc8201ddf88
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 1 [IO wait]:
net.runtime_pollWait(0x7f037bf28c10, 0x72, 0x0)
    /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820114c30, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820114c30, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0xc820114bd0, 0x0, 0x7f037bf28d08, 0xc82000cde0)
    /usr/local/go/src/net/fd_unix.go:426 +0x27c
net.(*TCPListener).AcceptTCP(0xc82007c058, 0x4d1350, 0x0, 0x0)
    /usr/local/go/src/net/tcpsock_posix.go:254 +0x4d
net/http.tcpKeepAliveListener.Accept(0xc82007c058, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:2427 +0x41
net/http.(*Server).Serve(0xc820080300, 0x7f037bf28cd0, 0xc82007c058, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:2117 +0x129
net/http.(*Server).ListenAndServe(0xc820080300, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:2098 +0x136
main.main()
    /home/alice/go/src/github.com/bioteam/dai/main.go:83 +0xd72

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1

goroutine 19 [chan receive]:
database/sql.(*DB).connectionOpener(0xc8200f9970)
    /usr/local/go/src/database/sql/sql.go:727 +0x45
created by database/sql.Open
    /usr/local/go/src/database/sql/sql.go:493 +0x33f

goroutine 20 [IO wait]:
net.runtime_pollWait(0x7f037bf28b50, 0x72, 0xc82015c000)
    /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820114ca0, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820114ca0, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820114c40, 0xc82015c000, 0x1000, 0x1000, 0x0, 0x7f037bf1f028, 0xc82005c090)
    /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc82007c060, 0xc82015c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc82000c140, 0xc82015c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc82015a000)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc82015a000, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc82015a000, 0x0, 0x0, 0x0, 0xa5fd00, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc8200136e0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc8200136e0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc82015a000, 0xb71700, 0xc820162700, 0x0, 0x0)
    /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc820080380, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc820080380)
    /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 21 [IO wait]:
net.runtime_pollWait(0x7f037bf28a90, 0x72, 0xc820164000)
    /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820114d10, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820114d10, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820114cb0, 0xc820164000, 0x1000, 0x1000, 0x0, 0x7f037bf1f028, 0xc82005c090)
    /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc82007c068, 0xc820164000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc8200cb4e0, 0xc820164000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc8200584e0)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc8200584e0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc8200584e0, 0x0, 0x0, 0x0, 0xa5fd00, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc820156c30, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc820156c30, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc8200584e0, 0xb71700, 0xc8201609a0, 0x0, 0x0)
    /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc820080400, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc820080400)
    /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 22 [IO wait]:
net.runtime_pollWait(0x7f037bf289d0, 0x72, 0xc82015e000)
    /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820114d80, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820114d80, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820114d20, 0xc82015e000, 0x1000, 0x1000, 0x0, 0x7f037bf1f028, 0xc82005c090)
    /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc82007c070, 0xc82015e000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc8200cb580, 0xc82015e000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc820058480)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc820058480, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc820058480, 0x0, 0x0, 0x0, 0xa5fd00, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc820156c60, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc820156c60, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc820058480, 0xb71700, 0xc8201622a0, 0x0, 0x0)
    /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc820080480, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc820080480)
    /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 26 [IO wait]:
net.runtime_pollWait(0x7f037bf28850, 0x72, 0xc8201c2000)
    /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc8201c0680, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8201c0680, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8201c0620, 0xc8201c2000, 0x1000, 0x1000, 0x0, 0x7f037bf1f028, 0xc82005c090)
    /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc82007c128, 0xc8201c2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc82016b7c0, 0xc8201c2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc820058b40)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc820058b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc820058b40, 0x0, 0x0, 0x0, 0xa5fd00, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc820012060, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc820012060, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc820058b40, 0xb71700, 0xc820162460, 0x0, 0x0)
    /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc820080b00, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc820080b00)
    /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 6 [IO wait]:
net.runtime_pollWait(0x7f037bf28550, 0x72, 0xc8201e7000)
    /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc82004e290, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82004e290, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82004e230, 0xc8201e7000, 0x1000, 0x1000, 0x0, 0x7f037bf1f028, 0xc82005c090)
    /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc820020040, 0xc8201e7000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc82000ce20, 0xc8201e7000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc82015a1e0)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc82015a1e0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc82015a1e0, 0x0, 0x0, 0x0, 0xa5fd00, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc8201bed50, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc8201bed50, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc82015a1e0, 0xb71700, 0xc820162380, 0x0, 0x0)
    /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc8201c4380, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc8201c4380)
    /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2137 +0x44e

Access name of iRODS Owner for a Collection or DataObject

It would be very useful to have access to the the owner of a particular file or collection so this could be displayed on a UI, especially for collections that are shared between multiple users. This may ultimately be part of a larger ACL feature but in the short term could this be made available via a .Owner string attribute that would be part of IRodsObj or similar?

Simon.

Recursive iput question

I'm not sure if something like this is implemented within GoRODS, or if it's intended that users write the path-walking and such directly. Thanks in advance!

GoRODS for dummies, question

Hi John,

I saw the presentation of GoRODS on irods.org, and was fairly impressed. We'd very much like to use this library.

We're looking to create a sort of proxy server that can serve data from a remote iRODS server over HTTP. More specifically, we're looking for something that understands standard GET byte range requests. Do you think this is possible using GoRODS?

To be completely honest, I've got no experience with golang whatsoever, so I'm kind of swimming in the deep here, but I'd really like to use this library. Your HOWTO is pretty clear byte ranges are supported, but if you could help me out with this specific case, that'd be really awesome.

Thanks for the info!
M

PS, this is related to irods/irods#3471

Error adding metadata to a dataObject with no preexisting metadata in iRODS

If an object has no existing metadata associated with it then it appears that the object's MetaCollection is nil. If you try to add a new metadata triple then this fails because the MetaCollection is nil and there doesn't appear to be a way to initialize an empty meta collection in order to add new metadata to it.

The error message I'm seeing is:

Problem creating metadata: 2016-07-13 19:46:34.394670434 +0000 UTC: Fatal - iRods Get Meta Failed: 0x7fbfcc09cc70, None

It looks like its coming from MetaCollection.ReadMeta() at 166 (and would also come from 173 for Collections)

https://github.com/jjacquay712/GoRods/blob/master/meta.go#L149

I suspect its being thrown because the code goes all the way down to iRODS to find metadata but then still comes up empty and there isn't anything in place to handle that case and instantiate an appropriate empty MetaCollection that we can then populate going forward.

S.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.