Public upload: Call to a member function getQuota() on null in lib/private/util.php on line 289 #24751

wdj-ac opened this Issue May 20, 2016 · 6 comments


None yet

5 participants

wdj-ac commented May 20, 2016

Steps to reproduce

  1. Allow public uploads in administrator options
  2. Share a folder as link with "Allow editing"
  3. Browse to shared link
  4. Try to upload a file

Expected behaviour

Files successfully uploaded.

Actual behaviour

Upload error message:
"Fehler beim Hochladen: "xyz.pdf": Internal Server Error

Server configuration

Operating system:
Debian Jessie
Web server:
mysql Ver 14.14 Distrib 5.5.49
PHP version:
PHP 5.6.20-0+deb8u1 (cli)
ownCloud version: (see ownCloud admin page)
ownCloud 9.0.2 (stable)
Updated from an older ownCloud or fresh install:
Updated from 9.0
Where did you install ownCloud from:
Signing status (ownCloud 9.0 and above):

No errors have been found.

List of activated apps:

  - activity: 2.2.1
  - comments: 0.2
  - dav: 0.1.6
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_pdfviewer: 0.8.1
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
  - encryption
  - external
  - files_external
  - user_external
  - user_ldap

The content of config/config.php:

    "system": {
        "updatechecker": false,
        "instanceid": "ocm7tfuygjh0",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
        "datadirectory": "\/media\/owncloud\/data",
        "overwrite.cli.url": "https:\/\/",
        "dbtype": "mysql",
        "version": "",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "quota_include_external_storage": true,
        "asset-pipeline.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_from_address": "hello",
        "mail_smtpmode": "php",
        "mail_domain": "",
        "loglevel": 1,
        "theme": "",
        "maintenance": false

Are you using external storage, if yes which one:
Are you using encryption:
Are you using an external user-backend, if yes which one: no


Web server error log

2016/05/20 20:12:16 [error] 718#718: *20042 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function getQuota() on null in /var/www/owncloud/lib/private/util.php on line 289" while reading response header from upstream, client: XXXXXX, server:, request: "POST /index.php/apps/files/ajax/upload.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/", host: ""

ownCloud log (data/owncloud.log)

nothing abut this

Browser log

console log
POST 500 (Internal Server Error)

I can see how the error could come up code-wise, but I can not reproduce the issue locally.

wdj-ac commented May 23, 2016

@nickvergessen okay what informations do you need?
My first thought was the datadirectory, because its an external mounted storage ("Storage Box"). On the other hand there are no problems with permissions an ownership.

tridoan commented Jul 14, 2016 edited

I too am having this same issue, same reproduce steps as original post. Let me know if you need more info, but i think everything in the post is pretty much what i followed.

Edit: im not using external storage

alcor231 commented Jul 27, 2016 edited

I have not exactly the same, but I a very similar and (I believe) related issue.
I have shared folders and files between users, and while the original owner of a file/folder can upload files, the user that the files/folders have been shared with can't.
I am (seemingly randomly, but I'm not 100% sure on that yet) either an "Internal Server Error" or an error message saying "Insufficient Storage", with both users being far from their limit and more than 1 TB of HDD space available on the server.

I then tried to set the storage space limit of the original owner of a shared folder to unlimited, and now the user that the folder was shared to was suddenly able to upload files to that shared folder again.
As I'm just running a small server that is almost only for my personal use I can use this as a workaround, however this leads me to believe that there might be some sort of bug in the quota feature. (I tried re-setting a quota after setting it to unlimited and the bug re-appeared)

I have recently updated to OC 9.1, but I'm not sure if the problem started with the update (I suppose it could also be a database issue in that case?) or if it was unrelated to the update.

wdj-ac commented Jul 27, 2016

I also recently updated to 9.1, but even with the "unlimited" workaround the same error occurs.

alcor231 commented Jul 29, 2016 edited

Do you get this issue with public uploads only or also with files and folders shared between users?

I noticed that I apparently only experience problems when uploading via webdav (including the sync client) - if I am uploading something to (publicly or between users) shared folders via the browser I have no problems.
So maybe these are two different (but maybe related?) issues after all.

@DeepDiver1975 DeepDiver1975 added a commit that referenced this issue Jul 29, 2016
@DeepDiver1975 DeepDiver1975 Ensure the user exists before calling a method on it - fixes #24751 e6431cc
@DeepDiver1975 DeepDiver1975 added this to the 9.2 milestone Jul 29, 2016
@PVince81 PVince81 closed this in #25652 Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment