-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unable to sync git repo with no commits #172
Comments
Thank you. Will look into it tonight. |
Are you prompted about accepting the server's public key? (That notification will not show if your phone is in "do not disturb" mode, which is a problem.) Troubleshooting this is difficult because of the "Failed resolution of: Ljavax/management/ReflectionException" situation. The version of the SSH library which JGit relies on is not Android-aware, and uses an exception class which does not exist on Android. Since JGit does not know the actual root exception, it just gives the generic "remote hung up unexpectedly" error. This is solved in later JGit versions, but those only work with Android 13 or above. I have tested forcing an upgrade of only the SSH library, but then JGit's SSH code breaks as the interfaces have changed. The only thing we know for sure is that something goes wrong when establishing the SSH session. In my experience, these "remote hung up" errors are often not caused by Orgzly bugs, but outside factors. There are many things that can go wrong: server public key not being accepted (see above), SSH key was not properly authorized, bad URL, lack of permissions on the remote side, and so on. So make sure to check everything, for instance double check that the same URL works from your computer. But you said you tried two different servers, so... yeah, you have probably double checked already. |
Sorry for the delayed response.
That was definitely it. All the times I tested it was in do not-disturb mode. I re-tested with DnD on and off and once off, I see a prompt and things progress. Now Sync is an option.. but I get a new error:
As you might expect the git repo server side is still empty. There is a .git directory locally. I wasn't sure sure what "marker" is referring to so searching code repo:
Looks like creating the branch failed looking at orgzly-android-revived/app/src/main/java/com/orgzly/android/git/GitFileSynchronizer.java Line 300 in 51864a9
but no detail in the git error returned. I'm going to play some more (I don't have any precious notes so I can avoid to wipe and retest). Thank you for taking the time to dig into this and offer advice! |
https://www.youtube.com/watch?v=r13riaRKGo0 Great Success! Got this to succeed. What worked: Ensure git repo is NOT empty. I created a file called text.txt with minimal content and pushed that into the server (ended up using "main" as branch name). Then the sync worked and ended up with the default .org file sample pushed into remote repo. What didn't work: two different git servers with ssh that had empty repos.., which is the default for creating a repo with many (hosted) git servers. For example GitHub. Not had chance to play any more. Will see how I get on :-) So I think this issue is resolved but there are some possible doc issues to come out of this. |
Thank you, this is really valuable and it's an excellent test case if I manage to create some tests. I had not thought about nor tested this scenario, but as you say, it's super common and expected, so it should definitely be handled gracefully. I suspect it will be an easy fix. Thanks once again! I wonder how many potential users have run into this... |
The ssh server key prompt (notification) not showing in DnD mode should also be fixed. I don't know how, but it must be doable. Edit: Created #178. |
Please complete the following information:
Tried with 2 different servers. Using an RSA key (got different issues with other key type)
Related #150
java.io.IOException: fc.z: git@github.com:clach04/Orgzlytest.git: remote hung up unexpectedly
at w5.f.l(GitRepo.java:60)
at w5.f.n(GitRepo.java:3)
at w5.f.o(GitRepo.java:18)
at com.orgzly.android.ui.repo.git.GitRepoActivity$d.c(GitRepoActivity.kt:9)
at com.orgzly.android.ui.repo.git.GitRepoActivity$d.doInBackground(GitRepoActivity.kt:3)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: fc.z: git@github.com:clach04/Orgzlytest.git: remote hung up unexpectedly
at ec.l.k(FetchCommand.java:137)
at ec.h.r(CloneCommand.java:113)
at ec.h.m(CloneCommand.java:37)
at w5.f.l(GitRepo.java:39)
... 10 more
Caused by: jc.r0: git@github.com:clach04/Orgzlytest.git: remote hung up unexpectedly
at ld.r3$d.(TransportGitSsh.java:32)
at ld.r3.h0(TransportGitSsh.java:3)
at ld.i0.h(FetchProcess.java:61)
at ld.i0.g(FetchProcess.java:24)
at ld.n3.j(Transport.java:104)
at ec.l.k(FetchCommand.java:55)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/management/ReflectionException;
at lb.e.b(ExceptionUtils.java:51)
at wa.c.w6(AbstractSshFuture.java:34)
at v9.e.C6(DefaultAuthFuture.java:3)
at v9.e.r3(DefaultAuthFuture.java:1)
at wa.m.b(VerifiableFuture.java:7)
at wa.i.W5(DefaultVerifiableSshFuture.java:1)
at od.m.k(SshdSession.java:136)
at od.m.m(SshdSession.java:29)
at od.f0.X(SshdSessionFactory.java:28)
at od.f0.d(SshdSessionFactory.java:1)
at ld.h3.K0(SshTransport.java:41)
at ld.r3$d.(TransportGitSsh.java:4)
... 18 more
Caused by: java.lang.ClassNotFoundException: javax.management.ReflectionException
... 30 more
The text was updated successfully, but these errors were encountered: