chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Documents: serious inconsistency problems when moving folders

Open jderriks opened this issue 9 years ago • 7 comments

Expected behavior / Resultado esperado / Résultat attendu

Moving folders and files should check on "move down" or "move to itself"

Actual behavior / Resultado real / Résultat réel

Folders are remover=d from filesystem but are still in database. Errors when trying to open them and errors like "inconsistency detected" when trying to delete.

Steps to reproduce / Pasos para reproducir / Étapes pour reproduire

Many cases that lead to disaster (for teachers that don't keep local backups) Testcase 1: Moving a folder in documents to the same document folder will DELETE the folder from disk but not from the database. This is the simplest test. Testcase 2: Create a folder structure documents/a/b/c and try moving documents/a to documents/a/b This will crash the website and recursively create a deep nested file structure on disk (filesystem limit).

There were more bugs with the document MOVE. I think I fixed them in the pull request.

If you want to know if your system is OK, check error-log for errors like: "/main/inc/lib/document.lib.php 1322: System inconsistency detected. The file or directory /chamilo-lms/app/courses/TEST9/document/f2 seems to have been removed from the filesystem independently from the web platform. To restore consistency, the elements using the same pa th will be removed from the database"

Users will mostly see errors like this: screen shot 2016-12-04 at 17 39 32

jderriks avatar Dec 04 '16 16:12 jderriks

Indeed that correction fix the problem. Can you provide a PR?

jmontoyaa avatar Dec 05 '16 08:12 jmontoyaa

https://github.com/chamilo/chamilo-lms/pulls

jderriks avatar Dec 05 '16 10:12 jderriks

Merged.

jmontoyaa avatar Dec 05 '16 14:12 jmontoyaa

I suppose we all agree to close this one, then?

ywarnier avatar Dec 20 '16 16:12 ywarnier

If https://github.com/chamilo/chamilo-lms/pull/1540 is pulled it will work on Windows as well.

jderriks avatar Dec 21 '16 11:12 jderriks

Oh, yes, sorry, I mistakenly thought it had already been pulled. Reviewing it, I realize something might be missing. Could you review my comment?

ywarnier avatar Dec 22 '16 00:12 ywarnier

It seems to work now. A fsck-like tool to check for consistency filesystem vs database would be a nice tool though.

jderriks avatar Apr 22 '17 13:04 jderriks