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

Cannot use shared folder for notes anymore. #1266

Open
SimeonEhrig opened this issue Mar 31, 2024 · 10 comments
Open

Cannot use shared folder for notes anymore. #1266

SimeonEhrig opened this issue Mar 31, 2024 · 10 comments
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced

Comments

@SimeonEhrig
Copy link

I share the Notes between two accounts. The first account is my main account. The second account is a dedicated account for my smartphone. Up to version 4.9.3, everything works fine. I could create and edit markdown files on my PC and sync it via Nextcloud client to the main account, use the web interface of my main account for editing notices and read and write notices on my smartphone with the nextcloud notes app syncing over the dedicated android account.

Since version 4.9.4. The android app and the notice app of the android account is not working anymore. The notice app on the main account is still working.

I think, this is related to this PR: #1263

Steps to reproduce

  1. Create two accounts on the same nextcloud instance
  2. share the Notes folder of the account A with account B
  3. try to create a note in the web interface of account B and check if it is available on account A

Expected behaviour

The notices should be shared and the web interface and the android app should work with account A and B in the same way.

Actual behaviour

Account B creates an new notes folder (Notes (2)) and stores the notes there.

Server

Please complete the following information.

  • Notes app version: 4.9.4
  • Nextcloud version: 28.0.4
  • OS: Ubuntu 23.10 server
  • Web server: Apache (builtin in nextcloud docker image: https://github.com/nextcloud/docker)
  • PHP version: 8.2.17
  • Database: mariadb 10.6.17

Nextcloud configuration:

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.domain.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/nextcloud.domain.com",
        "overwriteprotocol": "https",
        "dbtype": "mysql",
        "version": "28.0.4.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "calendar",
            "drawio",
            "tasks"
        ],
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "encryption.key_storage_migrated": false,
        "trashbin_retention_obligation": "auto, 30",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "default_phone_region": "DE",
        "mysql.utf8mb4": true
    }
}

Client

Please complete the following information.

  • Browser (incl. version): Firefox 124.0.1
  • OS: Linux Mint 21.3
@SimeonEhrig SimeonEhrig added bug Something isn't working need to reproduce Issue that has not been reproduced labels Mar 31, 2024
@areteichi
Copy link

Yes, I can verify this is happening to me as well. This error message repeatedly appears in the Nextcloud logs.

LockedException "Notes" is locked
Controller failed with OCP\Lock\LockedException

@callmetango
Copy link

callmetango commented Apr 1, 2024

This is happening to me as well using the same setup as above. The bug was introduced in commit a5bec1a.

After commenting out the faulty code in the source code of the installed Notes App, everything works as expected again.

Unfortunately it is unclear why this fix was introduced and why no tests failed.

@maranov
Copy link

maranov commented Apr 1, 2024

Can confirm, reverting a5bec1a does help, just in my case the shared-to user needed to temporarily set a different folder before I could re-share the original. Might be normal behavior caused by me deleting the share before, in an attempt to fix the issue.

Similar setup as OP, Notes 4.9.4.

@jaykijay
Copy link

jaykijay commented Apr 3, 2024

Can confirm.. This is a regression for me :/

@lftsy
Copy link

lftsy commented Apr 11, 2024

Thanks for reporting it, got same problem, and did use the same revert of a5bec1a to fix it
I do share my "Notes" folder with my wife, and it was not working anymore, it was creating endlessly "Notes (2)", "Notes (3)", ... , up to "Notes (19)"
FYI, we are mainly using the "Nextcloud Notes" Android app where we had the problem using the "Steps To Reproduce" reported above

Best Regards

@Waltibaba
Copy link

Waltibaba commented Apr 17, 2024

All of my storage is external since my nextcloud docker container is ephemeral, so all storage is "shared" by group rules, even the user's home directory. So I can't use Notes any more.

The current implementation using Folder->getNonExistingName() couldn't have passed even superficial testing in a shared folder.
The program flow goes like this:
If the chosen notes folder exists but is shared, it may not be used and a new one is created (with an incrementing number appended).
Once it has been created, the existence check confirms that it exists, which now makes it forbidden since only non-existing folders are allowed, that's the point of getNonExistingName().
Therefore it fails to use the just created folder and a new (higher numbered) folder is created, and the cycle repeats forever.

So whenever NoteUtil->getOrCreateFolder is called (apparently quite frequently, on every note file save attempt), it creates a new empty copy of the forbidden existing folder. This goes on forever and creates hundreds of empty folders in minutes. Obviously, getNonExistingName is being used incorrectly.

Is there a reason for the apparent intention not to use existing shared folders?

@gerhardt
Copy link

gerhardt commented Apr 20, 2024

Indeed, it's still broken, I've tried both options,
with and without the code

		if ($folder->isShared()) {
			$folderName = $this->root->getNonExistingName($path);
			$folder = $this->root->newFolder($folderName);
		}

it simply stays broken. I can't use the Notes app anymore together with my partner. At the legitimate user, who is sharing the folder, everything works fine. The one who is using the shared folder, gets these other folders 'Notes (2)' etc.

@SimeonEhrig
Copy link
Author

Any response on this problem? Looks like a lot of people have the same problem and nobody knows, what the code should do, which causes the problem.

It is a little bit annoying, yesterday was a new release and there is still no response from a developer :-(
At the moment, this means I have to fix the bug locally from time to time :-(

@lapor-kris
Copy link

I have the same problem. First my parter had an issue, then I've changed the permission, she started to share with me, and now I cannot use Notes app on my phone.

@maranov
Copy link

maranov commented May 2, 2024

Updated to 4.10.0. The issue is still the same and the workaround (reverting a5bec1a) still works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need to reproduce Issue that has not been reproduced
Projects
None yet
Development

No branches or pull requests

9 participants