Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function getFileInfo() on a non-object #11584

Closed
hanspansen opened this issue Oct 14, 2014 · 15 comments
Closed

Call to a member function getFileInfo() on a non-object #11584

hanspansen opened this issue Oct 14, 2014 · 15 comments
Labels
Milestone

Comments

@hanspansen
Copy link

Steps to reproduce

  1. After update to 7.0.2.3 (daily 2014-10-14) ownCloud Client did not work (server not available)
  2. SOME (!!!) WebDAV clients did not work (e.g. iFiles on iPhone)
    3.

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Server configuration

Operating system: Amazon Linux 2013.09

Web server: Apache 2.2.26

Database: MySQL 5.6.16

PHP version: 5.3.28

ownCloud version: 7.0.2.3 (daily 2014-10-14)

Updated from an older ownCloud or fresh install: Updated from 7.0.2 stable/official

List of activated apps: standard

The content of config/config.php: standard

Are you using external storage, if yes which one: Dropbox, GoogleDrive, WebDAV - preconfigured (but (still) not working) S3

Are you using encryption: no

Client configuration

Browser: irrelevant, same effect on all tested browsers and WebDAV clients.

Operating system: irrelevant, same effect on all tested browsers and WebDAV clients.

Logs

Web server error log

[Tue Oct 14 21:11:30 2014] [error] [client 213.209.77.185] PHP Fatal error: Call to a member function getFileInfo() on a non-object in /var/www/vhosts/owncloud/apps/files/appinfo/remote.php on line 50

ownCloud log (data/owncloud.log)

{"app":"PHP","message":"Illegal offset type in isset or empty at /var/www/vhosts/owncloud/lib/private/app.php#138","level":3,"time":"2014-10-14T20:42:39+00:00"}
{"app":"PHP","message":"Call to a member function getFileInfo() on a non-object at /var/www/vhosts/owncloud/apps/files/appinfo/remote.php#49","level":3,"time":"2014-10-14T20:42:48+00:00"}
...
{"app":"PHP","message":"Call to a member function getFileInfo() on a non-object at /var/www/vhosts/owncloud/apps/files/appinfo/remote.php#50","level":3,"time":"2014-10-14T21:11:30+00:00"}

@karlitschek
Copy link
Contributor

@icewind1991

@PVince81
Copy link
Contributor

@hanspansen can you run the following SQL query:
select * from oc_appconfig where appid='files'

The first error in the log seems to imply that for some reason the files app has no "type" field.

@hanspansen
Copy link
Author

+-------+-------------------+-------------+
| appid | configkey         | configvalue |
+-------+-------------------+-------------+
| files | enabled           | yes         |
| files | installed_version | 1.1.9       |
| files | types             | filesystem  |
+-------+-------------------+-------------+

In deed it has NOT! ;) It's called "typeS<<<"

By the way, using Apache 2.4 and PHP 5.5 let disappear the getFileInfo error, but WebDAV still do not work.

@PVince81
Copy link
Contributor

Please apply this patch to resolve the first issue: #11634

Then let us know whether the FileInfo issue still appears, which might be another issue.

@actyler555
Copy link

Hello everyone, I posed the below question to my "go to" ownCloud resource and he referred me here. I am a real beginner, be gentle.. I wanted to make sure that this patch addresses the issue I describe? If so, what are the steps to apply this patch? I'm running Ubuntu server 14.04, Apache 2.4.7, and MySQL 5.5.40

Wanted to let you know that I upgraded to the 7.0.3 RC1 release and things seemed to go well at first.  I noticed that installed Windows clients are throwing this error though:
An internal error number 1060 happened. 500 internal server error.

I pulled the PHP error log and I am seeing multiple entries for:

[Sun Oct 19 11:51:21.627062 2014] [:error] [pid 5676] [client 10.10.1.183:56633] PHP Fatal error:  Call to a member function getFileInfo() on a non-object in /var/www/owncloud/apps/files/appinfo/remote.php on line 49
[Sun Oct 19 11:51:31.353196 2014] [:error] [pid 5669] [client 10.10.10.204:49223] PHP Fatal error:  Call to a member function getFileInfo() on a non-object in /var/www/owncloud/apps/files/appinfo/remote.php on line 49
[Sun Oct 19 11:51:31.957035 2014] [:error] [pid 5679] [client 10.10.10.204:49224] PHP Fatal error:  Call to a member function getFileInfo() on a non-object in /var/www/owncloud/apps/files/appinfo/remote.php on line 49


Easy fix?  Should I post a separate issue?

Regards,
Adam Tyler

@PVince81
Copy link
Contributor

@actyler555 has confirmed that the patch did not fix getFileInfo(), so the issue is something different.

@PVince81
Copy link
Contributor

@icewind1991 can you take care of this ?
Possibly a loading order issue, for some reason \OC\Files\Filesystem::getView() returns null.

@icewind1991
Copy link
Contributor

#11091 makes some improvements to the loading of the filesystem.

@actyler555 or @hanspansen can you try if that solves the issue

@actyler555
Copy link

Thanks for your response Robin. You’ll have to forgive me, total noob here. Vincent gave me these instructions for downloading suggested patches:

If it is the same process for installing your suggested update, can you give me the https:// URL like below? Tried clicking in the post and got: https://github.com/owncloud/core/pull/11091/files.. Doesn’t look right to me.

-Adam


Steps:
1. Grab the commit that fixes it, it's above: 9998861<https://github.com/owncloud/core/commit/9998861402d9b16e2e7d8ebd9382633fc91a5dae>
2. Open the link in new tab: 9998861<https://github.com/owncloud/core/commit/9998861402d9b16e2e7d8ebd9382633fc91a5dae>
3. Append ".patch": https://github.com/owncloud/core/commit/9998861402d9b16e2e7d8ebd9382633fc91a5dae.patch
4. Save file as: "theawesomepatch.patch"
5. Put the patch file inside your owncloud folder, for example "/var/www/owncloud"
6. Start a shell in "/var/www/owncloud"
7. Run the command patch -p1 < theawesomepatch.patch

This will apply the patch to your install.
If you get an error message, abort with Ctrl+C (maybe something wasn't right)
If everything worked well you should see no error message.
Let me know if that worked

From: Robin Appelman [mailto:notifications@github.com]
Sent: Tuesday, October 21, 2014 7:06 AM
To: owncloud/core
Cc: Adam Tyler
Subject: Re: [core] Call to a member function getFileInfo() on a non-object (#11584)


#11091<https://github.com/owncloud/core/pull/11091> makes some improvements to the loading of the filesystem.

@actyler555<https://github.com/actyler555> or @hanspansen<https://github.com/hanspansen> can you try if that solves the issue

—
Reply to this email directly or view it on GitHub<https://github.com/owncloud/core/issues/11584#issuecomment-59932341>.

________________________________

IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should contact the sender and delete the message. Any unauthorized disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature. This email may be privileged and protected under applicable law as related to quality assurance.

@PVince81
Copy link
Contributor

@actyler555 looks like https://github.com/owncloud/core/pull/11091.patch (PR number + .patch) does the trick

@actyler555
Copy link

Thanks man! I will give it a go.

-Adam

From: Vincent Petry [mailto:notifications@github.com]
Sent: Tuesday, October 21, 2014 11:13 AM
To: owncloud/core
Cc: Adam Tyler
Subject: Re: [core] Call to a member function getFileInfo() on a non-object (#11584)

@actyler555https://github.com/actyler555 looks like https://github.com/owncloud/core/pull/11091.patch (PR number + .patch) does the trick


Reply to this email directly or view it on GitHubhttps://github.com//issues/11584#issuecomment-59972067.


IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should contact the sender and delete the message. Any unauthorized disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature. This email may be privileged and protected under applicable law as related to quality assurance.

@actyler555
Copy link

Hmm.. So I downloaded to the /var/www/owncloud folder and ran the patch command. Looks like there were some errors and now it is waiting for additional input of some kind. Sitting at a “File to patch:” prompt. What gets entered there?

-Adam

adminuser@OWNCLOUDSERVER:/var/www/owncloud$ sudo patch -p1 < 11091.patch
patching file apps/files/tests/ajax_rename.php
patching file apps/files_encryption/hooks/hooks.php
Hunk #1 succeeded at 245 (offset 12 lines).
patching file apps/files_encryption/lib/util.php
Hunk #2 succeeded at 1223 (offset 48 lines).
patching file apps/files_sharing/ajax/publicpreview.php
patching file apps/files_sharing/appinfo/update.php
patching file apps/files_sharing/lib/cache.php
patching file apps/files_sharing/lib/helper.php
patching file apps/files_sharing/lib/share/file.php
Hunk #1 succeeded at 69 (offset -5 lines).
patching file apps/files_sharing/lib/sharedstorage.php
patching file apps/files_sharing/lib/updater.php
patching file apps/files_trashbin/lib/trashbin.php
patching file apps/files_versions/lib/versions.php
patching file lib/private/cache/file.php
patching file lib/private/fileproxy/fileoperations.php
patching file lib/private/files/factory.php
patching file lib/private/files/filesystem.php
Hunk #1 FAILED at 30.
Hunk #2 succeeded at 166 (offset 2 lines).
Hunk #3 succeeded at 179 (offset 2 lines).
Hunk #4 succeeded at 200 (offset 2 lines).
Hunk #5 succeeded at 217 (offset 2 lines).
Hunk #6 succeeded at 234 (offset 2 lines).
Hunk #7 succeeded at 245 (offset 2 lines).
Hunk #8 succeeded at 255 (offset 2 lines).
Hunk #9 succeeded at 267 (offset 2 lines).
Hunk #10 succeeded at 277 (offset 2 lines).
Hunk #11 succeeded at 292 (offset 2 lines).
Hunk #12 succeeded at 307 (offset 2 lines).
Hunk #13 succeeded at 343 (offset 2 lines).
Hunk #14 succeeded at 356 (offset 2 lines).
Hunk #15 succeeded at 364 (offset 2 lines).
Hunk #16 succeeded at 416 (offset 2 lines).
Hunk #17 succeeded at 431 (offset 2 lines).
Hunk #18 succeeded at 571 (offset 2 lines).
Hunk #19 succeeded at 628 (offset 2 lines).
Hunk #20 succeeded at 641 (offset 2 lines).
Hunk #21 succeeded at 652 (offset 2 lines).
Hunk #22 succeeded at 664 (offset 2 lines).
Hunk #23 succeeded at 674 (offset 2 lines).
Hunk #24 succeeded at 684 (offset 2 lines).
1 out of 24 hunks FAILED -- saving rejects to file lib/private/files/filesystem.php.rej
patching file lib/private/files/mount/manager.php
patching file lib/private/files/node/root.php
patching file lib/private/files/objectstorefactory.php
patching file lib/private/files/view.php
Hunk #1 succeeded at 802 with fuzz 2 (offset -6 lines).
patching file lib/private/image.php
patching file lib/private/server.php
Hunk #1 succeeded at 68 with fuzz 2 (offset -9 lines).
Hunk #2 FAILED at 216.
Hunk #3 succeeded at 263 (offset -15 lines).
Hunk #4 succeeded at 281 (offset -15 lines).
1 out of 4 hunks FAILED -- saving rejects to file lib/private/server.php.rej
patching file lib/private/util.php
Hunk #1 FAILED at 11.
Hunk #2 FAILED at 193.
Hunk #3 FAILED at 455.
Hunk #4 FAILED at 469.
Hunk #5 FAILED at 502.
Hunk #6 FAILED at 563.
Hunk #7 FAILED at 575.
Hunk #8 FAILED at 583.
Hunk #9 FAILED at 637.
Hunk #10 succeeded at 731 (offset -2 lines).
Hunk #11 FAILED at 1001.
Hunk #12 FAILED at 1138.
11 out of 12 hunks FAILED -- saving rejects to file lib/private/util.php.rej
patching file lib/public/files/storage.php
patching file lib/public/iservercontainer.php
can't find file to patch at input line 1622
Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

|diff --git a/tests/lib/files/cache/updaterlegacy.php b/tests/lib/files/cache/updaterlegacy.php
|index c80c316..3b1e514 100644
|--- a/tests/lib/files/cache/updaterlegacy.php

|+++ b/tests/lib/files/cache/updaterlegacy.php

File to patch:

From: Vincent Petry [mailto:notifications@github.com]
Sent: Tuesday, October 21, 2014 11:13 AM
To: owncloud/core
Cc: Adam Tyler
Subject: Re: [core] Call to a member function getFileInfo() on a non-object (#11584)

@actyler555https://github.com/actyler555 looks like https://github.com/owncloud/core/pull/11091.patch (PR number + .patch) does the trick


Reply to this email directly or view it on GitHubhttps://github.com//issues/11584#issuecomment-59972067.


IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should contact the sender and delete the message. Any unauthorized disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature. This email may be privileged and protected under applicable law as related to quality assurance.

@PVince81
Copy link
Contributor

Yes... the patch only applies against master, not against stable7 or OC 7.
There are too many code differences.

@icewind1991 can you try and provide a simpler fix ?

@actyler555
Copy link

Bummer! Doesn't look like 7.0.3 RC1 is ready for prime time just yet. I was really just looking to resolve this one issue by upgrading:

owncloud-archive/apps#1947 (comment)

Any way to apply a fix for this specific issue on the current stable release of ownCloud 7?

@DeepDiver1975 DeepDiver1975 added this to the 7.0.7-next-maintenance milestone Jun 1, 2015
@DeepDiver1975
Copy link
Member

do you guys still observe this issue? thx

@lock lock bot locked as resolved and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants