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

Joplin crashes on startup with read-only-related error #11457

Closed
personalizedrefrigerator opened this issue Dec 2, 2024 · 3 comments
Closed
Labels
bug It's a bug cli CLI app specific issue desktop All desktop platforms high High priority issues

Comments

@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Dec 2, 2024

Operating system

Windows

Joplin version

3.1.24 and 3.1.23

Desktop version info

No response

Current behaviour

From the forum:

An error occurred: Fatal error:

Cannot change or delete a read-only item: e3ce90472d9f4e8b95acff6a437d0cac
   at checkIfItemCanBeChanged
(C:\Users\Pa\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\....:15)
   at checkIfItemsCanBeChanged
(C:\Users\Pa\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\....:45)
   at async Note.batchDelete
(C:\Users\Pa\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\....:17)
   at async permanentlyDeleteOldItems
(C:\Users\Pa\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\....:5)
   at async setupAutoDeletion
...

This happens when Joplin attempts to remove old read-only items from the trash on startup.

In particular, the error is happening here:

await Note.batchDelete(result.noteIds, { sourceDescription: 'permanentlyDeleteOldItems' });

permanentlyDeleteOldItems calls Note.batchDelete, which calls BaseItem.batchDelete, which calls checkIfItemsCanBeChanged:

checkIfItemsCanBeChanged(this.modelType(), options.changeSource, previousItems, this.syncShareCache);

This then throws a JoplinError because one of the items is read-only:

throw new JoplinError(`Cannot change or delete a read-only item: ${item.id}`, ErrorCode.IsReadOnly);

Expected behaviour

Joplin should not try crash on startup.

Logs

No response

@personalizedrefrigerator personalizedrefrigerator added bug It's a bug desktop All desktop platforms high High priority issues mobile All mobile platforms cli CLI app specific issue labels Dec 2, 2024
@personalizedrefrigerator
Copy link
Collaborator Author

Update: This may not affect mobile — setupAutoDeletion is currently only called in BaseApplication, which is not used on mobile.

@CoffeeHT
Copy link

CoffeeHT commented Jan 4, 2025

@personalizedrefrigerator

closed this as completed in 9c4142f

Hmmm...
Maybe I should take the brave step of trying a prerelease for the first time. So far, I've only used the ‘normal’ versions that were automatically offered to me – currently still Joplin 3.1.24 (prod, win32)
From your point of view, is there anything wrong with me installing V3.2.6 from https://github.com/laurent22/joplin/releases/download/v3.2.6/Joplin-Setup-3.2.6.exe?
That is the Windows version, isn't it?

@CoffeeHT
Copy link

CoffeeHT commented Jan 4, 2025

I have installed this version.
The profile started was that of a basic user who only has read-only rights to my shares.
He got the error message:

Remote-Elemente aktualisiert: 1.
Abgeschlossen: 2025-01-04 18:58 (1s)
Letzte Fehlermeldung: Sync target lock error: syncLockGone. Original error was: user does not have write access to this share
Anhänge abrufen: 3/5437

Joplin 3.2.6 (prod, win32)

Client-ID: xxx
Sync-Version: 3
Profil-Version: 47
Unterstützter Schlüsselbund: Ja

Revision: 40914be

Backup: 1.4.2
Conflict Resolution: 1.2.3
Diff view: 0.1.0
Freehand Drawing: 2.13.0
Joplin debug tool: 0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug cli CLI app specific issue desktop All desktop platforms high High priority issues
Projects
None yet
Development

No branches or pull requests

2 participants