code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="209.250.56.176"
 subject="comment 1"
 date="2014-05-30T19:15:33Z"
 content="""
What I see in the log is git-annex is syncing files to/from the remote \"diskstation\". This remote is not encrypted at all, so git-annex is not using gpg. There is no mention of gpg in the log at all.

So, I don't see any indication that whatever is causing too many gpg-agent processes to be spawned is git-annex. Can you share more information that would point toward git-annex being the cause of this problem?
"""]]

repo_name: kakafarm/git

license: unknown


code:
### Please describe the problem.

When commands that need gpg like `git annex copy` are run inside tmux, the GPG prompt does not show up and the user cannot give their password.

Running the same command outside tmux causes GPG to properly show its prompt

### What steps will reproduce the problem?

    $ tmux
    TMUX$ GIT_ANNEX_ROOT/runshell
    TMUX$ git annex copy --not -in remote --to remote

git-annex will show the name of the first filename but will get stuck soon after that, waiting for GPG.

### What version of git-annex are you using? On what operating system?

git-annex 5.20140708-g8c9cc55c from the precompiled binaries, run inside tmux 1.6.

`tmux.conf` contains `set-option -g default-command $SHELL` (this means that a normal shell is spawned, not a login shell)

Ubuntu 12.04.4

[[!tag moreinfo]]

> [[done]]; apparently a local misconfiguration of some sort. --[[Joey]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="209.250.56.2"
 subject="comment 1"
 date="2014-07-10T18:24:17Z"
 content="""
I cannot reproduce this. I made sure to unset `GPG_AGENT_INFO` so gpg would need to prompt for a password on the terminal, and it did.

<pre>
joey@darkstar:~/tmp/r>unset GPG_AGENT_INFO
joey@darkstar:~/tmp/r>git annex copy --to remote
copy n/xxx (gpg)
You need a passphrase to unlock the secret key for
user: \"Joey Hess <joeyh@debian.org>\"
4096-bit RSA key, ID 17065459, created 2009-06-17 (main key ID 2512E3C7)

gpg: gpg-agent is not available in this session
Enter passphrase:
</pre>

I cannot think of anything that would make gpg's password prompting behave differently inside tmux than outside, either.

I think that to debug this, you are going to need to look at what the gpg process is trying to do.
"""]]


code:
[[!comment format=mdwn
 username="http://svario.it/gioele"
 nickname="gioele"
 subject="GPG_AGENT_INFO was already set in the outside shell"
 date="2014-07-11T07:19:45Z"
 content="""
I found what the problem is: GPG_AGENT_INFO was already set in the outside shell.

Unsetting GPG_AGENT_INFO fixes the problem.
"""]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="209.250.56.2"
 subject="comment 3"
 date="2014-07-11T18:15:09Z"
 content="""
AFAICS there is no problem with GPG_AGENT_INFO being set while using tmux. The gpg agent works as usual and pops up a passphrase prompt window.

Is there something broken in your gpg agent that prevents it from working inside tmux, or working at all? In any case, this seems like a local misconfiruation problem and out of git-annex's scope anyway so I suppose I will close the bug.

"""]]


code:
### Please describe the problem.
Bad input data given to gpg will make it lock.

### What steps will reproduce the problem?
Trying to download gpg encrypted data from remote with bad/incorrect data

### What version of git-annex are you using? On what operating system?
4.20130501-gd9e288b, on ubuntu 13.04

### Please provide any additional information below.
Transcript
http://paste.ubuntu.com/5626517/

Note: The problem is most likely caused by bad data from either the nntp hooks program, or the nntp server itself.

I also have one file with bad data that consistently is NOT a problem for gpg to handle(lines 24-25 of log).

[[!tag moreinfo]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 nickname="joey"
 subject="comment 1"
 date="2013-05-06T17:09:58Z"
 content="""
What version of gnupg do you have installed?

<pre>
gpg: block_filter 0x946320: read error (size=12864,a->size=12864)
gpg: [don't know]: invalid packet (ctb=68)
gpg: [don't know]: invalid packet (ctb=21)
gpg: mdc_packet with invalid encoding
gpg: decryption failed: invalid packet
gpg: [don't know]: invalid packet (ctb=00)
gpg: block_filter: pending bytes!
</pre>

I don't see how git-annex can possibly guard against gpg behaving this way when given bad data. So the best thing to do would be to get a test case file that causes gpg to behave this way, and then I could file a bug on gpg and get it fixed to immediately exit.

I tried to reproduce this by encrypting a 1 mb file with gpg. This yeilded a 1.1 mb file. I then truncated it back to 1 mb, and tried to decrypt it.

[[!format sh \"\"\"
joey@gnu:~>gpg --decrypt me2.gpg > x
gpg: encrypted with 1 passphrase
gpg: block_filter 0x9d6fda0: read error (size=15680,a->size=15680)
gpg: Problem reading source (8570 bytes remaining)
gpg: handle plaintext failed: file read error
gpg: mdc_packet with invalid encoding
gpg: decryption failed: invalid packet
gpg: block_filter: pending bytes!
zsh: exit 2     gpg --decrypt
\"\"\"]]

gpg exited immediately on error, which is what it should do. So it doesn't seem likely I can guess at a test case file that causes gpg to behave this way. You will need to provide one for me to help.
"""]]


code:
### Please describe the problem.
shiny-2:MacOS ovi$ git annex sync
git: 'annex' is not a git command. See 'git --help'.
shiny-2:MacOS ovi$

### What steps will reproduce the problem?
INstall git-annex for MAC like this: http://git-annex.branchable.com/install/OSX/ via .dmg file then try above commands from your terminal

### What version of git-annex are you using? On what operating system?
Version: 5.20140420-ga25b8bb Build flags: Assistant Webapp Webapp-secure Pairing Testsuite S3 WebDAV FsEvents XMPP DNS Feeds Quvi TDFA CryptoHash
Mac OSX 10.9.2

### Please provide any additional information below.
I tried adding the path to my .bash_profile manually like this but it didn't help (actually, this was already in there, I just added the path to git-annex to the string):
export PATH=/opt/local/bin:/opt/local/sbin/Applications/git-annex.app/Contents/MacOS:$PATH

[[!format sh """
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log

# End of transcript or log.
"""]]

> To the extent this is a bug report, it's a duplicate of
> [[standalone_tarball_symlink_to_PATH_broken]].
> [[closing dup|done]]. --[[Joey]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="108.236.230.124"
 subject="comment 1"
 date="2014-05-16T17:17:54Z"
 content="""
Here's how I do it:

<pre>
$ oberon:tmp joeyh$ hdiutil attach git-annex.dmg
$ oberon:tmp joeyh$  /Volumes/git-annex/git-annex.app/Contents/MacOS/git-annex version
git-annex version: 5.20140516-g693a6a4
oberon:tmp joeyh$ PATH=$PATH:/Volumes/git-annex/git-annex.app/Contents/MacOS/
oberon:tmp joeyh$ git-annex version
git-annex version: 5.20140516-g693a6a4
</pre>

So, adding to PATH works fine. Perhaps you added the wrong directory to your PATH.

Note that .bash_profile is only used for bash login shells. It may not be run when you open a terminal, or when git-annex ssh's in from elsewhere to run git-annex-shell (which you seem to be asking about, but only in the title of this page?).

In particular, bash does not provide any way to set the PATH which works when you run \"ssh yourcomputer git-annex-shell\". So you will need to instead move the git-annex files into a directory that is in the default PATH.
"""]]


code:
[[!comment format=mdwn
 username="https://www.google.com/accounts/o8/id?id=AItOawkAUMhKOSkh9JaBA6xst3XxQIIsDEq5Zd4"
 nickname="Ovidiu"
 subject="comment 2"
 date="2014-05-16T17:23:32Z"
 content="""
Thanks for the additional info, for now its working fine:

git-annex version
git-annex version: 5.20140420-ga25b8bb
build flags: Assistant Webapp Webapp-secure Pairing Testsuite S3 WebDAV FsEvents XMPP DNS Feeds Quvi TDFA CryptoHash
key/value backends: SHA256E SHA1E SHA512E SHA224E SHA384E SKEIN256E SKEIN512E SHA256 SHA1 SHA512 SHA224 SHA384 SKEIN256 SKEIN512 WORM URL
remote types: git gcrypt S3 bup directory rsync web webdav tahoe glacier hook external
"""]]


code:
### Please describe the problem.

I generated id_rsa and id_rsa.pub from the android shell.
After copying the id_rsa.pub file on my server, ssh on android complains because id_rsa permissions on the phone are too open (660).
Chmod 600 id_rsa on /sdcard/git-annex.home/.ssh/id_rsa has no effect, i.e. permissions remain 660.

### What steps will reproduce the problem?
use ssh-keygen to generate keys, default location is /sdcard/git-annex.home/.ssh/
copy id_rsa.pub on ssh server, try to connect from android to ssh server.

### What version of git-annex are you using? On what operating system?
latest git-annex.apk (2014-03-06) on android 4.4.2

### Please provide any additional information below.

root@android:/ # /data/data/ga.androidterm/runshell
Falling back to hardcoded app location; cannot find expected files in /data/app-lib

root@android:/sdcard/git-annex.home # ssh MYSERVERIP -p PORT -l USERNAME

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0660 for '/sdcard/git-annex.home/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /sdcard/git-annex.home/.ssh/id_rsa

> [[fixed|done]]; daily build is updated. --[[Joey]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="108.236.230.124"
 subject="comment 1"
 date="2014-03-10T21:20:10Z"
 content="""
Hmm, I know that I and others have used git-annex on android with ssh, without encountering this problem. Odd. Oh well, was already patching out many other permissions checks in ssh, so added this one to the pile.
"""]]


code:
[[!comment format=mdwn
 username="http://smcv.pseudorandom.co.uk/"
 nickname="smcv"
 subject="comment 2"
 date="2014-03-12T07:54:08Z"
 content="""
Would it be better to put the home directory under git-annex' directory
in `/data`, so it isn't available to every app (and every user, if more
than one) on the device? If other apps can write to its `.gitconfig`
then I think they can make git-annex run arbitrary code with its own
permissions.
"""]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="209.250.56.154"
 subject="comment 3"
 date="2014-03-12T19:45:24Z"
 content="""
Well, that would simplify the ssh patching.

Putting a git repository on /sdcard also allows other apps to do things with .git/config. I don't know if git-annex has permissions other apps might want to exploit.. Maybe the ability to use the network?
"""]]


code:
### Please describe the problem.

git-annex exists with "illegal hardware instruction" on OSX

### What steps will reproduce the problem?

git annex webapp

### What version of git-annex are you using? On what operating system?

git annex 5.20131230-g9a495e6
OSX 10.9.1

### Please provide any additional information below.

[[!format sh """

start git assistant with "git annex web app"
safari open tab, but shows connection refused
git annex crashed with "illegal hardware instruction"

# End of transcript or log.
"""]]

> [[fixed|done]] --[[Joey]]


code:
[[!comment format=mdwn
 username="http://joeyh.name/"
 ip="209.250.56.35"
 subject="comment 1"
 date="2014-01-07T15:37:18Z"
 content="""
This problem is fixed in the daily build.
"""]]


code:
### Please describe the problem.

I have found various `.tmp` files in a directory in which I performed various `git annex import` that failed because the destination disk was full.

These files should be removed when import detects that its has no more space to proceed and exists.

### What version of git-annex are you using? On what operating system?

git-annex 5.20140517.4 in Ubuntu 12.04.

> The ".tmp" means this dropping is left by viaTmp, and I see why.
> [[fixed|done]] --[[Joey]]