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

App token login name does not match #6783

Closed
6 of 8 tasks
stfast opened this issue May 28, 2024 · 18 comments · Fixed by #7240
Closed
6 of 8 tasks

App token login name does not match #6783

stfast opened this issue May 28, 2024 · 18 comments · Fixed by #7240

Comments

@stfast
Copy link

stfast commented May 28, 2024

⚠️ Before submitting, please verify the following: ⚠️

Bug description

MacOS VFS not working

Steps to reproduce

  1. Upgrade to Nextcloud 29
  2. Installing Nextcloud-3.13.0-macOS-vfs.pkg desktop package

Expected behavior

MacOS VFS sync should work.

Which files are affected by this bug

All files

Operating system

Mac OS

Which version of the operating system you are running.

macOS Sonoma

Package

Appimage

Nextcloud Server version

29.0.1

Nextcloud Desktop Client version

3.13.0git (build 22493)

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 3.4.2 to 3.4.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

  • Default internal user-backend
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Nextcloud Server logs

{"reqId":"ZlWlLYRKmwoFGdCgwVCaxAAAABE","level":3,"time":"2024-05-28T09:34:37+00:00","remoteAddr":"1.1.1.1","user":"--","app":"core","method":"GET","url":"/ocs/v1.php/cloud/capabilities","message":"App token login name does not match","userAgent":"Nextcloud-macOS/FileProviderExt","version":"29.0.1.1","data":{"tokenLoginName":"[email protected]","sessionLoginName":"FDD17349-A32D-4411-8E0E-A71BAA44509F","app":"core","user":"FDD17349-A32D-4411-8E0E-A71BAA44509F"}}
{"reqId":"ZlWlLoRKmwoFGdCgwVCaxQAAAAk","level":3,"time":"2024-05-28T09:34:38+00:00","remoteAddr":"1.1.1.1","user":"--","app":"core","method":"GET","url":"/ocs/v1.php/cloud/capabilities","message":"App token login name does not match","userAgent":"Nextcloud-macOS/FileProviderExt","version":"29.0.1.1","data":{"tokenLoginName":"[email protected]","sessionLoginName":"FDD17349-A32D-4411-8E0E-A71BAA44509F","app":"core","user":"FDD17349-A32D-4411-8E0E-A71BAA44509F"}}
{"reqId":"ZlWlLoRKmwoFGdCgwVCaxgAAABM","level":3,"time":"2024-05-28T09:34:38+00:00","remoteAddr":"1.1.1.1","user":"--","app":"core","method":"GET","url":"/ocs/v1.php/cloud/capabilities","message":"App token login name does not match","userAgent":"Nextcloud-macOS/FileProviderExt","version":"29.0.1.1","data":{"tokenLoginName":"[email protected]","sessionLoginName":"FDD17349-A32D-4411-8E0E-A71BAA44509F","app":"core","user":"FDD17349-A32D-4411-8E0E-A71BAA44509F"}}
{"reqId":"ZlWlLoRKmwoFGdCgwVCaxwAAAA4","level":3,"time":"2024-05-28T09:34:38+00:00","remoteAddr":"1.1.1.1","user":"--","app":"core","method":"GET","url":"/ocs/v1.php/cloud/capabilities","message":"App token login name does not match","userAgent":"Nextcloud-macOS/FileProviderExt","version":"29.0.1.1","data":{"tokenLoginName":"[email protected]","sessionLoginName":"FDD17349-A32D-4411-8E0E-A71BAA44509F","app":"core","user":"FDD17349-A32D-4411-8E0E-A71BAA44509F"}}
{"reqId":"ZlWlLoRKmwoFGdCgwVCayAAAAAs","level":3,"time":"2024-05-28T09:34:38+00:00","remoteAddr":"1.1.1.1","user":"--","app":"core","method":"GET","url":"/ocs/v1.php/cloud/capabilities","message":"App token login name does not match","userAgent":"Nextcloud-macOS/FileProviderExt","version":"29.0.1.1","data":{"tokenLoginName":"[email protected]","sessionLoginName":"FDD17349-A32D-4411-8E0E-A71BAA44509F","app":"core","user":"FDD17349-A32D-4411-8E0E-A71BAA44509F"}}
{"reqId":"ZlWlLjKYlJZA6EfwdAblQQAAAEs","level":3,"time":"2024-05-28T09:34:38+00:00","remoteAddr":"1.1.1.1","user":"--","app":"core","method":"PROPFIND","url":"/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F","message":"App token login name does not match","userAgent":"Nextcloud-macOS/FileProviderExt","version":"29.0.1.1","data":{"tokenLoginName":"[email protected]","sessionLoginName":"FDD17349-A32D-4411-8E0E-A71BAA44509F","app":"core","user":"FDD17349-A32D-4411-8E0E-A71BAA44509F"}}

Additional info

image
image

@stfast
Copy link
Author

stfast commented May 28, 2024

Additional debug data from macOS Desktop client - "Settings/Virtual file sync/Advanced/Create debug archive"

Not providing enumerator for container with identifier NSFileProviderWorkingSetContainerItemIdentifier yet as account not set up
Could not get notifyPush websocket FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com, polling.
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997
Unauthorised
1 depth readFileOrFolder of url: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F did not complete successfully, received error: No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Finishing enumeration for user: FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F with error No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect
Could not get FDD17349-A32D-4411-8E0E-A71BAA44509F https://nextcloud.domain.com capabilities:
997

@claucambra claucambra self-assigned this May 30, 2024
@claucambra
Copy link
Collaborator

Hi @stfast could you also send us the normal debug archive for the desktop client? Thanks!

@stfast
Copy link
Author

stfast commented Jun 26, 2024

Actually they are one post above.

Here is archive file.

Nextcloud-Desktop-debug_archive.txt.zip

@stfast
Copy link
Author

stfast commented Jul 22, 2024

Guys, after all VFS PR with HUB 8, this is embarrassing, still not working ...

@claucambra
Copy link
Collaborator

Hello @stfast I am sorry I haven't had the time to fix this yet, I am patching the virtual files module as quickly as I can

Your log files say your username is FDD17349-A32D-4411-8E0E-A71BAA44509; I am guessing this is incorrect? Are you using LDAP or some alternative user backend on your server instance?

Thanks for providing information

@stfast
Copy link
Author

stfast commented Jul 24, 2024

Hello @stfast I am sorry I haven't had the time to fix this yet, I am patching the virtual files module as quickly as I can

Your log files say your username is FDD17349-A32D-4411-8E0E-A71BAA44509; I am guessing this is incorrect? Are you using LDAP or some alternative user backend on your server instance?

Thanks for providing information

Yes, this is LDAP user ID from LDAP backend as stated on your questionary on the top of this issue, and everything is correct, since normal macOS desktop sync does work, but not VFS one, all latest NC server 29.0.4 and desktop client 3.13.2git (build 24287).

@stfast
Copy link
Author

stfast commented Aug 13, 2024

Anything? Nextcloud 30 approaching and still not fixed.

@joshtrichards joshtrichards changed the title macOS VFS - Nextcloud-macOS/FileProviderExt - App token login name does not match App token login name does not match Aug 31, 2024
@joshtrichards
Copy link
Member

joshtrichards commented Aug 31, 2024

Can you elaborate a bit on how you're authentication from the VFS version of the client?

I have a feeling this is specific to LDAP or an interaction with LDAP and the Login flow or app tokens.

Refs:

Though I've no idea at the moment why you'd only encounter it with VFS mode.

Is your non-VFS client (that doesn't have this problem) configured exactly the same in terms of authentication? And is it against the same Nextcloud server?

@thejulian
Copy link

thejulian commented Sep 17, 2024

I have the same error.
Standard file sync is working (with same account, same backend - LDAP, same server).
Removed all sessions and reinstalled Desktop client. No success.

@frene7ik
Copy link

Same here. I also tried with an app password but got identical results.

@stfast
Copy link
Author

stfast commented Sep 23, 2024

Upgraded to Nextcloud 30, now changed error mesaages in debug archive:

Sending extension account ID [email protected]
Successfully started Realm db for NextcloudFileProviderKit
Set up enumerator for user: [email protected] https://nextcloud.domain.com
with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/[email protected]
Set up enumerator for user: [email protected] https://nextcloud.domain.com
with serverUrl: https://nextcloud.domain.com/remote.php/dav/files/[email protected]
Sending extension account ID [email protected]
1 depth read of url https://nextcloud.domain.com/remote.php/dav/files/[email protected]
did not complete successfully, error:
The server was unable to complete your request. If this happens again, please send the technical details below to the server administrator. More details can be found in the server log.
"Finishing enumeration for user: [email protected] https://nextcloud.domain.com

NC-30.txt

@osiktech
Copy link

osiktech commented Sep 23, 2024

I ran into the same issue just a couple of days ago. Took me a while to find this issue here.

I am using LDAP as user backend and my username is a generated uuid. To fix this issue, I stopped my nextcloud, dumped the database, replaced the UUID with my email address in the dump, imported the dump back to my database, started the nextcloud server again and linked the nextcloud client and everything was working.

I only took this approach because this is my personal instance and I have backups of everything. so before anyone takes this road, I cannot stress enough the fact, make backups(!) , test the backups before, and only if everything works, you could think of trying my approach.

due to the change of the username, you most probably need to reconnect any DAV related connections. so be very careful!!!!

@stfast
Copy link
Author

stfast commented Sep 23, 2024

I ran into the same issue just a couple of days ago. Took me a while to find this issue here.

I am using LDAP as user backend and my username is a generated uuid. To fix this issue, I stopped my nextcloud, dumped the database, replaced the UUID with my email address in the dump, imported the dump back to my database, started the nextcloud server again and linked the nextcloud client and everything was working.

I only took this approach because this is my personal instance and I have backups of everything. so before anyone takes this road, I cannot stress enough the fact, make backups(!) , test the backups before, and only if everything works, you could think of trying my approach.

due to the change of the username, you most probably need to reconnect any DAV related connections. so be very careful!!!!

Thanks for sharing your knowledge.

So since UUID is the default settings for NC internal username you can ask yourself why this issue is unresolved for 1/2 of the year, and could be resolved with these LDAP Expert settings:

image

@osiktech
Copy link

I ran into the same issue just a couple of days ago. Took me a while to find this issue here.
I am using LDAP as user backend and my username is a generated uuid. To fix this issue, I stopped my nextcloud, dumped the database, replaced the UUID with my email address in the dump, imported the dump back to my database, started the nextcloud server again and linked the nextcloud client and everything was working.
I only took this approach because this is my personal instance and I have backups of everything. so before anyone takes this road, I cannot stress enough the fact, make backups(!) , test the backups before, and only if everything works, you could think of trying my approach.
due to the change of the username, you most probably need to reconnect any DAV related connections. so be very careful!!!!

Thanks for sharing your knowledge.

So since UUID is the default settings for NC internal username you can ask yourself why this issue is unresolved for 1/2 of the year, and could be resolved with these LDAP Expert settings:

image

Thanks for pointing this out, I forgot to mention that I changed the Internal Username Attribute before dumping my db and making any changes to my instance. Future usernames will be using the mail attribute from my LDAP as username.

@stfast
Copy link
Author

stfast commented Nov 4, 2024

Great, server side errors for "App token login name does not match" have disappeared, still, VFS macOS desktop sync does work for LDAP users with default LDAP UUID Internal Username, which is default LDAP behavior with only Expert LDAP option to override it for new users.

Now we have latest 3.14.3 macOS VFS client and Nextcloud 30.0.1 server.

As you see from desktop client debug archive, user is authenticated, but client's server URL (serverUrl) shoud be with UUID (default Internal Username)

https://nc.domain.com/remote.php/dav/files/FDD17349-A32D-4411-8E0E-A71BAA44509F

and not with username (LDAP userPrincipalName in our case)

https://nc.domain.com/remote.php/dav/files/[email protected]

I have checked WebDav and it works only with UUID as WebDAV USERNAME and pointed in "Files/Files settings" WebDav URL:
(NC docs - https://cloud.example.com/remote.php/dav/files/USERNAME/)

Image

This is from attached desktop client debug archive:

Not fetching item for identifier: NSFileProviderRootContainerItemIdentifier
as account not set up yet.
Authenticated! Nextcloud account set up in File Provider extension.
User: [email protected] at server: https://nc.domain.com
Successfully started Realm db for NextcloudFileProviderKit
Set up enumerator for user: [email protected] https://nc.domain.com
with serverUrl: https://nc.domain.com/remote.php/dav/files/[email protected]
Set up enumerator for user: [email protected] https://nc.domain.com
with serverUrl: https://nc.domain.com/remote.php/dav/files/[email protected]
1 depth read of url https://nc.domain.com/remote.php/dav/files/[email protected]
did not complete successfully, error:
The server was unable to complete your request. If this happens again, please send the technical details below to the server administrator. More details can be found in the server log.
"Finishing enumeration for user: [email protected] https://nc.domain.com
with serverUrl: https://nc.domain.com/remote.php/dav/files/[email protected]
with error
The server was unable to complete your request. If this happens again, please send the technical details below to the server administrator. More details can be found in the server log.
Set up enumerator for user: [email protected] https://nc.domain.com

NC-30.0.1.txt

Actually reexporting database with replaced UUIDs for "usernames" is not an option for lots of users in 23 database tables:

$ cd /var/lib/mysql/nextcloud/
$ grep -r FDD17349-A32D-4411-8E0E-A71BAA44509F *
grep: oc_activity.ibd: binary file matches
grep: oc_activity_mq.ibd: binary file matches
grep: oc_authtoken.ibd: binary file matches
grep: oc_bookmarks_folders.ibd: binary file matches
grep: oc_dashboard_data.ibd: binary file matches
grep: oc_external_applicable.ibd: binary file matches
grep: oc_filecache.ibd: binary file matches
grep: oc_files_trash.ibd: binary file matches
grep: oc_files_versions.ibd: binary file matches
grep: oc_ldap_group_membership.ibd: binary file matches
grep: oc_login_ips_aggregated.ibd: binary file matches
grep: oc_maps_photos.ibd: binary file matches
grep: oc_mounts.ibd: binary file matches
grep: oc_notifications.ibd: binary file matches
grep: oc_notifications_pushhash.ibd: binary file matches
grep: oc_notifications_settings.ibd: binary file matches
grep: oc_preferences.ibd: binary file matches
grep: oc_profile_config.ibd: binary file matches
grep: oc_share.ibd: binary file matches
grep: oc_storages_credentials.ibd: binary file matches
grep: oc_suspicious_login.ibd: binary file matches
grep: oc_user_status.ibd: binary file matches
grep: oc_weather_config.ibd: binary file matches

@claucambra
Copy link
Collaborator

@stfast thanks for posting this, I realised this a few days ago too (opened claucambra/NextcloudFileProviderKit#24 which fixes this)

@stfast
Copy link
Author

stfast commented Dec 2, 2024

OK, now with Nextcloud Desktop version 3.15.0, LDAP login is working and server and client errors are gone.

But how is this supposed to work?

On first sync "Virtual file sync" does not get to synced status.

Image

When you quit and than start Nextcloud Desktop client again, than suddenly it is "All Synced":

Image

Folder with Sync Connection have 5.9 Gb of data even if you quit Nextcloud Desktop client:

$ du -sh .
5.9G .

and there is none files to evict

Image

If we summarize, macOS "Virtual file sync" still not working.

@stfast
Copy link
Author

stfast commented Dec 2, 2024

OK, I dug it deeper and found macOS VFS location on this kind of a path:

$ open ~/Library/CloudStorage/Nextcloud-user@[email protected]/

Image

If you quit Nextcloud.app and start it back, Nextcloud folder from Locations in Finder dissapears.

You have to be kind of an expert yourself to put this path back to the Finder, since ~/Library/* folder is hidden by default.

There should be some configuration for VFS mount path as it is "Folder Sync Connection" for classic sync.

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

Successfully merging a pull request may close this issue.

6 participants