Unable to login with "No create permission for folder /avatars"


#1

Steps to reproduce
1.fresh install , login with admin , enable external user , modify the config.php with my IMAP Server
2. login with imap account

Expected behaviour
Tell us what should happen

Actual behaviour
IMAP user were unable to login , the log shows error with create avatar folder

Server configuration
Operating system:CentOS 6.6
Web server: Apache 2.2
Database: MySQL 5.1
PHP version:5.6
ownCloud version (see ownCloud admin page): 10.0.0(stable)
Updated from an older ownCloud or fresh install: fresh install
Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):
external auth wuth imap server

ownCloud configuration

I see no generate config report in admin section, here is the config.php
<?php
$CONFIG = array (
  'instanceid' => 'ockorxp22pc7',
  'passwordsalt' => 'Zc1z8/CyftNpNVigaWe0aUPK+D/EXV',
  'secret' => '99AazKcTvGOxnTKZSBisx9g4yh/ZD/E+K9REPG+VWxM2YHGe',
  "log_type" => "owncloud",
  "logfile" => "owncloud.log",
  "loglevel" => "3",
  "logdateformat" => "F d, Y H:i:s",
  'trusted_domains' =>
  array (
    0 => 'nxc.pictaf.com.tw',
  ),
  'datadirectory' => '/owncloud_data',
  'overwrite.cli.url' => 'https://nxc.pictaf.com.tw',
  'dbtype' => 'mysql',
  'version' => '10.0.0.12',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 'jtbWjm03HSOhqHOBU35CfU2P6laY+d',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_from_address' => 'oc',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'pictaf.com.tw',
  'mail_smtphost' => '192.168.70.240',
  'mail_smtpport' => '10025',
"user_backends" => array (
    0 => array (
            "class"     => "OC_User_IMAP",
            "arguments" => array (
                              0 => '{192.168.70.240:993/imap/ssl/novalidate-cert}',
                              ),
    ),
),
);

ownCloud log (data/owncloud.log)

{"reqId":"qVm7tmreR4PKd1mIlsBN","level":3,"time":"May 10, 2017 05:01:15","remoteAddr":"192.168.70.25","user":"mc","app":"index","method":"GET","url":"\index.php\apps\files\","message":"Exception: {\"**Exception\":\"OCP\Files\NotPermittedException\",\"Message\":\"No create permission for folder /avatars/d6\**",\"Code\":0,\"Trace\":\"#0 /var/www/owncloud/lib/private/AvatarManager.php(99): OC\Files\Node\Folder->newFolder('d6')\\n#1 /var/www/owncloud/lib/private/AvatarManager.php(120): OC\AvatarManager->getFolder(Object(OC\Files\Node\Folder), 'd6')\\n#2 /var/www/owncloud/lib/private/AvatarManager.php(91): OC\AvatarManager->getAvatarFolder(Object(OC\User\User))\\n#3 /var/www/owncloud/lib/private/TemplateLayout.php(101): OC\AvatarManager->getAvatar('mc')\\n#4 /var/www/owncloud/lib/private/legacy/template.php(230): OC\TemplateLayout->__construct('user', 'files')\\n#5 /var/www/owncloud/lib/public/AppFramework/Http/TemplateResponse.php(156): OC_Template->fetchPage()\\n#6 /var/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php(112): OCP\AppFramework\Http\TemplateResponse->render()\\n#7 /var/www/owncloud/lib/private/AppFramework/App.php(98): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files\Controller\ViewController), 'index')\\n#8 /var/www/owncloud/lib/private/AppFramework/Routing/RouteActionHandler.php(46): OC\AppFramework\App::main('ViewController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\\n#9 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)\\n#10 /var/www/owncloud/lib/private/Route/Router.php(299): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)\\n#11 /var/www/owncloud/lib/base.php(909): OC\Route\Router->match('/apps/files/')\\n#12 /var/www/owncloud/index.php(49): OC::handleRequest()\\n#13 {main}\",\"File\":\"/var/www/owncloud/lib/private/Files/Node/Folder.php\",\"Line\":162}"}

Integrity status for oC9+

No errors have been found.

I find a similar topic in


and I follow the step to modify avatar lines , update permission from 17 to 31 , but didnt work.


#2

I follow the steps in the link , modify the database , table oc_filecache , permissions column from 17 to 31 , and there`s some thing else in owncloud.log

{"reqId":"nngh9JUvZAtf6VUbXmtz","level":3,"time":"May 10, 2017 05:31:19","remoteAddr":"60.251.163.227","user":"mc","app":"index","method":"GET","url":"/index.php/apps/files/","message":"Exception: {\"Exception\":\"OCP\Files\NotFoundException\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 /var/www/owncloud/lib/private/Files/Node/Node.php(217): OC\Files\Node\Node->getFileInfo()\n#1 /var/www/owncloud/lib/private/Files/Node/Node.php(117): OC\Files\Node\Node->getPermissions()\n#2 /var/www/owncloud/lib/private/Files/Node/Folder.php(151): OC\Files\Node\Node->checkPermissions(4)\n#3 /var/www/owncloud/lib/private/AvatarManager.php(99): OC\Files\Node\Folder->newFolder('fd')\n#4 /var/www/owncloud/lib/private/AvatarManager.php(120): OC\AvatarManager->getFolder(Object(OC\Files\Node\Folder), 'fd')\n#5 /var/www/owncloud/lib/private/AvatarManager.php(91): OC\AvatarManager->getAvatarFolder(Object(OC\User\User))\n#6 /var/www/owncloud/lib/private/TemplateLayout.php(101): OC\AvatarManager->getAvatar('mc')\n#7 /var/www/owncloud/lib/private/legacy/template.php(230): OC\TemplateLayout->construct('user', 'files')\n#8 /var/www/owncloud/lib/public/AppFramework/Http/TemplateResponse.php(156): OC_Template->fetchPage()\n#9 /var/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php(112): OCP\AppFramework\Http\TemplateResponse->render()\n#10 /var/www/owncloud/lib/private/AppFramework/App.php(98): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files\Controller\ViewController), 'index')\n#11 /var/www/owncloud/lib/private/AppFramework/Routing/RouteActionHandler.php(46): OC\AppFramework\App::main('ViewController', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#12 [internal function]: OC\AppFramework\Routing\RouteActionHandler->invoke(Array)\n#13 /var/www/owncloud/lib/private/Route/Router.php(299): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)\n#14 /var/www/owncloud/lib/base.php(909): OC\Route\Router->match('/apps/files/')\n#15 /var/www/owncloud/index.php(49): OC::handleRequest()\n#16 {main}\",\"File\":\"/var/www/owncloud/lib/private/Files/Node/Node.php\",\"Line\":97}"}


#3

if I comment out 'datadirectory' => '/owncloud_data', use default path , there will be no error , user can login with IMAP account without error.
so maybe there`s some options must be modify if want to use own data directory ?


#4

This would mean that the data directory is placed in the root partition (side by side to the /etc, /var folders). Its very unlikely that ownCloud (or better the webservers user running ownCloud) has the permissions accessing or creating a folder there.

You should also note that you can't move the data directory after the installation without additional modifications within your database:

https://doc.owncloud.org/server/10.0/admin_manual/maintenance/manually-moving-data-folders.html


#5

I already chown the /owncloud_data to apache and chmod to u+rw , and login as apache , touch file in that folder is ok.
thanks for the hint , I will go through the first install wizard and see if the problem occur again.


#6

Depending on your environment this isn't an adequate test for this issue. Other stuff like an open_basedir in your PHP configuration, SELinux or similar might prevent your webserver to write / access this folder where the shell user is still able to access it.


#7

ok , thanks.
what if I mount /var/www/owncloud/data to a new bigger disk after install , is that ok ?