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

Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given #23158

Closed
sbryf opened this issue Mar 11, 2016 · 24 comments

Comments

@sbryf
Copy link

sbryf commented Mar 11, 2016

Hi there,

I am getting the following error in the log:

Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in /core/application.php on line 90 and defined at /core/avatar/avatarcontroller.php#86

OwnCloud 8.2.3
Encryption on
Shared webhoster
PHP 5.5.28

Any idea how to fix that? Seems to be related to $c->query('UserFolder'), right?

Thanks.

@LukasReschke
Copy link
Member

Can you please fill out the whole issue template? Thanks a lot.

@PVince81
Copy link
Contributor

@rullzer

@rullzer
Copy link
Contributor

rullzer commented Mar 14, 2016

Seems to be related to $c->query('UserFolder'), right?

Yes but I don't see how that would break all of a sudden.

@sbryf can you fill out the whole issue template?

@sbryf
Copy link
Author

sbryf commented Mar 16, 2016

Steps to reproduce

Not sure how to reproduce this. Happens straight after I login - I am getting three error messages in the log regarding this with same content. Same when I switch to Profile or Admin - 2 error messages in the log.

Expected behaviour

No error message

Actual behaviour

Error message raised

Server configuration

Operating system: Webhoster - domainfactory

Web server: Apache

Database: MySQL 5.6.19

PHP version: 5.5.28

ownCloud version: 8.2.3

Updated from an older ownCloud or fresh install: fresh install

Where did you install ownCloud from: web installer

Signing status (ownCloud 9.0 and above): n/a

List of activated apps:

Activity
Default encryption module
Deleted files
First Run Wizard
Gallery
Mail Template Editor
Notifications
PDF Viewer
Provisioning API
Share Files
Text Editor
Updater
Versions
Video Viewer

The content of config/config.php:

'...', 'passwordsalt' => '...', 'secret' => '...', 'trusted_domains' => array ( 0 => '...' ), 'datadirectory' => '.../data', 'overwrite.cli.url' => '...', 'dbtype' => 'mysql', 'version' => '8.2.3.2', 'dbname' => '...', 'dbhost' => '...', 'dbtableprefix' => 'oc_', 'dbuser' => '...', 'dbpassword' => '...', 'logtimezone' => 'UTC', 'installed' => true, 'mail_from_address' => 'noreply', 'mail_smtpmode' => 'php', 'mail_domain' => '...', 'loglevel' => 1, ); **Are you using external storage, if yes which one:** n/a **Are you using encryption:** yes **Are you using an external user-backend, if yes which one:** n/a ### Client configuration **Browser:** Latest Chrome **Operating system:** Windows 10 ### Logs #### Web server error log n/a #### ownCloud log (data/owncloud.log) {"reqId":"Vukjf38AAAEAABCDOc8AAAAM","remoteAddr":"...","app":"PHP","message":"Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in .../core\/application.php on line 90 and defined at .../core\/avatar\/avatarcontroller.php#86","level":3,"time":"2016-03-16T09:12:31+00:00"} {"reqId":"VukjgX8AAAEAABB3SUEAAAAA","remoteAddr":"...","app":"PHP","message":"Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in .../core\/application.php on line 90 and defined at .../core\/avatar\/avatarcontroller.php#86","level":3,"time":"2016-03-16T09:12:33+00:00"} {"reqId":"Vukjhn8AAAEAABCPh-QAAAAY","remoteAddr":"...","app":"PHP","message":"Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in .../core\/application.php on line 90 and defined at .../core\/avatar\/avatarcontroller.php#86","level":3,"time":"2016-03-16T09:12:38+00:00"} {"reqId":"VukkGn8AAAEAABCI714AAAAR","remoteAddr":"...","app":"PHP","message":"Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in .../core\/application.php on line 90 and defined at .../core\/avatar\/avatarcontroller.php#86","level":3,"time":"2016-03-16T09:15:06+00:00"} {"reqId":"VukkHH8AAAEAABCo1bYAAAAf","remoteAddr":"...","app":"PHP","message":"Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in .../core\/application.php on line 90 and defined at .../core\/avatar\/avatarcontroller.php#86","level":3,"time":"2016-03-16T09:15:08+00:00"} {"reqId":"VuklHH8AAAEAABCtn4YAAAAi","remoteAddr":"...","app":"PHP","message":"Argument 8 passed to OC\Core\Avatar\AvatarController::__construct() must be an instance of OCP\Files\Folder, null given, called in .../core\/application.php on line 90 and defined at .../core\/avatar\/avatarcontroller.php#86","level":3,"time":"2016-03-16T09:19:25+00:00"} {"reqId":"VuklLn8AAAEAABDFrdkAAAAs","remoteAddr":"...","app":"PHP","message":"Cannot modify header information - headers already sent by (output started at .../lib\/private\/template\/functions.php:1) at .../lib\/private\/appframework\/http\/output.php#60","level":3,"time":"2016-03-16T09:19:42+00:00"} {"reqId":"VuklLn8AAAEAABDFrdkAAAAs","remoteAddr":"...","app":"PHP","message":"Cannot modify header information - headers already sent by (output started at .../lib\/private\/template\/functions.php:1) at .../lib\/private\/appframework\/http\/output.php#60","level":3,"time":"2016-03-16T09:19:42+00:00"} {"reqId":"VuklLn8AAAEAABDFrdkAAAAs","remoteAddr":"...","app":"PHP","message":"Cannot modify header information - headers already sent by (output started at .../lib\/private\/template\/functions.php:1) at .../lib\/private\/appframework\/http\/output.php#60","level":3,"time":"2016-03-16T09:19:42+00:00"} {"reqId":"VuklLn8AAAEAABDFrdkAAAAs","remoteAddr":"...","app":"PHP","message":"Cannot modify header information - headers already sent by (output started at .../lib\/private\/template\/functions.php:1) at .../lib\/private\/appframework\/http\/output.php#60","level":3,"time":"2016-03-16T09:19:42+00:00"} #### Browser log a) The javascript console log Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block: expected semicolon at character position 14. The default protections will be applied.

@DeepDiver1975
Copy link
Member

This happens if an avatar is requested when no user is logged in afaik

@DeepDiver1975 DeepDiver1975 added this to the 9.2 milestone Aug 19, 2016
@DeepDiver1975 DeepDiver1975 self-assigned this Aug 19, 2016
@PVince81
Copy link
Contributor

Is this still happening ?

@sergeyun
Copy link

yes its still happening for owncloud 9.1.4

@PVince81
Copy link
Contributor

Can someone enable XDebug and try again ? This should give a full stack trace in the logs which should help pinpoint the more precise code path leading to this error.

Does it happen for a specific user / specific avatar ? Or all users ?

@ghost
Copy link

ghost commented Apr 4, 2017

@PVince81 Noticed the same here today on 9.1.4. My owncloud.log seems to contain way more details, is that enough to debug this further (don't want to install and enable XDebug on my productive machine).

Calling the avatar directly (e.g. http://example.com/avatar/User/32) doesn't show this issue so not quite sure how to reproduce this.

{"reqId":"UcDRfax5iK7VdCYuTn8w","remoteAddr":"xxxx","app":"index","message":"Exception: {\"Exception\":\"TypeError\",\"Message\":\"Argument 8 passed to OC\\\\Core\\\\Controller\\\\AvatarController::__construct() must implement interface OCP\\\\Files\\\\Folder, null given, called in \\\/var\\\/www\\\/owncloud\\\/core\\\/Application.php on line 96\",\"Code\":0,\"Trace\":\"

#0 \\\/var\\\/www\\\/owncloud\\\/core\\\/Application.php(96): OC\\\\Core\\\\Controller\\\\AvatarController->__construct('core', Object(OC\\\\AppFramework\\\\Http\\\\Request), Object(OC\\\\AvatarManager), Object(OC\\\\Cache\\\\File), Object(OC\\\\L10N\\\\L10N), Object(OC\\\\User\\\\Manager), Object(OC\\\\User\\\\Session), NULL, Object(OC\\\\Log))\\n
#1 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/pimple\\\/pimple\\\/src\\\/Pimple\\\/Container.php(113): OC\\\\Core\\\\Application->OC\\\\Core\\\\{closure}(Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer))\\n
#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Utility\\\/SimpleContainer.php(102): Pimple\\\\Container->offsetGet('AvatarControlle...')\\n
#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(82): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('AvatarControlle...')\\n
#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(46): OC\\\\AppFramework\\\\App::main('AvatarControlle...', 'getAvatar', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n
#5 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n
#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n
#7 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(891): OC\\\\Route\\\\Router->match('\\\/avatar\\\/User\\\/...')\\n
#8 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n
#9 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/core\\\/Controller\\\/AvatarController.php\",\"Line\":81}","level":3,"time":"2017-04-04T17:56:21+02:00","method":"GET","url":"\/avatar\/User\/32","user":"--"}
``

@PVince81
Copy link
Contributor

PVince81 commented Apr 7, 2017

In general it looks like it might be trying to use the avatar folder and for some reason it doesn't exist.
Is your data folder inside of ownCloud or outside ?

If outside, maybe the setupFS code didn't mount the user's home yet properly so the avatar code doesn't work in this specific code path.

@ghost
Copy link

ghost commented Apr 7, 2017

My data folder is located within the ownCloud installation folder /var/www/owncloud/data

@PVince81
Copy link
Contributor

How often does this happen ? Does it happen for a specific user ?

@PVince81 PVince81 modified the milestones: backlog, 10.0 Apr 20, 2017
@PVince81
Copy link
Contributor

PVince81 commented Aug 7, 2017

closing due to lack of feedback.

It is possible that it was due to a lowercase vs uppercase avatar name, which is a known issue that has been fixed in #26398

@darootler
Copy link

Can anyone repoen this ticket and describe what information is needed? See also nextcloud/polls#251

Regards
Richard

@PVince81
Copy link
Contributor

How often does this happen ? Does it happen for a specific user ?

But also, if everyone could use the issue template for their own posts, it would help cross-reference some potential environment issues

@PVince81 PVince81 reopened this Nov 23, 2017
@darootler
Copy link

Like described in nextcloud/polls#251 this error happens every time i access the newly created poll.

Regards
Richard

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label needs info is set and there were no updates for 14 days. Feel free to reopen this issue if you deem it appropriate.

@darootler
Copy link

I already descibed the issue, what infos are needed?

Regards
Richard

@ghost
Copy link

ghost commented Dec 13, 2017

@darootler See the comment in #23158 (comment) which explains what information is missing.

@ghost ghost reopened this Dec 13, 2017
@PVince81
Copy link
Contributor

Can someone try on 10.0.4 and debug this ?

@darootler
Copy link

I think all the needed information is here --> nextcloud/polls#251

If not, please just tell me what information is needed in detail.

Regards
Richard

@ghost
Copy link

ghost commented Dec 13, 2017

@darootler Please open https://github.com/owncloud/core/issues/new, copy the template from the new comment field in a new comment here and fill it out. This would be the required information needed in detail.

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

No branches or pull requests

8 participants