Skip to content

File cannot be shared via link (permalink) if file was renamed #1382

Closed

Description

@herr-lehmann

We are sharing a folder with mulitple users and all works fine with sync clients.
When we try to access files by the share link, we get sometimes a 404.
This only happens when we try to share a file that was renamed and then shared via link. We also found out that it does not help if we rename the file.

Here are three experiments that we tried to narrow done the cause of the issue:

Experiment 1: Causes the bug

  1. Upload a file via web interface (into a shared folder)
  2. rename the newly uploaded file
  3. share the file by link

This results in a 404.

Experiment 2: Without renaming

These steps lead to working link (same directory, same user, same file)

  1. Upload the file via web interface (again a shared folder)
  2. share file by link

This results in a working link.

Experiment 3: In a not shared folder

Last setup: like the first experiment but not within a shared folder

  1. Upload a file via web interface (into a NOT shared folder)
  2. rename the uploaded file
  3. share file by link

Result: All good, everything works as expected.

What else do you need to reproduce this issue?

Activity

  1. schiessle commented on Feb 15, 2013

    @schiessle
    Contributor

    Thanks for the detailed report. I can reproduce it now.

    It seems like during the rename process both the file system cache and the oc_share table doesn't get updated correctly with the new file name. This causes the problem you described above.
    Further, if the owner of the file logs into his ownCloud his file cache will be updated (because the physical file was renamed correctly). This means that ownCloud will assume that the original file was deleted and that the file with the new name is a completely new file. This will also result in a lose of all shares defined for the original file before the rename action took place.

    I have to check if this can be solved with the file cache we use in OC4.5.

    We should also make sure that this problem doesn't happen in OC5 with the new file cache!

    cc @icewind1991 @MTGap

  2. sruslanas commented on Mar 5, 2013

    @sruslanas

    Is this fixed in ownCloud 4.5.7 ?

  3. perryflynn commented on Mar 16, 2013

    @perryflynn

    No, i have the same issue with OC 5.

    Message in Error Log:
    fopen(/www/htdocs/cloud/data/christian/files/Pi/p) [function.fopen]: failed to open stream: No such file or directory at /www/htdocs//cloud/lib/files/storage/local.php#143
    filemtime() [function.filemtime]: stat failed for /www/htdocs/cloud/data/christian/files/RaspberryPi at /www/htdocs/cloud/lib/files/storage/local.php#92

    The file name is not "p". Its "pibox.png",
    The file name is truncated.

  4. Lupuz23 commented on Mar 16, 2013

    @Lupuz23

    Same problem here OC 5.

    Message in Log:

    fopen(/var/www/owncloud/data/admin/files/Akcie/!pomocne_vypocty_bilancie/C): failed to open stream: No such file or directory at /var/www/owncloud/lib/files/storage/local.php#143

    file is Calculation.xls

  5. MTGap commented on Mar 16, 2013

    @MTGap
    Contributor

    @sim4000 @lupus-yonderboy That's a different problem and is already resolved #2291 #2249

    Please use the search.

  6. MTGap commented on Mar 17, 2013

    @MTGap
    Contributor

    This is fixed in #2204 and should have been included in the release. Sorry about that.

  7. MTGap commented on Apr 8, 2013

    @MTGap
    Contributor

    Closing and moving discussion to #2170 because it isn't just links.

  8. locked as resolved and limited conversation to collaborators on Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions