hwittenborn / celeste

GUI file synchronization client that can sync with any cloud provider
GNU General Public License v3.0
1.08k stars 36 forks source link

Unable to log in to Nextcloud #44

Open kdwk opened 1 year ago

kdwk commented 1 year ago

When trying to log in to Nextcloud, the app freezes and stops responding. Force quitting and relaunching the app, then typing in the same details again results in the app telling me that the server name already exists.

hwittenborn commented 1 year ago

When trying to log in to Nextcloud, the app freezes and stops responding.

How long are you waiting after clicking the Log In button? The app shouldn't respond to much after that until it can verify that it can authenticate to the Nextcloud server, if you're on a slow internet connection that'd be my best guess as to why it might be freezing. Would you be able to confirm what your internet speeds are like, even if just a general range (both client and on the Nextcloud server if possible)?

Force quitting and relaunching the app, then typing in the same details again results in the app telling me that the server name already exists.

When you log in to a new server, Celeste has to create the config entry before it can even see if it's able to authenticate - when you close the app before it finishes that the config entry thus remains, and then you can't use it again (I forget when it happens specifically, but Celeste also has a separate database it uses for some extra information - if the server you entered isn't showing up in the UI it's because it was recorded in the config, but not the database).

Anyway, there can probably be some error checking on startup that removes config entries that aren't in the database - I'll look into getting that implemented soon. For now, you can manually remove the entry, but it depends on how you installed Celeste - would you be able to send which way you installed it? I forget the file name you have to edit off the top of my head, but if I have the platform you installed it on I'll be able to find it a bit quicker.

kdwk commented 1 year ago

How long are you waiting after clicking the Log In button?

The 'Force quit' dialog came up a few seconds after clicking Log In. Choosing 'wait' brings up the same dialog again immediately. My desktop Nextcloud client works fine.

would you be able to send which way you installed it?

Flatpak. I just deleted the entire ~/.var/app/com.hunterwittenborn.Celeste folder to start again, but the problem persists.

dariox86 commented 1 year ago

I have the same problem on Parabola GNU/Linux-libre. I have installed Celeste from the Arch User Repository.

EDIT: it needs libayatana-appindicator which is listed as an optional dependency in the PKGBUILD for Arch Linux.

hwittenborn commented 1 year ago

@kdwk @dariox86: Could you guys try starting up Celeste from a terminal and see if there's any output after clicking the Log in button?

it needs libayatana-appindicator which is listed as an optional dependency in the PKGBUILD for Arch Linux.

That's a community-maintained package, so it's probably best that you make a comment in the AUR package's comment section.

jnv commented 1 year ago

I wanted to report the same issue when logging in with Google Drive and Dropbox, but it seems waiting a bit and ignoring the Force quit dialog did the job. After a while the main Celeste window appeared. Nonetheless, this behavior is quite confusing.

hwittenborn commented 1 year ago

@jnv: I forget where the issue was (someone else had some similar problem), but could you open up Celeste from a terminal and see if there's any output while you're having to wait for the Force quit dialog to dissapear?

jnv commented 1 year ago

@hwittenborn Doesn't seem so. This is from a run with a fresh install of Celeste from Flathub on Fedora 37:

$ flatpak run com.hunterwittenborn.Celeste
2023/02/20 10:41:27 NOTICE: Config file "[$HOME redacted]/.var/app/com.hunterwittenborn.Celeste/config/celeste/rclone.conf" not found - using defaults
Adwaita-Message: 10:41:29.638: AdwMessageDialog mapped without a transient parent. This is discouraged.

(celeste:21): Adwaita-CRITICAL **: 10:42:15.534: ../src/adw-header-bar.c:640: tried to remove non-child 0x55632aacfdf0 of type 'GtkButton' from 0x55632a9f2360 of type 'AdwHeaderBar'

(celeste:21): Adwaita-CRITICAL **: 10:42:15.534: ../src/adw-header-bar.c:640: tried to remove non-child 0x55632aacf620 of type 'GtkButton' from 0x55632a9f2540 of type 'AdwHeaderBar'
Info: Starting up tray binary...

The Adwaita-Message appears when the initial window opens and Adwaita-CRITICAL appears with the main window after the authentication. No messages appear after confirming the authentication. But let me know if there's some env variable or something to force more verbose output.

dariox86 commented 1 year ago

When I try to connect to my Nextcloud instance the application freezes. After a long while the main window will eventually show up, but I see no files. Here is my terminal output:

[dario@dario ~]$ celeste 
2023/02/20 10:39:15 NOTICE: Config file "/home/dario/.config/celeste/rclone.conf" not found - using defaults

(celeste:944): Adwaita-CRITICAL **: 10:43:22.917: ../libadwaita/src/adw-header-bar.c:640: tried to remove non-child 0x55f084f4c180 of type 'GtkButton' from 0x55f084c64560 of type 'AdwHeaderBar'

(celeste:944): Adwaita-CRITICAL **: 10:43:22.917: ../libadwaita/src/adw-header-bar.c:640: tried to remove non-child 0x55f084fffc80 of type 'GtkButton' from 0x55f084c64740 of type 'AdwHeaderBar'
Info: Starting up tray binary...
byteseb commented 1 year ago

Having this issue too.

It also occurs when using the WebDav option, using as url https://domain/nextcloud/remote.php/dav/files/user. Tried launching from the terminal, but didn't see any error or log.

hwittenborn commented 1 year ago

I just tried logging in to my Nextcloud server from scratch again, it seems to work without any issues on my end for some reason.

@jnv @dariox86: When does the main window appear in correlation to when the Info: Starting up tray binary... message appears in your terminal? If possible, could you check on your end as well @ByteSeb?

byteseb commented 1 year ago

I just tried logging in to my Nextcloud server from scratch again, it seems to work without any issues on my end for some reason.

@jnv @dariox86: When does the main window appear in correlation to when the Info: Starting up tray binary... message appears in your terminal? If possible, could you check on your end as well @ByteSeb?

To me, it just freezes and never loads. For some reason, I don't get any message when running the app with flatpak run com.hunterwittenborn.Celeste

dariox86 commented 1 year ago

OK, I got it working. Firstly, for some tasks like logging in to your Nextcloud instance, you may have to wait a very long time until the application unfreezes. Next on the main window you will need to click the button to create a new folder (circled in red). If you pick a folder with no subfolders inside, the OK button will stay greyed out. For this reason you may need to manually type the desired path in the Local folder field. After clicking OK the synchronization begins. Celeste Remote Folder Picker

ProjectMoon commented 1 year ago

For me, this happens. I have 2FA turned on, and Celeste is clearly logging into Nextcloud, as I see it processing some things in the terminal. I have an end-to-end encrypted folder, and an error about that shows up in the terminal (that it doesn't have access). But eventually, the login process just says "Unable to authenticate to the server. Check your login credentials and try again."

hwittenborn commented 1 year ago

If you pick a folder with no subfolders inside, the OK button will stay greyed out

Is that when entering the local folder or the remote folder?

I have an end-to-end encrypted folder, and an error about that shows up in the terminal (that it doesn't have access). But eventually, the login process just says "Unable to authenticate to the server. Check your login credentials and try again."

That shouldn't be affecting anything, Celeste just sees if it can list the files in / of the remote server, it doesn't actually try reading any files though.

I have 2FA turned on

You're using an app password in Nextcloud then, right? Just making sure so I can eliminate any issues.

ProjectMoon commented 1 year ago

Yes, an app password is in use. The application is able to log in, because it prints out that doesn't have access to my end to end encryption folder. That means it was able to authenticate and download the list of files. So (at least for my case; not sure if all issues here are the same root cause), that must mean something during this setup phase is causing the authentication error. Timeout? Maybe unhandled exception? Not sure. I can check with strace/ptrace?

ProjectMoon commented 1 year ago

So with my complete lack of GDB knowledge, this is what showed up as an error right when the unable to authenticate error popped up:

2023/02/27 16:59:25 ERROR : rc: "operations/size": error: couldn't list files: Client "rclone/" is not allowed to access end-to-end encrypted content: OCA\DAV\Connector\Sabre\Exception\Forbidden: 403 Forbidden

I had this happen to me with rclone as well, and it will actually kill the rclone process with a non-zero exit state. You have to give a specific option to rclone to ignore this kind of error. So maybe in my case, the E2EE folder is causing rclone sync to fail, which causes the login flow itself to fail, and the only error that pops up is an authentication error?

That might explain at least one scenario where this can happen.

dariox86 commented 1 year ago

@hwittenborn, when a local folder is empty, for example when launching a synchronization task for the first time, the OK button in Remote Folder Picker is greyed out.

byteseb commented 1 year ago

I think I found some hints.

It does work, you just have to let it load for a long time. I also noticed that while loading, my server got loud, when it usually doesn't do that.

I suppose that a connection is made, but it is just very slow (Took 55 minutes). I guess it is mostly related to having a big amount of data (Almost 300GB). It's like if it was copying the files when you log in, as I've already done that and it takes a similar amount of time. The server was doing all the work, though, the laptop remained cool.

With the Nextcloud Linux Client, this doesn't happen, but I have some bugs with that one, which is why I tried Celeste.

I wonder if this could be improved by using threads (if the app is not using them), a Spinner or ProgressBar would be good, but the main issue is probably the way Rclone is getting the data at first login.

I don't know Rust, so I can't really help there. Would be helpful to check if this same thing happens with Rclone from a terminal.

Screenshot

byteseb commented 1 year ago

@hwittenborn Some more hints.

This also happens when trying to add a directory to sync, so waiting that long makes the app unusable. Logged into my server, and found that these processes were the ones taking up all the CPU Usage (30% for each process):

image

Terminating Celeste from my laptop also terminated these processes on my server. I wonder if Celeste tries to read all files from the server, because logging in from rclone (Terminal) doesn't take long to log in. It does, however, take time to show all files recursively on Nextcloud. I think it would take like an hour.

hwittenborn commented 1 year ago

I'm back, I've been busy with some stuff the past few days and haven't had a chance to look at much of this. I'm back now though, everything should be good for me to start working on this all again.

You have to give a specific option to rclone to ignore this kind of error. So maybe in my case, the E2EE folder is causing rclone sync to fail, which causes the login flow itself to fail, and the only error that pops up is an authentication error?

Does the error you get in there pop up if you try to list the files in the root of your Nextcloud directory? If it does then it's probably related to that somehow - I'd say we could ignore it, but then no files are going to be synced anyway, right?

I'm not quite sure why rclone isn't just syncing the encrypted files though - are those files encrypted from another rclone session or were they encrypted with the official Nextcloud clients?

@hwittenborn, when a local folder is empty, for example when launching a synchronization task for the first time, the OK button in Remote Folder Picker is greyed out.

Thanks, I'll do some testing with that to see what I can find.

I suppose that a connection is made, but it is just very slow (Took 55 minutes). I guess it is mostly related to having a big amount of data (Almost 300GB).

This also happens when trying to add a directory to sync, so waiting that long makes the app unusable.

That's it, I thought rclone was running operations/stat from rclone's RC interface, but I just checked the source code and it's actually running operations/size while logging in, which appears to count every file on the server (and also count the number of bytes in those files, which I'm assuming requires a download based off the amount of time it took for you). And adding a new sync directory is affected partly by the same issue, it looks up every file recursively on the server so it can provide completions.

I don't have much data on my instance (~500mb), so I never had an issue with slow loading times. I'm not quite sure why I chose operations/size to check the login status, I must've overlooked the description of what it does somehow :p.

It should just be a one-line change to fix the login issue. Recursively checking the remote for autocomplete suggestions during folder additions shouldn't be needed either - Celeste should be able to only check the directory for the one that's currently typed in, and Celeste should also be able to check the available directories on the remote in the background so it doesn't start lagging while it gets that info. I'll get all that done once I get home later tonight.

byteseb commented 1 year ago

@hwittenborn Thank you so much! Other than that bug, Celeste works and looks great

dariox86 commented 1 year ago

I am looking forward to use it as replacement to Nextcloud Client. Thank you for your hard work!

ProjectMoon commented 1 year ago

Does the error you get in there pop up if you try to list the files in the root of your Nextcloud directory? If it does then it's probably related to that somehow - I'd say we could ignore it, but then no files are going to be synced anyway, right?

My E2EE folder was created with the official NextCloud client, and it it's in the root of the Nextcloud directory. I checked my service script that syncs Nextcloud on my Rasperry Pi, and it turns out I wound up just excluding the encrypted directory I'm not sure if there's a general "ignore error" flag for rclone.

I will try removing the E2EE folder (there's nothing important in it) and using Celeste again after the fix for the main problem goes through. I have like 500 GB of stuff on Nextcloud.

hwittenborn commented 1 year ago

Hey, terribly sorry for the delay on my part. I've had the fix for the login issue in for a bit now, I'm just finalizing the changes for the autocomplete in folder additions before I push. There's an issue that came up that's taking me a while to fix (it's a bit of a complex issue, if any of y'all are curious I can explain it though) and that's the thing that's keeping this all back at the moment.

I'm hoping it'll all be done in the next day or two, but I'll send something once I got it all figured out.

hwittenborn commented 1 year ago

Alright, I got all the remaining issues cleaned up, and I got everything pushed into v0.5.0. The Snap will be out in about an hour, and the Flatpak in about 4 due to publishing delays that Flathub requires.

I'll send a message tomorrow once I can confirm everything's out to all of Celeste's publishing platforms.