Every Nextcloud admin has been confronted with this warning sooner or later and is then always busy searching and checking again to find and eliminate the causes.
The → search function of the forum ← shows that this problem is as old as Nextcloud itself. There are so many results (well over 500) that it is even recommended to restrict the searchquery string .
To solve this problem once and for all times - at least for such instances that have full access to the server files (no containerized solutions like Docker, AIO etc) - I created this script with → ebtb ← .
Explanation:
- the first line downloads the script into the directory /usr/local/bin
- the second line makes it executable
You only need to install it once.
As all of my → ebtb ← scripts, it comes signed and does an integrity check on the first run and checks for updates on every startup.
Simply run it:
nc-integrity-fix
I really hope that this tool will make your life easier and save you a lot of searching and time in future.
You’re a life saver!!! I was just about to cut my loses and spin up a new LXC for Nextcloud when I saw your post. I was able to successfully resolve all of my integrity checks.
Thank you for the appreciative words! That means a lot to me, as you obviously looked at the code yourself.
Your blog post encourages me to continue developing and maintaining my scripts.
Hello ernolf,
thanks for your script, but I receive the following message:
root@5d2365650c3f:/usr/local/bin# nc-integrity-fix
… loading modules - dependency/dev/fd/63: line 43: dpkg: command not found
/dev/fd/63: line 43: dpkg: command not found
Dependency not met!
missing dependencies:
Binary Package Description
gpg gnupg GNU Privacy Guard
xmlstarlet xmlstarlet Command line XML toolkit
please install first
I am on a linixserver-nextcloud image 29.X
Pls advice what to do?
regards
Alex
Could you please explain more in deep what that is. I do not know that image. Is it a containerized solution?
The script is designed for and on debian based distributions with dpkg.
Since you have not installed xmlstarlet, it tries to offer you, to install it with apt-get, wich is an interface to dpkg, which fails.
You should install
xmlstarlet
with the package manager of your system and try again.
Please give me feedback if that solves it for you and maybe some more information about your OS, maybe I can implement support for it, so that future users of the script can benefit from your feedback.
Hi you both,
thanks. I do undestand that the script is made for Debian with dpkg. I am on an alpine based linux container. That’s ok.
I will check some of your other scripts, ernolf.
regards
Alex
You are absolutely right. The Image developer should take care of things related to Nextcloud and underlying linux Distribution.
Anyway, many thanks to your time and Engagement here. I‘ve seen some interesting scripts and comments from you in the Forum.
Regards
Broxel
Hello, thank you for this script. I ran about five iterations of this, which removed many files. Now each successive iteration returns the following:
Q: Do you want to remove these needless file? ([y]es or [n]o) [yes]:
rm: cannot remove ‘/var/www/nextcloud/dlib/docs/docs/chm/READ’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/THE’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/README.’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/DO’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/NOT’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/EDIT’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/THE’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/TABLE’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/OF’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/CONTENTS’: No such file or directory
rm: cannot remove ‘/var/www/nextcloud/FILE3’: No such file or directory
This exception was detected for [files_mindmap]:
Certificate is not valid.
This script cannot resolve integrity violations of type ‘EXCEPTION’.
I resolved this by running
rm -rf /var/www/nextcloud/dlib/docs/docs/chm/
Additionally, dlib had come up often in this scan since long ago I had manually installed the ‘face recognition’ app. Those directories were owned by root. After fixing permissions on those directories (setting www-data as owner) the integrity check passed. Thanks again!
Hey ernolf
great work with all your scripts. I really like them
One question - as I was looking for the error mentioned above:
This exception was detected for [files_mindmap]:
Certificate is not valid.
This script cannot resolve integrity violations of type ‘EXCEPTION’.
… did you also run into that problem and how did you resolve it?
Finally this thing doesn’t cause any problems - nextcloud itself is running fine and also mindmap doesn’t show any problems - so I guess it could also be ignored till a new version with a valid certificate is published.
That’s exactly how it is. Certificates can only be corrected by the app developers themselves. It is a hint that shows that there is something wrong or incorrect with the certificate and such an error cannot simply be corrected by an “external” script.
As long as you understand why this is the case, there is no need to worry about it.