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

selecting a Folder for File Versioning crashes #1912

Open
steelbytes opened this issue May 27, 2023 · 6 comments
Open

selecting a Folder for File Versioning crashes #1912

steelbytes opened this issue May 27, 2023 · 6 comments

Comments

@steelbytes
Copy link

steelbytes commented May 27, 2023

trying to select a Folder for File Versioning in the android native ui crashes.

Android 13 on Pixel 7Pro

05-27 11:29:49.423 13348 13348 E AndroidRuntime: FATAL EXCEPTION: main
05-27 11:29:49.423 13348 13348 E AndroidRuntime: Process: com.nutomic.syncthingandroid, PID: 13348
05-27 11:29:49.423 13348 13348 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nutomic.syncthingandroid/com.nutomic.syncthingandroid.activities.FolderPickerActivity}: java.lang.NullPointerException: Attempt to get length of null array
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3641)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3778)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7884)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
05-27 11:29:49.423 13348 13348 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to get length of null array
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at java.util.Collections.addAll(Collections.java:5457)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at com.nutomic.syncthingandroid.activities.FolderPickerActivity.populateRoots(FolderPickerActivity.java:142)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at com.nutomic.syncthingandroid.activities.FolderPickerActivity.onCreate(FolderPickerActivity.java:98)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:8341)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:8320)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3622)
05-27 11:29:49.423 13348 13348 E AndroidRuntime:        ... 12 more
@imsodin
Copy link
Member

imsodin commented May 27, 2023

Which app version?

@steelbytes
Copy link
Author

Which app version?

1.23.4 (current) from PlayStore

@lsh-0
Copy link

lsh-0 commented Jul 11, 2023

Just got this too, I'm brand new to Syncthing as of this evening.

On phone I have Syncthing 1.23.5 from f-droid.

On (linux) desktop I have Syncthing 1.23.6.

On desktop I changed a remote shared folder "Redmi Note Pro 5 - Call Logs Backup & Restore (RO)" setting to 'Simple File Versioning'. The phone disconnected and Syncthing on the phone starts crashing over and over.

The desktop popped up this message:

Screenshot at 2023-07-11 23-36-56

update: while I'm certain adding folder versioning triggered this problem, removing the shared folders on both ends and re-adding them without versioning appears to have fixed the crashing. I've had syncthing running stably for two weeks now. I might try adding versioning again to see if I can replicate this.

update 2: yup, enabling simple file versioning triggers this. It's back to crashing endlessly again. Grr.

@steelbytes
Copy link
Author

so .... no fix?

@er-pa
Copy link
Member

er-pa commented Sep 22, 2023

Going after the error message;

Collections.addAll(roots, new File("/storage/").listFiles()); seems to be the trigger. And I do know that .listFiles() can return null if the supplied abstract path is not accessible or a valid directory, which can easily trigger this. And also that accessing /storage/ is tricky - so the solution may be double-folded.

@lsh-0
Copy link

lsh-0 commented Sep 22, 2023

Happy to help if I can. Even without file versioning turned on syncthing is fantastic tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants