core icon indicating copy to clipboard operation
core copied to clipboard

A file can not be deleted after renaming two folder with similar names

Open purigarcia opened this issue 13 years ago • 9 comments

Expected behaviour

File should be deleted on the server and in the device

Actual behaviour

  1. Using an iOS device, if you browse up and then go inside "testx" again, the deleted file is shown again
  2. In the server the file is not deleted. If you try to download it, an alert saying "The requested content cannot be loaded. Please try again later." is shown

Steps to reproduce

Using an iOS Device, follow this steps

  1. Create two folders: "test" and "testX"
  2. Upload several files in each folder
  3. Rename folder "test" as "testx"
  4. Rename folder "testX" as "test"
  5. Go inside folder "testx" and delete a file

Server configuration

Operating system: MacOs 10.7.5

Database: SQLite 3

ownCloud version: 5.0.11 RC2

Browser: Chrome

Web server error log

Warning PHP filemtime(): stat failed for /srv/www/htdocs/owncloud/data/pgarcia/files/testx/Photo-09-09-13-12-16-54-0.PNG at /srv/www/htdocs/owncloud/lib/files/storage/local.php#92 2013-09-09T10:18:20+00:00

Warning PHP copy(/srv/www/htdocs/owncloud/data/pgarcia/files/testx/Photo-09-09-13-12-16-54-0.PNG): failed to open stream: No such file or directory at /srv/www/htdocs/owncloud/lib/files/storage/local.php#143 2013-09-09T10:18:20+00:00

Warning PHP filesize(): stat failed for /srv/www/htdocs/owncloud/data/pgarcia/files/testx/Photo-09-09-13-12-16-54-0.PNG at /srv/www/htdocs/owncloud/lib/files/storage/local.php#74 2013-09-09T10:18:20+00:00

purigarcia avatar Sep 09 '13 10:09 purigarcia

Weird. Do you still see it with 5.0.13 ? Does it only happen when doing this on an iOS device ?

PVince81 avatar Nov 11 '13 10:11 PVince81

I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.

Please reopen if you still encounter this issue with the latest stable version and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

jancborchardt avatar Feb 26 '14 11:02 jancborchardt

I reopen because it is still happening. It happens doing the steps in the website, there is not need to use an ios device. To make it more clear, I explain it better below

Steps to reproduce

Using the web

  1. Create two folders: "test" and "testX"
  2. Upload several files in each folder
  3. Rename folder "test" as "testx"
  4. Rename folder "testX" as "test"
  5. Go inside folder "testx" and delete a file
  6. Go to root
  7. Access to "tests" again

Expected behaviour

File should be deleted on the server and in the device

Actual behaviour

File is shown again and the rest of files are duplicated. And although going to root, and accessing again to the folder it is still happening. When clicking in the just deleted file, it's not possible to preview it

Server configuration

Using the latest stable version in daily instance ownCloud version: {"installed":"true","version":"6.90.0.2","versionstring":"7.0 pre alpha","edition":""}

Client configuration

Browser: Chrome Operating system: MacOs X 10.7.5

Web server error log

I don't see any interesting logs related to the issue

purigarcia avatar Apr 09 '14 09:04 purigarcia

Indeed, I was able to reproduce this. Very strange.

PVince81 avatar Apr 30 '14 09:04 PVince81

@purigarcia was your second test also with SQLite ? I know that MySQL has trouble with file name casing, but if that also happens with SQLite then it is probably not related.

PVince81 avatar Apr 30 '14 09:04 PVince81

I tried again with SQLite and the issue also exists there.

PVince81 avatar Apr 30 '14 09:04 PVince81

The issue doesn't appear for PostgreSQL. It means it could still be related to case insensitive queries.

PVince81 avatar Apr 30 '14 09:04 PVince81

On MySQL, after the rename, the table looks like this:

+--------+---------+-------------------------+----------------------------------+--------+--------------+----------+----------+---------+------------+---------------+-----------+------------------+---------------+
| fileid | storage | path                    | path_hash                        | parent | name         | mimetype | mimepart | size    | mtime      | storage_mtime | encrypted | unencrypted_size | etag          |
+--------+---------+-------------------------+----------------------------------+--------+--------------+----------+----------+---------+------------+---------------+-----------+------------------+---------------+
|      1 |       1 |                         | d41d8cd98f00b204e9800998ecf8427e |     -1 |              |        2 |        1 |     163 | 1398851049 |    1398850569 |         0 |                0 | 5360c5e9d8c1d |
|      2 |       1 | files                   | 45b963397aa40d4a0063e0d85e4fe7a1 |      1 | files        |        2 |        1 | 7207218 | 1398851049 |    1398851049 |         0 |                0 | 5360c5e9d7e70 |
|      3 |       1 | files/welcome.txt       | c49a144e772727f51b75705170e88a43 |      2 | welcome.txt  |        4 |        3 |     163 | 1398850569 |    1398850569 |         0 |                0 | 5360c409f3c5d |
|      4 |       1 | cache                   | 0fea6a13c52b4d4725368f24b045ca84 |      1 | cache        |        2 |        1 |       0 | 1398850569 |    1398850569 |         0 |                0 | 5360c40b6accc |
|      5 |       1 | files/testx             | ac6865da07598a97abc7fc32d9596005 |      2 | testx        |        2 |        1 | 1849426 | 1398851036 |    1398851036 |         0 |                0 | 5360c5dc6f541 |
|      6 |       1 | files/test              | d9da358780951c01e7388fcaa673ba64 |      2 | test         |        2 |        1 | 5357629 | 1398851042 |    1398851042 |         0 |                0 | 5360c5e3000be |
|      7 |       1 | files/test/IMAG0156.jpg | 017a6861294f768341f795b308cdea80 |      5 | IMAG0156.jpg |        6 |        5 |  973445 | 1398851035 |    1398851035 |         0 |                0 | 5360c5dbd5401 |
|      8 |       1 | files/test/IMAG0279.jpg | 285ced9ea8c4713e8c404f5725f37c39 |      5 | IMAG0279.jpg |        6 |        5 |  875981 | 1398851036 |    1398851036 |         0 |                0 | 5360c5dc68eb5 |
|      9 |       1 | files/test/P1050979.JPG | 46a1f44c63438283d49ab1870ed6b1ed |      6 | P1050979.JPG |        6 |        5 | 2664399 | 1398851042 |    1398851042 |         0 |                0 | 5360c5e26a546 |
|     10 |       1 | files/test/P1050980.JPG | 09b1234f2adfbc659b560975903cccd7 |      6 | P1050980.JPG |        6 |        5 | 2693230 | 1398851042 |    1398851042 |         0 |                0 | 5360c5e2ee85e |
+--------+---------+-------------------------+----------------------------------+--------+--------------+----------+----------+---------+------------+---------------+-----------+------------------+---------------+

CC @icewind1991 pretty sure it's the collation issue: https://github.com/owncloud/core/issues/6850

PVince81 avatar Apr 30 '14 09:04 PVince81

Closing in favor of #6850 After the PR of that ticket is merged, the next update will fix the database collasion and then renaming should work properly.

PVince81 avatar Jul 08 '14 07:07 PVince81