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

Internal exception occured. Message from jgit: HEAD is detached #162

Closed
xlogerais opened this issue Jan 1, 2016 · 29 comments · Fixed by #508
Closed

Internal exception occured. Message from jgit: HEAD is detached #162

xlogerais opened this issue Jan 1, 2016 · 29 comments · Fixed by #508
Assignees

Comments

@xlogerais
Copy link

I get the following error when trying to pull from remote :
Internal exeception occured
Message from jgit:
HEAD is detached

I don't know what happened, but it already worked.
I'm not using external repository option so I don't know if it is possible to "inspect" directory structure from command line to debug.
Is the "internal" directory structure accessible to the user ?

@xlogerais
Copy link
Author

I finally manage to access internal repo with root access.
The problem was caused by a conflict that prevented fast forward.
I think you can close this issue as it was not really a bug.
Maybe you can think about adding a feature to do a "git checkout --hard" to ease recover for such situations.

Regards,

Xavier Logerais.

PS: Thanks for your work ! I like your software.

@zeapo zeapo added the bug label Jan 2, 2016
@zeapo
Copy link
Contributor

zeapo commented Jan 2, 2016

We should not lock the user in a detached HEAD state.

@zeapo zeapo reopened this Jan 2, 2016
@zeapo
Copy link
Contributor

zeapo commented Jan 2, 2016

Thanks @xlogerais for the issue. This should not happen as we do not give the user a direct access to the git repository, hence doing a reset or a rebase --abort is not possible directly.

@lekv
Copy link

lekv commented Aug 17, 2016

I just ran into this issue on a non-rooted device. Is there any way to recover from this, short of cleaning the app's data and re-configuring it?

@zeapo
Copy link
Contributor

zeapo commented Aug 17, 2016

@lekv are you using the PlayStore version or the F-Droid version?

@lekv
Copy link

lekv commented Aug 17, 2016

The one from the play store.

@zeapo
Copy link
Contributor

zeapo commented Aug 17, 2016

I will try to provide an apk with an option to do the rebase --abort. However, this will not fix the conflict.

@lekv
Copy link

lekv commented Aug 17, 2016

I was able to fix it by just re-checking out the repository, after re-visiting the git log on my desktop and making sure that I'll keep all but one current pw - so this is not urgent. Thanks for the help.

@zeapo
Copy link
Contributor

zeapo commented Aug 17, 2016

good then :)

@bignose-debian
Copy link

This is difficult for the developers and impossible for the users to even diagnose properly, because the message should not be this uninformative. Issue #219 requests better treatment of exceptions like this one.

@slackline
Copy link

I've encountered this and am struggling to work around it, any suggestions?

On the server I'm trying to synchronise from I've followed these steps for resolving a detached head but Password-Store still reports a detached head when I try to synchronise or pull from it.

I'm using v1.2.0.57 from the F-Droid store.

@zeapo
Copy link
Contributor

zeapo commented Mar 29, 2017

The issue is that you're in a detached head in the app itself. This happens during the git rebase, maybe we could offer a way to detect it.

@ns-rse
Copy link

ns-rse commented Mar 29, 2017

Ah ok, would a working solution be to delete the current existing store in the application (i.e. the directory I saved it to) and then re-sync as @lekv suggested further up?

@zeapo
Copy link
Contributor

zeapo commented Mar 29, 2017

Yes, that would be a "solution". Please bear in mind that if you got into a detached head, that means that you made changes that (most probably) are not on your server.

@slackline
Copy link

Thanks, went with that option, any changes I made under Android will have been by mistake.

@jmeekhof
Copy link

I know this thread is a bit stale, but could you allow someone to create a branch at the detached head? Then this could be pushed to a real computer where the conflict could be resolved.

@bjmgeek
Copy link

bjmgeek commented May 22, 2018

I got this message after making some changes at the remote, and simultaneously making some changes in the app. The changes should have not conflicted, but would need to be merged.

@bjmgeek
Copy link

bjmgeek commented May 22, 2018

I'm also using the play store app.

@bjmgeek
Copy link

bjmgeek commented May 22, 2018

I guess it would be nice to be able to show local changes, commit them, or merge them, from the app.

@frostyfrog
Copy link

Indeed, or maybe even dropping to the command line would suffice, if it's possible.

@bignose-debian
Copy link

bignose-debian commented Jul 1, 2018 via email

@anoadragon453
Copy link

Yes, and I was just hit again by this today, so a working solution would be much appreciated.

@bjmgeek
Copy link

bjmgeek commented Jul 7, 2018 via email

@aut0
Copy link

aut0 commented May 7, 2019

I know this thread is a bit stale, but could you allow someone to create a branch at the detached head? Then this could be pushed to a real computer where the conflict could be resolved.

Moving changes in the app to a branch on conflict and pushing this to the git server would be a nice workaround. Would it be okay to open a bug bounty for this?

@zeapo
Copy link
Contributor

zeapo commented May 8, 2019

I opened a PR for this.

This PR will allow you to push your local branch to another branch and stop the rebase. This way, you can clean the conflicts on your own machine.

@evanrmurphy
Copy link

I'm having this same issue. I see #508 is a fix as @zeapo explains:

This PR will allow you to push your local branch to another branch and stop the rebase. This way, you can clean the conflicts on your own machine.

Can you clarify how to actually do this? I have added a lot of passwords to my phone in this corrupted state so am worried about losing them if I just delete/re-clone.

Thank you for this fix and for Android Password Store!

@minami-o
Copy link

minami-o commented Feb 3, 2020

I'm having this same issue. I see #508 is a fix as @zeapo explains:
Can you clarify how to actually do this? I have added a lot of passwords to my phone in this corrupted state so am worried about losing them if I just delete/re-clone.

If I'm not mistaken, you need to go to the Settings and, in the Git section, go to Edit configuration.
There, the Hackish tools section shows the current Commit hash and the button below, labelled "Abort rebase and push new branch", is self-explanatory.

@githlp
Copy link

githlp commented Dec 3, 2020

bump.
I had the same exception with the F-Droid v1.13.1

Internal exeception occured
HEAD is detached

No idea how i came to the detached head within the application, the other two (computer) clients had no problem syncing.
I was not able to solve it (even with Hard reset) and therefor finally removed the local repo so i could clone again from remote.

@msfjarvis
Copy link
Member

Please don't bump old issues, file new ones (properly following the template) if you come across regressions.

@android-password-store android-password-store locked as resolved and limited conversation to collaborators Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet