Skip to content

Basic auth requests always set up the filesystem #31357

Open

Description

@nickvergessen

ToDo

  • remove support for old chunking v1 in Desktop

If a request is authenticated and does not use cookies, it will always set up the filesystem.
The reason is the post-login gc we do:

server/lib/base.php

Lines 815 to 831 in e6d9ef2

try {
$cache = new \OC\Cache\File();
$cache->gc();
} catch (\OC\ServerNotAvailableException $e) {
// not a GC exception, pass it on
throw $e;
} catch (\OC\ForbiddenException $e) {
// filesystem blocked for this request, ignore
} catch (\Exception $e) {
// a GC exception should not prevent users from using OC,
// so log the exception
\OC::$server->getLogger()->logException($e, [
'message' => 'Exception when running cache gc.',
'level' => ILogger::WARN,
'app' => 'core',
]);
}

I think it is time to move that to a proper cron job instead. It would potentially clean up chunked upload attempts but there is no need to do this with every successful login?!

Activity

  1. PVince81 commented on Aug 15, 2022

    @PVince81
    Member

    I think chunked upload cleanup already has a cron job: #30772

  2. juliusknorr commented on Nov 18, 2022

    @juliusknorr
    Member

    This seems to only cleanup parts from the very old chunking https://github.com/owncloud/core/wiki/spec%3A-big-file-chunking, mabye something we can get rid of then.

    @tobiasKaminsky can maybe check if that is still used in any way in the clients as I found at least a code occurence for desktop: https://github.com/nextcloud/desktop/blob/4135b757b9599f95376a416761ad5cf3116411a9/src/libsync/propagateuploadv1.cpp#L115 but I'd think everything is using the new chunked upload anyways

  3. juliusknorr commented on Nov 18, 2022

    @juliusknorr
    Member

    Other than that there seems to be no usage of the \OC\Cache\File class which contains the garbage collection

  4. tobiasKaminsky commented on Nov 23, 2022

    @tobiasKaminsky
    Member

    Discussed with @mgallien we will remove support with 3.7 and announce this in release notes.
    As we have our chunked uploading mechanism this is is a decent replacement.

  5. juliusknorr commented on Nov 23, 2022

    @juliusknorr
    Member

    Is this being used as a fallback only? Would it be a problem for older clients of we drop the support in server e.g. for 26?

  6. mgallien commented on Nov 24, 2022

    @mgallien
    Contributor

    Is this being used as a fallback only? Would it be a problem for older clients of we drop the support in server e.g. for 26?

    the new chunking algorithm has been released with 2.3.0 desktop client release from Mar 3, 2017
    I think it is safe to assume clients have upgraded or we can ask them to upgrade

    I mean that it should be safe to remove this deprecated code in the 26 server release

  7. tobiasKaminsky commented on Nov 25, 2022

    @tobiasKaminsky
    Member

    @mgallien once you have removed it in Desktop, please link it here, so that we have this for reference :)

  8. nickvergessen commented on Nov 25, 2022

    @nickvergessen
    MemberAuthor

    We can bump

    $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '2.0.0');
    to be sure

  9. mgallien commented on Nov 25, 2022

    @mgallien
    Contributor

    We can bump

    $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '2.0.0');

    to be sure

    see #35425
    I did it directly

  10. juliusknorr commented on Dec 5, 2022

    @juliusknorr
    Member

    Another usage is any class that injects ICache:

    $this->registerService(ICache::class, function ($c) {
    return new Cache\File();
    });
    /** @deprecated 19.0.0 */
    $this->registerDeprecatedAlias('UserCache', ICache::class);

    Might be harder to find all cases, but maybe we can actually switch this to a ArrayCache or local memory cache instance instead.

  11. 11 remaining items

  12. provokateurin commented on Jul 14, 2025

    @provokateurin
    Member

    The PR was merged with red CI and had to be reverted, so now it's #53920.

  13. provokateurin commented on Sep 2, 2025

    @provokateurin
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions