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

OwnCloud backup shows unclear error message #799

Closed
norbusan opened this Issue Sep 22, 2017 · 25 comments

Comments

Projects
None yet
2 participants
@norbusan
Copy link

norbusan commented Sep 22, 2017

I have set up aedict to backup user data to my own/nextcloud instance:

Backup storage: owncloud
Owncloud setting
https://...
username/password (application password) entered

I see the folder
Apps / Aedict / backups / UserData
in my cloud, but the actual backup gives the following error:
Failed to create automatic backup: list /Apps/Aedict/backups/Userdata failed: -1 HOST_NOT_AVAILABLE
Going into setting -> User data -> Backup/Restore I see
Failure: list /Apps/Aedict/backups/Userdata failed: -1 HOST_NOT_AVAILABLE

I can confirm that other applications can properly access the server at the same address.

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 26, 2017

Thanks for letting me know! I have improved the error message reporting in case of backup which will be present in Aedict 3.44.

It may take some time though for Aedict 3.44 to be released. The error is present in your device logs, please check out http://aedict.eu/faq.html the Q: Aedict 3 log section for details on how to see your Android log.

The HOST_NOT_AVAILABLE message occurs either when your phone can't resolve the host name, or on some generic error. The error details are in your phone's log, and will be also shown in the error message produced by Aedict 3.44.

@mvysny mvysny closed this Sep 26, 2017

@mvysny mvysny self-assigned this Sep 26, 2017

@mvysny mvysny added the bug label Sep 26, 2017

@mvysny mvysny changed the title backup to own/nextcloud not working OwnCloud backup shows unclear error message Sep 26, 2017

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 26, 2017

ok here is a log grabbed on the device with catlog

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 26, 2017

09-26 17:23:40.221 I/Aedict:LoaderEx(23582): Loader #17 sk.baka.aedict3.cloud.BackupListView$MyLoader@c41e551 canceled: canceled 09-26 17:23:40.241 D/OwnCloudClient #7(23582): REQUEST PROPFIND //remote.php/webdav/Apps/Aedict/backups/UserData 09-26 17:23:43.218 E/ReadRemoteFolderOperation(23582): Synchronized /Apps/Aedict/backups/UserData: Unexpected exception 09-26 17:23:43.218 E/ReadRemoteFolderOperation(23582): 	at sk.baka.aedict3.cloud.OwnCloudBackupBackend.run(OwnCloudBackupBackend.java:73) 09-26 17:23:43.218 E/ReadRemoteFolderOperation(23582): 	at sk.baka.aedict3.cloud.OwnCloudBackupBackend.list(OwnCloudBackupBackend.java:137) 09-26 17:23:43.218 E/ReadRemoteFolderOperation(23582): 	at sk.baka.aedict3.cloud.BackupStorage.getBackups(BackupStorage.java:169) 09-26 17:23:43.218 E/ReadRemoteFolderOperation(23582): 	at sk.baka.aedict3.cloud.BackupListView$MyLoader.loadItemsInBackground(BackupActivity.kt:179) 09-26 17:23:43.218 E/ReadRemoteFolderOperation(23582): 	at sk.baka.aedict.util.LoaderEx$Loader.run(LoaderEx.java:181) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): Loader #18 sk.baka.aedict3.cloud.BackupListView$MyLoader@a43a7bb: failed; 2997ms (scheduled: 4ms, running: 2993ms) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): sk.baka.aedict.util.IOExceptionWithCause: list /Apps/Aedict/backups/UserData failed: -1 HOST_NOT_AVAILABLE 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.OwnCloudBackupBackend.run(OwnCloudBackupBackend.java:96) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.OwnCloudBackupBackend.list(OwnCloudBackupBackend.java:137) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.BackupStorage.getBackups(BackupStorage.java:169) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.BackupListView$MyLoader.loadItemsInBackground(BackupActivity.kt:179) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at sk.baka.aedict.util.LoaderEx$Loader.run(LoaderEx.java:181) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at java.lang.Thread.run(Thread.java:764) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at com.owncloud.android.lib.common.network.WebdavEntry.<init>(WebdavEntry.java:51) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation.readData(ReadRemoteFolderOperation.java:139) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation.run(ReadRemoteFolderOperation.java:86) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:132) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.OwnCloudBackupBackend.run(OwnCloudBackupBackend.java:73) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582): ... 7 more 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): Loader failed with sk.baka.aedict.util.IOExceptionWithCause: list /Apps/Aedict/backups/UserData failed: -1 HOST_NOT_AVAILABLE, this stack trace holds stack where the task was scheduled: java.lang.RuntimeException: Scheduled stack trace: sk.baka.aedict3.cloud.BackupListView$MyLoader@a43a7bb 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at sk.baka.aedict.util.LoaderEx$Loader.<init>(LoaderEx.java:170) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at sk.baka.aedict.util.LoaderEx.load(LoaderEx.java:303) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.util.android.list.CheckableListView.restartLoader(CheckableListView.kt:130) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.BackupListView.refresh(BackupActivity.kt:172) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.BackupActivity.refreshBackupList(BackupActivity.kt:76) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at sk.baka.aedict3.cloud.BackupActivity.onResume(BackupActivity.kt:69) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1354) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.app.Activity.performResume(Activity.java:7079) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3620) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3685) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1643) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.os.Handler.dispatchMessage(Handler.java:105) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.os.Looper.loop(Looper.java:164) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at android.app.ActivityThread.main(ActivityThread.java:6541) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at java.lang.reflect.Method.invoke(Native Method) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 09-26 17:23:43.232 E/Aedict:LoaderEx(23582): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 26, 2017

Ah, a bug in official Owncloud client as I suspected:

Caused by: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 09-26 17:23:43.219 E/Aedict:LoaderEx(23582):
at com.owncloud.android.lib.common.network.WebdavEntry.<init>(WebdavEntry.java:51) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582):
at com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation.readData(ReadRemoteFolderOperation.java:139) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582):
at com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation.run(ReadRemoteFolderOperation.java:86) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582):
at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:132) 09-26 17:23:43.219 E/Aedict:LoaderEx(23582):

@mvysny mvysny reopened this Sep 26, 2017

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 26, 2017

I believe you have your owncloud server at https://foo (that is, there is no path, say, https://foo/owncloud), can you please confirm?

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 26, 2017

Yes indeed, my server is at the root cloud.foo.bar/

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 26, 2017

Thanks for confirming! It seems that the Owncloud client can't handle when there's no path. I have patched the client to use the root path "/" in that case, let's see whether it will help.

Fixed in Aedict 3.44

@mvysny mvysny closed this Sep 26, 2017

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 26, 2017

Thanks for fixing it locally, but it is surprising, the other client (owncloud, next loud) applications had no problem with that, though.
Anyway, I'll try when 3.44 is out or you send me a test version of you want.

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 26, 2017

Perhaps they fixed it unintentionally in some newer version of the owncloud client, or maybe they have a non-public bug tracker? Hard to say.

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 28, 2017

Hi
The new version just came in. I can confirm that there are no errors anymore, but I see a different behavior:
When going into the list backups screen (Settings/User data/Backups) it tells me no backups are there, ok.
Then I press the second button from the top right and it tells me "Performing backup, please wait", then "Backup created successfully", but it seems it is never uploaded because nothing shows every up on the backup screen.
Hope the explanation was ok.
Best

@mvysny mvysny reopened this Sep 28, 2017

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 28, 2017

Thanks for letting me know! The backup creates a zip file in the "Apps/Aedict" folder, typically named "2017-23-23.zip". Can you verify that the file is there please, by browsing your NextCloud directly, or using other client?

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 28, 2017

Not there, but lots of them in Apps/Aedict/backups/UserData/ there are several zips.

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 28, 2017

And they are named YYYY-MM-DD_hh-mm-ss.zip

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Sep 28, 2017

Yeah, that's it. So they are properly stored, it's just that for some reason Aedict does not see those files and is not able to list them. I need to try this out myself. Which NextCloud exactly are you using please, which version? I hope there's a docker image of that very version available ;)

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 28, 2017

12.0.3, docker images (but I use normal install) https://hub.docker.com/r/greyltc/nextcloud/

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Sep 28, 2017

Forgot to mention, that is the latest stable release.

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Oct 4, 2017

Works for me. I was able to create a backup and it is properly listed in Aedict. I have set up nextcloud in docker as follows:

  1. docker run -ti --name nc -p 80:80 -p 443:443 greyltc/nextcloud /bin/bash
  2. docker cp nextcloud.conf nc:/etc/httpd/conf/extra/nextcloud.conf to configure nextcloud to run on / (root context)
  3. In Docker:
  4. start-servers
  5. Press Ctrl+C
  6. apachectl stop
  7. cd /usr/share/webapps/nextcloud
  8. sudo -u http ./occ config:system:set trusted_domains 1 --value=192.168.100.13
  9. apachectl start

The nextcloud.conf:

Alias / "/usr/share/webapps/nextcloud/"

<Directory /usr/share/webapps/nextcloud/>
  Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

  # tell apache to serve up an error message if the user tries
  # to visit TARGET_SUBDIR without https (unless ALLOW_INSECURE is "true")
  <If "env('ALLOW_INSECURE') != 'true'">
    SSLRequireSSL
    SSLOptions +StrictRequire
  </If>

  Options +FollowSymlinks
  AllowOverride All
  Require all granted

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /usr/share/webapps/nextcloud
 SetEnv HTTP_HOME /usr/share/webapps/nextcloud

</Directory>
@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Oct 4, 2017

Screenshot from my phone:
device-2017-10-04-155833

I have configured Aedict with the following URL: https://192.168.100.13 (that's the IP of my computer in my local network).

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Oct 4, 2017

Closing as works for me.

@mvysny mvysny closed this Oct 4, 2017

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Oct 5, 2017

So what information can I provide you to talk that down?

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Oct 5, 2017

I must admit that I do not know that. I am not well versed with the nextcloud protocol. It is very weird that aedict is able.to upload files (so the server is accessible and working properly) yet it fails to list files.
Is there anything (any error) in your nextcloud logs? You can see.the logs in your nextcloud admin page; also see /var/something/webapps/nextcloud/*.log
Perhaps try to intercept the list request in your server with tcpdump. I can look whether Aedict does some kind of filtering of files.it shows in the listing.

@mvysny mvysny reopened this Oct 5, 2017

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Oct 5, 2017

Also you can try whether the docker approach works for you as well.

@norbusan

This comment has been minimized.

Copy link
Author

norbusan commented Oct 5, 2017

Ok, on the server I compared the output of the ownCloud client on my desktop cmputer with the stuff coming from the Android phone:

Desktop client:

NNN.NNN.NNN.NNN - norbert [05/Oct/2017:02:13:46 -0400] "PROPFIND /remote.php/dav/files/norbert/ HTTP/1.1" 207 4805 "-" "Mozilla/5.0 (Linux) mirall/2.3.3"

Android client

 NNN.NNN.NNN.NNN - norbert [05/Oct/2017:02:13:23 -0400] "PROPFIND //remote.php/webdav/Apps/Aedict/backups/UserData HTTP/1.1" 207 7858 "-" "Android-ownCloud"

The differences I see are in the // at the beginning, and the usage of webdav instead of dav. There are no entries in the error log.

No idea what the difference is, though...

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Oct 5, 2017

I have no idea either... I wonder if this PROPFIND //remote.php/webdav/Apps/Aedict/backups/UserData is also present in the Docker-based nextcloud (I'm guessing yes and it seem to have worked there for me)...

@mvysny

This comment has been minimized.

Copy link
Owner

mvysny commented Nov 30, 2018

OwnCloud backup (or any kind of backup) has been removed since it only works with the old file-based storage which is now deprecated. Please move to the new UMN storage which allows for automatic sync with Aedict Online. There is even a feature request to sync data to your own server: #849

Closing as won't fix since OwnCloud is no longer supported.

@mvysny mvysny closed this Nov 30, 2018

@mvysny mvysny added the wontfix label Nov 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.