hbons/SparkleShare — Issue #387: Client goes into crash-restart loop if you don't have write permissions on a folder
Author: dflock
Created: 2011-10-27 02:37:47+00:00
State: open

If you add a folder to SparkleShare for which you only have read and execute permissions - but not write, the client goes into a crash-restart loop which you can only get out of by killing the all the sparkleshare processes, or deleting the local copy of the folder.

When you add the folder, it works fine. Once you add or edit something in the local copy and it tries to sync, you get a red cross on the menu for that folder and the client crashes:

http://i.imgur.com/qRpmZ.png

If you then try to do a git push in the local copy of that folder, you get this:

```
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 319 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/sparkleshare/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@whistler/dropbox/paul'
```

Which isn't very surprising, I guess. These are the permissions on the folders on the server:

```
[duncan@server /sparkleshare]$ ls -l
total 6
drwxr-xr-x 7 duncan htw 512 Oct 26 13:31 design
drwxr-xr-x 7 duncan htw 512 Oct 25 19:56 duncan
drwxr-xr-x 7 paul htw 512 Oct 25 19:57 paul
```

And this is the output in the console if you start the SparkleShare client from there, then add the folder then make a local change. I let it do a few crash-restart loops at the end so you can see the pattern:

```
duncan@workstation:~/SparkleShare/duncan$ sparkleshare start
SparkleShare stale pid file found, starting a new instance.
Starting SparkleShare... Done.
duncan@workstation:~/SparkleShare/duncan$ Identity added: /home/duncan/.config/sparkleshare/sparkleshare.duncan@foo.com.key (/home/duncan/.config/sparkleshare/sparkleshare.duncan@foo.com.key)
19:11:05 [Cmd] /usr/bin/git log -1 --format=%H
19:11:05 [Cmd] /usr/bin/git rev-list --reverse HEAD
19:11:05 [ListenerFactory] Issued new listener for irc://204.62.14.135/
19:11:05 [ListenerIrc] Connecting to irc://204.62.14.135/
19:11:05 [Cmd] /usr/bin/git status --porcelain
19:11:05 [Cmd] /usr/bin/git log -1 --format=%H
19:11:05 [Cmd] /usr/bin/git rev-list --reverse HEAD
19:11:05 [ListenerFactory] Refered to existing listener for irc://204.62.14.135/
19:11:05 [Cmd] /usr/bin/git status --porcelain
19:11:05 [Cmd] /usr/bin/git log -1 --format=%H
19:11:05 [Cmd] /usr/bin/git rev-list --reverse HEAD
19:11:05 [ListenerFactory] Refered to existing listener for irc://204.62.14.135/
19:11:05 [Cmd] /usr/bin/git status --porcelain
19:11:05 [ListenerIrc] Could not connect to irc://204.62.14.135/: Could not connect to: 204.62.14.135:6667 Connection refused
Xlib: extension "RANDR" missing on display ":0.0".
Xlib: extension "RANDR" missing on display ":0.0".
19:11:38 [Cmd] /usr/bin/git status --porcelain
19:11:38 [Event][paul] Created 'new file'
19:11:38 [Event][paul] Changes found, checking if settled.
19:11:39 [Local][paul] Changes have settled.
19:11:39 [Cmd] /usr/bin/git status --porcelain
19:11:39 [SyncUp][paul] Initiated
19:11:39 [Cmd] /usr/bin/git add --all
19:11:39 [Git][paul] Changes staged
19:11:39 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:11:39 [Commit][paul] Changes made by SparkleShare
19:11:39 [Cmd] /usr/bin/git push origin master
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 331 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:11:40 [SyncUp][paul] Error
19:11:40 [SyncDown][paul] Initiated
19:11:40 [Cmd] /usr/bin/git fetch -v
From ssh://server/dropbox/paul
= [up to date] master -> origin/master
19:11:40 [Cmd] /usr/bin/git status --porcelain
19:11:40 [Cmd] /usr/bin/git rebase -v FETCH_HEAD
19:11:40 [SyncDown][paul] Done
19:11:40 [Cmd] /usr/bin/git log -1 --raw -M --date=iso
19:11:40 [Cmd] /usr/bin/git status --porcelain
19:11:40 [Cmd] /usr/bin/git add --all
19:11:40 [Git][paul] Changes staged
19:11:40 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:11:40 [Commit][paul] Changes made by SparkleShare
19:11:40 [Cmd] /usr/bin/git push origin master
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 331 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:11:41 [Cmd] /usr/bin/git add --all
19:11:41 [Git][paul] Changes staged
19:11:41 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:11:41 [Commit][paul] Changes made by SparkleShare
19:11:41 [Cmd] /usr/bin/git push origin master
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 331 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:11:41 [Cmd] /usr/bin/git status --porcelain
19:11:44 [Cmd] /usr/bin/git status --porcelain
19:11:44 [Event][paul] Renamed 'test.txt'
19:11:44 [Event][paul] Changes found, checking if settled.
19:11:45 [Local][paul] Changes have settled.
19:11:45 [Cmd] /usr/bin/git status --porcelain
19:11:45 [SyncUp][paul] Initiated
19:11:45 [Cmd] /usr/bin/git add --all
19:11:45 [Git][paul] Changes staged
19:11:45 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:11:45 [Commit][paul] Changes made by SparkleShare
19:11:45 [Cmd] /usr/bin/git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 620 bytes, done.
Total 5 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:11:45 [SyncUp][paul] Error
19:11:45 [SyncDown][paul] Initiated
19:11:45 [Cmd] /usr/bin/git fetch -v
From ssh://server/dropbox/paul
= [up to date] master -> origin/master
19:11:46 [Cmd] /usr/bin/git status --porcelain
19:11:46 [Cmd] /usr/bin/git rebase -v FETCH_HEAD
19:11:46 [SyncDown][paul] Done
19:11:46 [Cmd] /usr/bin/git log -1 --raw -M --date=iso
^C
duncan@workstation:~/SparkleShare/duncan$ 19:11:56 [SyncUp][paul] Initiated
19:11:56 [Cmd] /usr/bin/git add --all
19:11:56 [Git][paul] Changes staged
19:11:56 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:11:56 [Commit][paul] Changes made by SparkleShare
19:11:56 [Cmd] /usr/bin/git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 620 bytes, done.
Total 5 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:11:56 [SyncUp][paul] Error
19:11:56 [SyncDown][paul] Initiated
19:11:56 [Cmd] /usr/bin/git fetch -v
From ssh://server/dropbox/paul
= [up to date] master -> origin/master
19:11:57 [Cmd] /usr/bin/git status --porcelain
19:11:57 [Cmd] /usr/bin/git rebase -v FETCH_HEAD
19:11:57 [SyncDown][paul] Done
19:11:57 [Cmd] /usr/bin/git log -1 --raw -M --date=iso
19:12:07 [SyncUp][paul] Initiated
19:12:07 [Cmd] /usr/bin/git add --all
19:12:07 [Git][paul] Changes staged
19:12:07 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:12:07 [Commit][paul] Changes made by SparkleShare
19:12:07 [Cmd] /usr/bin/git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 620 bytes, done.
Total 5 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:12:07 [SyncUp][paul] Error
19:12:07 [SyncDown][paul] Initiated
19:12:07 [Cmd] /usr/bin/git fetch -v
From ssh://server/dropbox/paul
= [up to date] master -> origin/master
19:12:07 [Cmd] /usr/bin/git status --porcelain
19:12:07 [Cmd] /usr/bin/git rebase -v FETCH_HEAD
19:12:07 [SyncDown][paul] Done
19:12:07 [Cmd] /usr/bin/git log -1 --raw -M --date=iso
19:12:18 [SyncUp][paul] Initiated
19:12:18 [Cmd] /usr/bin/git add --all
19:12:18 [Git][paul] Changes staged
19:12:18 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:12:18 [Commit][paul] Changes made by SparkleShare
19:12:18 [Cmd] /usr/bin/git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 620 bytes, done.
Total 5 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:12:18 [SyncUp][paul] Error
19:12:18 [SyncDown][paul] Initiated
19:12:18 [Cmd] /usr/bin/git fetch -v
From ssh://server/dropbox/paul
= [up to date] master -> origin/master
19:12:18 [Cmd] /usr/bin/git status --porcelain
19:12:18 [Cmd] /usr/bin/git rebase -v FETCH_HEAD
19:12:18 [SyncDown][paul] Done
19:12:18 [Cmd] /usr/bin/git log -1 --raw -M --date=iso
19:12:28 [SyncUp][paul] Initiated
19:12:28 [Cmd] /usr/bin/git add --all
19:12:28 [Git][paul] Changes staged
19:12:28 [Cmd] /usr/bin/git commit -m "Changes made by SparkleShare"
19:12:28 [Commit][paul] Changes made by SparkleShare
19:12:28 [Cmd] /usr/bin/git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 620 bytes, done.
Total 5 (delta 0), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://duncan@server/dropbox/paul
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://duncan@server/dropbox/paul'
19:12:29 [SyncUp][paul] Error
19:12:29 [SyncDown][paul] Initiated
19:12:29 [Cmd] /usr/bin/git fetch -v
From ssh://server/dropbox/paul
= [up to date] master -> origin/master
19:12:29 [Cmd] /usr/bin/git status --porcelain
19:12:29 [Cmd] /usr/bin/git rebase -v FETCH_HEAD
19:12:29 [SyncDown][paul] Done
19:12:29 [Cmd] /usr/bin/git log -1 --raw -M --date=iso
^C
duncan@workstation:~/SparkleShare/duncan$ sudo killall sparkleshare

```