Skip to content

OC 6.0.2 : User storage limit don't work #7553

Closed

Description

@oooh

I installed Owncloud 6.01 with web installer (because I have a OVH shared hosting).
I created a 1MB user limited account.
I go to owncloud by firefox (tried several versions).

I upload more than 1MB. No problem. No error message.
I tried with and without encryption. Same problem.
User storage limit don't work

Activity

  1. karlitschek commented on Mar 5, 2014

    @karlitschek
    Contributor

    can you post a full bug report with a step by step documentation what you did please as described here? https://github.com/owncloud/core/blob/master/CONTRIBUTING.md

  2. oooh commented on Mar 5, 2014

    @oooh
    Author

    Yes, with the template :

    Steps to reproduce

    1.I log with my user account (limit storage is 10 MB) without SSL
    2.I upload more than 10 MB in one or more file(s).

    Expected behaviour

    I should be prevented from uploading files more than the limit storage.

    Actual behaviour

    There is no error message. No impediment to upload.

    Server configuration

    Operating system : Shared hosting Linux
    Database : base sqlite owncloud
    PHP version : 5.4.24
    ownCloud version: 6.0.1 with sqlite base
    Install : ownCloud yesterday fresh installed with web installer to my OVH shared hosting
    List of activated apps :
    -Test1 : Activity, Calendar, Contacts, Deleted files, First Run Wizard, Full text search, PDF Viewer, Pictures, Share Files, Text Editor, Versions, Video Viewer, App Framework, News
    -Test2 : Pdf viewer, Share files
    -Test3 : none
    The content of config/config.php:
    instanceid' => 'oc92fe4e2ca2',
    datadirectory' => '/www/o2/c/data',
    dbtype' => 'sqlite3',
    version' => '6.0.0.16',
    installed' => true,
    loglevel' => '0',
    Are you using external storage : no
    Are you using encryption : no (I also tried with encryption : same problem)

    Client configuration

    Browser : Firefox 18.0, firefox 23.0
    Operating system : windows xp, windows 7

    ownCloud log (data/owncloud.log)

    No change in logs when upload the big file.

  3. PVince81 commented on Mar 5, 2014

    @PVince81
    Contributor

    Are these your steps, in detail:

    1. Go to users page
    2. Change the quota of the current user to "10 MB"
    3. Go to files app
    4. Click "Upload"
    5. Pick a file that is bigger than 10 MB
    6. Watch it upload

    Or did you set the storage limit using a different mechanism ? (ex: disk quota or others)

  4. oooh commented on Mar 5, 2014

    @oooh
    Author

    You're right
    These are the right steps

  5. PVince81 commented on Mar 10, 2014

    @PVince81
    Contributor

    @oooh if you've used the web installer you might have gotten 6.0.1. There was an issue recently that the "owncloud-latest.tar.bz2" was still pointing at 6.0.1.
    You might want to try again with 6.0.2.
    Either upgrade to 6.0.2 or run the web installer from scratch.

  6. oooh commented on Mar 10, 2014

    @oooh
    Author

    I installed with web installer and tried owncloud 6.0.2 this afternoon : same problem

  7. PVince81 commented on Mar 10, 2014

    @PVince81
    Contributor

    Ok, let's try something with:
    Please open the files app in the browser, then open the developer console (press F12).
    In the "console" section you should be able to type this Javascript code:

    $('#max_upload').val()
    

    Please post its output here.

    Also, when you hover on the "upload" button, what value appears in the tooltip behind "Upload max." ?

    When you go to the "Personal" page, what storage values appear ?

    Edit: requested values were wrong

  8. oooh commented on Mar 10, 2014

    @oooh
    Author

    -Sorry. I thought I installed 6.0.2 version but I now see it 's 6.0.1 which was installed with web installer this afternoon. And the update option in the admin part don't work.

    -The tooltip behind upload button is 64MB

    -In the firefox Javascript developer console, $('#max_upload').val() returns "67108864"

    -In my "Personal" page, the storage values are : "Vous avez utilisé 10.4 MB des ? disponibles"
    "?" is already wrote in owncloud...
    Admin account is in illimited storage. it's same.

  9. PVince81 commented on Mar 10, 2014

    @PVince81
    Contributor

    Hmmm... it looks like ownCloud is having trouble determining how much space your hosters is allowing. Some hosters prevent this.

    Still, if you set a quota for a user you should see "10.4 MB of 64MB" if 64MB is the quota value.

    Is the web installer still delivering version 6.0.1 ? 😦

  10. oooh commented on Mar 10, 2014

    @oooh
    Author

    -Finally, I searched in web and found in http://open-freax.fr/owncloud-6-mutu-ovh/ a modification in /lib/private/files/storage/local.php file of the call of @disk_free_space for OVH shared hosting.
    Onwcloud find 100 GB storage and the limit storage works!

    -Yes, web installer still deliver 6.0.1 version...

    Thank you for help!

  11. PVince81 commented on Mar 10, 2014

    @PVince81
    Contributor

    @oooh ok thanks for the update.

    Let's keep this open to investigate why that change is needed at all. I'd expect ownCloud to be able to work correctly with quotas even when the total free space isn't known.

  12. PVince81 commented on Mar 13, 2014

    @PVince81
    Contributor

    Just had a look at the linked article, it looks like they are providing a custom implementation to get the free space. Interesting. I think at some point we should make it possible make the free_space retrievable through a proxy/hook. This would make it possible to write apps to cover these special cases like for OVH. (CC @schiesbn @icewind1991 )

    @icewind1991 was there a reason why we didn't add the "@" to disk_free_space in the first place ?

  13. icewind1991 commented on Mar 13, 2014

    @icewind1991
    Contributor

    Apps can overwrite the free_space implementation by using a storage wrapper.

    myapp/ohvwrapper.php:

    class OHVWrapper extends \OC\Files\Storage\Wrapper\Wrapper {
        function free_space($path) {
            try{
                $soap = new SoapClient("https://www.ovh.com/soapi/soapi-re-1.35.wsdl");
                $session = $soap->login("xxxxxxx-ovh", "xxxxxxxx","fr", false);
                $result = $soap->hostingSummary($session, "mon-domaine.fr");
                $soap->logout($session);
    
                return ((($result->maxWebspace / 1000) * 1024 * 1024 * 1024) - $result->webspace);
            } catch(SoapFault $fault){
                return 0;
            }
        }
    }

    myapp/appinfo/app.php:

    \OC\Files\Filesystem::addStorageWrapper(function($mountPoint, $storage){
        if ($storage->isLocal()) {
            return new OHVWrapper(array('storage'=>$storage));
        } else {
            return $storage;
        }
    }
  14. PVince81 commented on Mar 19, 2014

    @PVince81
    Contributor

    There is indeed an issue: when free space is unknown, the quota value is discarded...
    I'm working on a fix.

  15. locked as resolved and limited conversation to collaborators on Aug 18, 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