-
Notifications
You must be signed in to change notification settings - Fork 814
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 sync due to invalid modification time" #4378
Comments
Identical problem with Windows 11. Client version is current 3.4.4 Trying to fix the problem by setting the date of the last modification via Linux command touch to the current date does not interest the client. Even after a clean reinstallation of the client, the sync errors reappear right after the first sync. Is there a possibility that the sync errors are stored in the database, preventing the client from starting a proper sync? edit
If the sync continues to generate errors, you will need to manually clean up the user's deleted files on the server. |
Thanks, this method works and I have fixed it. |
nextcloud-client: 3.4.4 Saw this error today on my main
gives no results. Are there any instructions/steps what else could be done/how to solve this issue? Inside [Edit] On the server drive (ZFS), the folder has the correct date:
Atm. I assume this happened because I deleted a single photo through the web app today. I usually never do this (always remove the files on harddisk and let it sync). However, I don't know why this resulted in a broken timestamp on Nextcloud's database, and I don't know why it cannot get the correct one from the filesystem, since it is all there and correct. [Edit2] Also tested solvable_files.sh with [Edit3] No way to solve this error with the Leaving this at it today, perhaps tomorrow someone will find a solution. Here're the log lines from Desktop Client that appear to point to the issue: click
|
Solved it for the moment: choco uninstall nextcloud-client
choco install nextcloud-client --allow-downgrade --version 3.4.3 Now the desktop client syncs again and does not error on Modification date. The wrong (future) modification date on |
Hi. That’s how I managed to solve this First of all you need to find all the files with destroyed timestamp find yournextcloudfilelocation/ ! -newermt 1970-01-02 > damaged.txt #!/bin/bash file="damaged.tx" while read -r line; do Then If you use docker sudo docker exec --user www-data your containerID php occ files:scan --all sudo -u www-data php occ files:scan --all after that you need to sync all your clients from scratch |
@AndyXheli Thanks andy. I tested these steps. There was only one folder affected: My main Here is how I solved this (just now).
What wasn't clear to me is that Also updated |
Also if you have a Windows client, you can fix broken files from the client-side with this PowerShell one-liner (run it in the NextCloud folder in your user profile):
|
I doubt this would work, since the client refused to sync to the server (at all) - because the wrong date was on the server (database only, fs not affected), not on the client side. |
Works for me, mate 🤷♂️ - all green and happy now |
Thanks, that worked for me to adjust the filedates, just had to change the timestamp to [datetime]::new(621356004000000000) as mine were 01.01.1970 01:00 instead of 00:00. |
Didn't work for me, it looks like the problem lies in the cloud database on my end too |
Apparently the 01.01.1970 is not the only problematic date, with the update to version 3.4.4 on Linux Mint 20.3 some files suddenly got the modified at 07.02.2106. Fixing on the client side works with |
We also had some cases of "Cannot sync due to invalid modification time", but instead of the other solutions, which work on the client-side, we solved this on the server-side, which might be a good idea in case you've no access to some clients yourself. SolutionI found some entries in the data base table In a second step I replaced the SELECT *
FROM oc_filecache
WHERE oc_filecache.mtime <> oc_filecache.storage_mtime
AND oc_filecache.mtime NOT BETWEEN 1000000000 AND UNIX_TIMESTAMP()
LIMIT 100
; |
Can confirm this fixed the issue on my end |
I wanted to try this out but I'm not an SQL expert. I was able to get into my PSQL database, connect to the database with oc_filecache table, however, running the command caused issues.
Is this SQL statement for mysql instead? If so, can someone help me undertand the error message and/or tweak it for PSQL? |
I ended up using:
However, it didn't work for me because BOTH mtime and storage_mtime for those entries were 0. I ended up getting the current unix timstamp manually, and then replacing the text "1234567890" with it.
|
This resolved my issue: I checked all files and dir up to 1980 THAN
From 2023 up to 2200 as I had files modified in futur (86 years from now) You should not have any error Now fixed !!! Those files were on a Mac going to Windows by USB key and sync some years ago to my nexcloud server (Linux Nexcloud) Hope this help ! C. |
@jreed1701, I just remember problems with the desktop client version 3.4.0, that might be related to your problem and that's further explained othere here: https://github.com/nextcloud/desktop/wiki/How-to-fix-the-error-invalid-or-negative-modification-date |
Thanks @lars-sh - I followed the procedure and running ./solvable_files.sh just returns and does nothing. I'm sure I have the right arguments because ./unsolvable_files.sh works just fine. |
Resolved with this command, but expanded date to 1969-12-31. |
I got fed up, wiped my nextcloud server to start over. I ended up using the 3.3.6 client on Windows and that worked fine. I don't plan to upgrade until there's some definitive fix in the next release. Hopefully the admins communicate that clearly. |
in my case i think this occurred when I changed the folders being synced in the client while a sync was trying to pull down a bunch of files. After checking an additional folder and pressing apply, I started receiving these errors and the mtime in the database doesn't seem correct any longer. |
This bug burnt me severely in 2021 as mentioned in the OP, and its amazing to see this regression emerge again, first on Windows and now on Linux (Fedora 35). I literally have no real way of handling this with my users except to blanket ban the desktop clients, which is wild. |
I see this even though there are no actual invalid modification times, neither on the server nor on the client. |
I have the same problem. No invalid modification time on the files. Seems I just moved some files to a different folder on the client at the wrong time (during upload?). EDIT: Turns out, the did have the invalid 01.01.1970 modification time. Just not on the server itself, but only on the client. So the have been uploaded but syncing to other clients did not work. |
I'm having the same problem on desktop client running on Win10. MacOS and mobile clients are running without issues. Tried to fix the mtimes with server side commands suggested above and also do So I started reverting back old client versions one by one and the the first version to fix that problem was version Nextcloud team please address this bug with more serious attention. It's obvious that a change between I'm ready to assist and provide log data if needed. Just let me know. |
I did some Julia scripting to update the problematic modification times. I used the Initially, I called invalid_date_dir = "directory/contining/your/problematic/files/and_or/folders"
problematic_mtime = -3600
for (root, dirs, files) in walkdir(invalid_date_dir)
for dir in dirs
if mtime(joinpath(root, dir)) == problematic_mtime
try
cmd = `touch $(joinpath(root, dir))`
run(cmd)
@info "Updated modification time of directory $dir"
catch e
@warn "Encountered error while touching directory $dir. Continuing"
end
end
end
for file in files
if mtime(joinpath(root, file)) == problematic_mtime
try
cmd = `touch $(joinpath(root, file))`
run(cmd)
@info "Updated modification time of file $file"
catch e
@warn "Encountered error while touching file $file. Continuing"
end
end
end
end I realize that this is done by others previously in this thread, but not in a way I could read and understand. I feel like this is rather clear, if you happen to have Julia installed. |
I downloaded a folder from Google Drive, unzipped it, and copied it into the NextCloud sync folder. Almost all the files had this error! I did not need to preserve the modification time of the files, so I just killed them all with However, for a non-technical user, this is a showstopper bug. (Also, I had a file with a very long name. The sync client got stuck in a loop inundating the desktop with the notification that the file has invalid characters...) |
https://drive.google.com/file/d/1BxhpYyyVDNbsGdlh7DjhVnK4doswGAEQ/view?usp=sharing |
There's no need of a such complicated workaround.
For me, it worked like a charm. |
Hello everyone, this ticket is the one with the most upvotes. The initial problem descriptions originate from 3.4.4 from 2022. What I read from the latest replies, the error is within the source files originally before they were brought into the Nextcloud sync. There are also several descriptions how to correct the files and get everything working again. I am closing this ticket for now not to mix up different topics even more. Thank you all |
@Rello |
Given that multiple file systems allow those files to exist I'd argue that it is not an "error within the source files". But it is an uncommon value in the metadata, I'll give you that. On Linux it still produces an error in the first place, but it is fixable with a simple "touch" to the file. I haven't checked the server side but at least from a user perspective that is much better than before. Still not ideal, because the user needs to figure out what happened and how to react accordingly. If you have a lot of files this could also become tedious without a script to change those timestamps. |
From following this issue for multiple years it's clear that there are multiple flaws in the Nextcloud ecosystem of apps that lead to data loss or sync failure, and although the causes of this particular bug are varied, the outcome is broadly the same. I wish I could say the decision to close this issue is surprising, but honestly, it is not. It is absolutely in line with the culture of Nextcloud. Mentioning the hacks exist to fix this issue manually as further justification to sweep this integrity-wrecking bug under the rug is particularly on brand. From the outside, it's almost like the Nextcloud team is unable to truly test and definitively say that the issue described is fixed or not. Instead, the metric for closing the top rated data loss bug is, " The Nextcloud Server + Nextcloud Client has been stabilized and hardened a lot since then." I wish, with all my heart, that there was a culture of accountability and rigour in the EU FOSS ecosystem. |
I've been running nextcloud for over a decade now, even back before it forked from ownCloud. I am literally using it daily. I have four instances running. I used to run one with ~100 users. It's not flawless, but neither are commercial solutions. I don't think they deserve criticism this harsh. |
I'm glad that, anecdotally, Nextcloud works from you. This has not been the experience for many others here, as evidenced by this very thread. Aside from this bug - an issue that the team has attempted to close in the past despite the issue not being fixed for years - Nextcloud ships a completely [broken] end to end encryption module that has severe bugs that lock users out of their files going back to 2018. Nextcloud couldn't support files above 2GB over common S3 configurations until 2023, and the team had to be pressured to take the issue seriously. The Nextcloud OnlyOffice Community Server loses data so frequently and consistently it's the most-commented issue in the repo. From the outside, Nextcloud's priorities appear to be completely at the behest to the whims of a distracted leadership. Nextcloud is positioned such that the company absorbs a large amount of the capital that the EU particularly is willing to part with for this kind of infrastructure, and it is extremely difficult to develop a competitor in this environment. I am critical of this project because I am passionate about the need for a viable alternative to the despicable practices of big tech. But with many massive data-loss bugs languishing for years, there is little other choice but to be as noisy as possible. |
@Rello would this be an accurate representation of Nextcloud's approach?
|
Hi all, I just installed Nextcloud Server and the relative Client, and encountered this bug while moving a bunch of data. I see the issue has been closed for some reason, but just wanted to flag that the bug is still there! |
Hello all, thank you for supporting us and giving us feedback that this topic is still relevant. ...reopened... |
It is so crazy how easily reproducible this bug is, and that it's very clearly not being tracked internally. Github needs a clown reaction emoji. |
Hello, thank you for your feedback. As the issue was reopened, it will not be ignored. |
How to use GitHub
Expected behaviour
It should be able to sync files with no issues
Actual behaviour
Complains about invalid modification time while basically everything else works perfectly with the same files
Steps to reproduce
Client configuration
Version 3.4.4 (Windows).
Operating system: Windows 10
OS language: US ENG
Qt version used by client package (Linux only, see also Settings dialog):
Client package (From Nextcloud or distro) (Linux only):
Installation path of client:
default
Server version
22.2.5
I can see that it had ruined many people's files back in 2021 https://syncloud.discourse.group/t/disaster-with-nexcloud-3-4-0-client/141/4
But I am not sure if I was using the same instance back then. It seems this issue is still present. I am spending hours on trying to move files, rescan them, whatever. It is really making me stop recommending this (potentially) amazing product to anyone.
The text was updated successfully, but these errors were encountered: