Cannot sync Due to invalid modification time solution issue

I appreciate that this seems to be an issue which a lot f people are facing and there have been a lot of questions asked regarding this.

However, after reading all of the questions that I could find, I am still unable to resolve the problem

I followed this tutorial But it didnt seem to work.
I have only tried the but it made no difference

The attached image (With server details blanked out) shows that when I run the list function… nothing happens.
The SSH Client pauses for a few minutes as if it is doing work but nothing is returned. The same thing happens when I use the fix command.

As per the image:
I ran the cd command to change to the nextcloud directory where the file is stored

I then ran the command ./ /var/www/vhosts/host_directory/ ip_address:port DB_USer DB_Password DB_Name list scan

Is there something that I should have done differently?

The DB I that the data is stored on is MariaDB

Using the query SELECT COUNT(*) FROM oc_filecache WHERE mtime < 86400; returned a count of 2801

Please follow the thread regarding this topic and especially the last addition

where very cool solution was provided. Earlier in the thread more approaches listed.

@wwe thank you for your reply.
My concern is that my SSH/backend knowlege is minimal. I am fairly proficient at coding etc but I am a novice at this stuff

If I make a mistake somewhere, I would have no idea how to debug/resolve the issue.

It appears that this has been a problem for over a year now, I am very surprised that nextcloud have left the issue as is and not put something in place in recent update which will sort the issue automatically,

I read

While I understand it, I would be scared to attempt incase I made things worse

Also, that solution seems to be based on powershell (Windows). I am on a Linux system and the server is also Linux - Ubuntu

When it comes to system administration the first rule is you need good backup. Once bad thing will happen and you will need to recover the system.

As you have such backup you can easily try different recovery strategies or hire someone with good knowledge.

No it is not. Please take you time read and understand!

@EazyFreight I believe that you did not provide the trailing “/” in the path to the Nextcloud data dir and you did not provide the type of DB you are using <mysql|pgsql>
Also, “ip_address:port” for the DB server: It is not clear (at least to me) from the documentation if the script supports specifying a port. Does the DB server use a non standard port?
You provided list and scan. I don’t think that makes sense. If you list, you do not change anything. If you do not change anything, you do not need to scan. Better provide just “list” or “list” and noscan"
You can also try to provide “verbose”
See usage:

Usage: ./ <data_dir> <mysql|pgsql> <db_host> <db_user> <db_pwd> <db_name> <fix,list> <scan,noscan> <use_birthday,dont_use_birthday> <verbose,noverbose>

@EazyFreight about my script, you can install PS using

snap install powershell --classic

see the readme

@wwe I have read but as mentioned, my knowledge of this area is limited and I dont fully understand what it is telling me to do.

I feel as though nextcloud should be taking more ownership of the issue

@BenHastings the tutorial says without trailing /
I done another one where I provided the DB type mariadb but it gave the same outcome

I also tried removing the port, swapping scan for noscan and specifying mariadb but again, no difference

1 Like

@EazyFreight my bad, sorry.

Its annoying though that nextcloud released a version with a bug that caused this error and they seem to be taking no action to reverse it.

Although, I have only noticed the issue in the last month or 2 which is confusing given that the bug was apparently in an older release.

For people like me who are not the most command line savvy, it means potentially needing to hire someone to sort the problem, an expense that could be avoided if nextcloud was to take onus and release a genuine fix

@wwe @BenHastings
I have read some posts advising that the nextcloud propsed fix only works with mysql/pgsql
Do you know if tis is correct?
I am using mariadb and nothing seems to happen with the fix.

Might be a daft question. but when using list… where should the list appear? I am assuning that it will be on the screen under the command?.. or does it create a file somewhere?

MariaDB is drop-in replacement for mysql. It’s common to omit MariaDB if the issue is no specifically related to it.

The script’s results should appear on the shell. You can see an example here.
I just ran it now and it doesn’t output anything. In my case, I have fixed all the files, so I expect the script not to find anything. The problem is, I don’t know if the script ran successfully and found no files, or if I made an error in the script parameters. For instance, if I intentionally misspell the password or the database host parameter, the script will also run and output nothing (no error message appears).
If you haven’t fixed it yet, you can always give my script a try. All the steps are laid out in the readme. It is just copy & paste really. The only things you must enter yourself are the necessary DB credentials and IP address, the name of the DB and the path to the Nextcloud data directory.

I havet yet tried the script and to be honest, I dont know wether I am running things in the correct directory

I have 2 nextcloud directories which were installed when I added Nextcloud (I used an extention through plesk)

So I have a folder
This holds a number of sub folders/files such as

  • apps
  • config
  • Updater
  • lib
  • public.php
  • cron.php
  • occ

There is also a hidden folder
When I go in here, there is only one folder shown - data

So along with that, I am also concerned that my lack of knowledge will make things worse

@BenHastings I tried your script.

When I get to the line -
sudo -u www-data php '/var/www/nextcloud/occ' maintenance:mode --on (although my occ path is slightly different

I get the error shown in attached pic

I’m sorry @EazyFreight I honestly don’t get what you expect. Following post clearly show you don’t spend time to understand the issue and try some random commands you found on the internet:

The issue can’t be resolved by just resetting dates of the files or on the database, as every file within Nextcloud has one or more corresponding records in the database the correction must be done on the filesystem and database! and even more at same time

Administering complex application like Nextcloud required (basic) understanding or multiple technologies like Linux, file systems, databases, webservers, clients, certificates and more… don’t expect random people will solve your issues you you cry loud and often enough.

Please read relevant relevant threads, educate yourself on the points taken and you will tackle the problem…

I have admitted that I dont understand fully what is going on.

To be honest, I feel like this is an issue which has been caused by a bug in a nextcloud release but they seem to be taking very little ownership of the situation.

After attempting your script, I am now locked out all together but Im not sure how this happened

To be clear, did you actually run the script? Because it seems, from the screenshot, that you ran into an exception error when trying to turn on maintenance mode. That comes, if you followed the readme, before you run the script.

Before you proceed with anything, it would be good if you had absolute clarity about where your stuff is at.

  • The Nextcloud installation directory should be indicated in the webserver’s configuration file. For instance, on my system, I have a configuration file /etc/apache2/sites-enabled/000-default-le-ssl.conf. In this file, the line

<Directory /var/www/nextcloud>

tells me, my Nextcloud is there: /var/www/nextcloud

  • Now for the Nextcloud data directory (the files stored on Nextcloud), I can go to /var/www/nextcloud/config/config.php and there is see

'datadirectory' => '/media/owncloud_storage/data',

Now I know, where my data is at.

Perhaps you can find that out for your system, and then re-trace your steps and make sure you ran the occ command in the right directory.

If you did run the script however, it should not cause what is shown in the screenshot. The script does not do anything in the Nextcloud configuration file. It doesn’t ‘know’ where the installation directory is. And it only reads from the DB. It doesn’t write to it. It should not cause configuration issues.

1 Like