-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Attached files are corrupt after sync, download and decryption #8979
Comments
|
Could you please post the original file and the broken file there? |
|
Thank you for the response. Here is an example pdf. The one ending GOOD is from the windows client it was created on, and the one ending BAD is on another windows client which downloaded the note after sync and click on the note. I included some screenshots too. I right clinked the link in each client and uses 'Save As' to get the file. I note the file sizes are hugely different. I opened the file in a text editor and actually see a HTML error in there! You will see it. So, this is the cause of the issue. Why however it cannot find the file it requested, nor does Joplin report any sort of error I do not know. Bad one new-guide-to-installlation-of-pv-systems-mcs_20130530161524 BAD.pdf new-guide-to-installlation-of-pv-systems-mcs_20130530161524 GOOD.pdf |
|
Just in case you cannot see / open the second BAD pdf file for any reason. It actually contains this HTML error page... Server Error404 - File or directory not found.The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. |
You can use the portable version, which won't affect the installed Joplin |
|
Have you ever tried other sync methods? |
No - I set it up with Webdav and as all the notes were actually syncing, I assumed it was working. Well, for at least a week or so until I tried accessing some attachments remotely. Odd that it is only the attachments. Note content syncs fine and all the notes are created on the clients OK. I do have them set to 'Auto', to prevent downloading all the attachments by default to save space on the underpowered clients! Maybe that has something to do with it. As the server is returning a standard HTTP error though, it seems to me that it might be a good idea for Joplin to recognise that and throw some sort of error message re the failure to fetch the file. I will try and get some information from the web server log files as to what the exact request being made is. Perhaps that will give us some clues. |
|
I have done some more investigation on this. I decided to use the Joplin function to resync and upload all files to the server again. Once it completed (couple hours) I then checked the file for the PDF on the device it was created on You can see here, using the reveal option in folder in Joplin, the files If I now search in the webdav folder on the server, I see the file name, but it is just 2k in size... I found the PUT request in the server log. It seems OK 2023-10-01 15:56:41 192.168.2.43 PUT /ffe27ad94a8625b3608ee15f265ad02a.md - 443 pjsxxx 192.168.2.100 Joplin/1.0 - 204 0 0 11 I searched the local joplin log and have these entries for that file. Here are the relevant entries I could see 2023-10-01 16:56:40: Synchronizer: "Sync: createRemote: remote does not exist, and local is new and has never been synced: Resource: (Local ffe27ad94a8625b3608ee15f265ad02a)" Here is the sync status I don;t see any more detailed debug info, and the logs and application report no errors at all, but it seems Joplin is not uploading the full file successfully. Is there any way to get more log info, more verbose logging, that might point the way to what is going on? |
|
I guess this issue is something unexpected so the log won't tell us more. |
|
Ah, got it. Thank you. Yes - If I look in the resource folder, it is there, correctly sized So, the other client has been offline since the resync. I started it up and let the windows client fully re-sync (attachments set to 'Auto'), so download when click on note, then I tried to access the file again from that client. Thank you for bearing with me and responding. Sometimes working through the process with a little help is all it needs! If I may make a suggestion - Or a couple! The first one - Custom or missing file extensions. I already ran into this issue for the md files. If you use non-standard file extensions some web servers will not serve the files as they do not have MIME type mappings for them. I appreciate this is likely too late to change, but I am sure it is a major hassle for people trying to figure out webdav sync! The other one - Joplin is not handling HTTP response codes when fetching elements, it seems. The server was clearly giving out 404 responses. Joplin was considering that a valid document. This is, I think, an obvious error. Some sort of check here would probably have saved a lot of time and pointed to the issue a lot sooner. Thank you all! |
|
I'm glad to hear your problem being solved. |
|
The log is incomplete and doesn't show the 404 error. Could you share the log that includes this error please? For information, IIS is an awful implementation and we already have some hacks to support it. Maybe they broke it further in a recent version and we need more hacks, but we'll need the log for this. See here for example: joplin/packages/lib/file-api-driver-webdav.js Line 168 in 487112f
|
|
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions. |
|
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information. |







Syncing using webdav to IIS
Both Windows clients use 2.13.1
The andriod client is 2.12.3
Create a simple note on the first windows client I configured. Call it 'test note'. Drag and drop a single image (jpg) (or other attachment such as a pdf) into the note. This works all as expected on that original client the note was created on. Sync the note. That is OK.
Sync a different client. The note is synced, no errors are reported. Click the note - The timer appears and the attachment downloads, as you would expect. It says it is decrypting and then it is decrypted. Sync status shows the note download and decrypted. But, the image is a broken link (as the inline viewer is unable to show it), and the pdf is the same. Download the attachment and try to view with external viewers and they are all reported as broken format. Images will not show. PDF's reported as corrupt. All normal note content and HTML etc seems to download OK. It's just attached files that seem to be the issue.
Double-check encryption status on all devices. All say they are OK and are using the same key. No errors at all as far as I can see. Simply the fact that the attachments are somehow corrupt after download. Perhaps the encryption is not correctly decrypting. That is the only thing I can think off. I would try removing the encryption for test, but it took a long time to setup and I have a lot of notes, so would rather not break it all unless needed!
Not OS or client specific as the same issue is reproduced on this setup with Windows 10 and the windows client as well as Andriod 13 and the android client.
The log appears to show the note being downloaded and decrypted OK on the client
debug.txt
The text was updated successfully, but these errors were encountered: