G-Node / gin-cli

Command line client for GIN
https://gin.g-node.org
Other
12 stars 6 forks source link

Some commands are not available #218

Closed beheerderdag closed 5 years ago

beheerderdag commented 6 years ago

I just installed a local GIN server in Centos 7. I was able to start the web interface. However, I am getting "Some commands are not available" message.

# gin-cli repos
* sharifi/test1234
    Location: http://localhost:3000/sharifi/test1234
    This repository is public

# gin-cli create large-data
[error] The 'create' command is not available because it requires git and git-annex:
  git-annex: unrecognized option `--raw'

Usage: git-annex version  [option ...]

To see additional options common to all commands, run: git annex help options

I have git and git-annex installed

# git annex version 
git-annex version: 5.20140221
build flags: Assistant Inotify DBus Quvi TDFA
key/value backends: SHA256E SHA1E SHA512E SHA224E SHA384E SHA256 SHA1 SHA512 SHA224 SHA384 WORM URL
remote types: git gcrypt bup directory rsync web tahoe glacier hook external
local repository version: 5
supported repository version: 5
upgrade supported from repository versions: 0 1 2 4

I think I am missing a step in the setup with git-annex.

achilleas-k commented 6 years ago

I think I am missing a step in the setup with git-annex.

It doesn't look like you missed any steps but the issue is that the version of git-annex on your system is very old. The gin-cli requires a few features that were added to version 6 of git-annex and the minimum required version is 6.20171108 (Nov 2017). It looks like the latest on Centos 7 is from 2014.

The gin-cli disables commands that require git-annex when it detects that the version is too old (or when it can't find git-annex at all). In your case, it tries to get the installed version, but it can't understand the format of the version output (it looks like the --raw flag to git-annex version, which makes the version string parseable, was added after 2014).

This is all just informational, let's talk about solutions: I think the best solution would be to get git-annex-standalone: https://git-annex.branchable.com/install/Linux_standalone/ This is an up-to-date archive of git-annex bundled with all its dependencies. If you decide to use this, you'll have to download and extract it and then either:

  1. Put the path to the git and git-annex binaries from the archive into your $PATH before the systemwide bin paths, or
  2. Configure the gin-cli to use the binaries from the standalone bundle.

To configure the gin-cli, you can create a file called config.yml in ~/.config/g-node/gin/ with the following contents:

bin:
  git: <path to git-annex-standalone>/exe/git
  gitannex: <path to git-annex-standalone>/exe/git-annex
  ssh: <path to git-annex-standalone>/exe/ssh

where <path to git-annex-standalone> is the location where the downloaded archive was extracted.

More information on configuring the client can be found here: https://github.com/G-Node/gin-cli/blob/master/doc/config.md

Let me know if you have any further questions.

beheerderdag commented 6 years ago

ok. it worked. I can create a repo

[root@145 test1234]# gin-cli create large-data
:: Creating repository 'sharifi/large-data' [Macaron] 2018-09-24 21:56:17: Started POST /api/v1/user/repos for [::1]
[Macaron] 2018-09-24 21:56:17: Completed POST /api/v1/user/repos 201 Created in 123.342789ms
OK
 Downloading repository OK 
 Initialising local storage OK 
[Macaron] 2018-09-24 21:56:19: Started HEAD /sharifi/large-data/tasks/trigger?branch=master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 21:56:19: Completed HEAD /sharifi/large-data/tasks/trigger?branch=master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.450613ms
[Macaron] 2018-09-24 21:56:19: Started HEAD /sharifi/large-data/tasks/trigger?branch=synced/git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 21:56:19: Completed HEAD /sharifi/large-data/tasks/trigger?branch=synced/git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.514366ms
[Macaron] 2018-09-24 21:56:19: Started HEAD /sharifi/large-data/tasks/trigger?branch=synced/master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 21:56:19: Completed HEAD /sharifi/large-data/tasks/trigger?branch=synced/master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.027433ms
[Macaron] 2018-09-24 21:56:20: Started HEAD /sharifi/large-data/tasks/trigger?branch=git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 21:56:20: Completed HEAD /sharifi/large-data/tasks/trigger?branch=git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.247634ms

Now, trying an upload:

# gin-cli upload test100M
 Adding (annex) test100M OK                                                     
 [=========================================================================] 1/1
:: Recording changes OK
 Compressing OK  
[Macaron] 2018-09-24 22:04:46: Started HEAD /sharifi/large-data/tasks/trigger?branch=master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 22:04:46: Completed HEAD /sharifi/large-data/tasks/trigger?branch=master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.238199ms
[Macaron] 2018-09-24 22:04:47: Started HEAD /sharifi/large-data/tasks/trigger?branch=synced/git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 22:04:47: Completed HEAD /sharifi/large-data/tasks/trigger?branch=synced/git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.212858ms
[Macaron] 2018-09-24 22:04:47: Started HEAD /sharifi/large-data/tasks/trigger?branch=synced/master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 22:04:47: Completed HEAD /sharifi/large-data/tasks/trigger?branch=synced/master&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.10381ms
[Macaron] 2018-09-24 22:04:47: Started HEAD /sharifi/large-data/tasks/trigger?branch=git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 for 127.0.0.1
[Macaron] 2018-09-24 22:04:47: Completed HEAD /sharifi/large-data/tasks/trigger?branch=git-annex&secret=8b6db411fd9483649ed734cbf38f64e1&pusher=1 202 Accepted in 2.05159ms

[error] 1 operation failed

I do see the symlink created but what operation failed?

# ls -lrt test100M
lrwxrwxrwx. 1 root root 122 Sep 24 22:02 test100M -> .git/annex/objects/J6/05/MD5-s104857600--2f282b84e7e608d5852449ed940bfc51/MD5-s104857600--2f282b84e7e608d5852449ed940bfc51

I also see the file in the web. But, gin-cli ls says not uploaded.

$ gin-cli ls
Locally modified (not uploaded):

    test100M
achilleas-k commented 6 years ago

Probably what happened is the metadata of the file (the symlink and file information) have been pushed but the content wasn't uploaded. I have to apologise, because after your first message, I focused on solving the gin-cli issue but overlooked the fact that you're using a locally deployed server. This complicates things. It's possible the server setup has some issues. I'm not sure where exactly all that output is coming from; it's clearly server log info, but I don't now why it's showing up in the client output.

Could you tell me more about how you set up the gin server?

beheerderdag commented 6 years ago

I followed the instructions for the local install without docker: https://web.gin.g-node.org/G-Node/Info/wiki/InHouseWithoutDocker

achilleas-k commented 6 years ago

That makes things a bit harder. It's hard to know what versions of libraries and utilities are on the system and how they interact, so I don't know what the issue might be. As the instructions say at the top, they're mostly based on Ubuntu 16.04 and although they should work for most other distributions, it gets harder with distributions that have different package versions.

I would recommend trying the Docker version if there's no technical reason to avoid it. It should be relatively hassle-free.

achilleas-k commented 5 years ago

Closing: Inactive.