removing files from trash: Undefined index: permissions at /var/www/owncloud/lib/private/files/fileinfo.php#177 #21378

Closed
localguru opened this Issue Dec 27, 2015 · 7 comments

Projects

None yet

7 participants

@localguru

Hi,

removing files from trash results in the following, reproducible error:

Undefined index: permissions at /var/www/owncloud/lib/private/files/fileinfo.php#177

Files get successfully deleted.

file permissions:
root@server:/var/www/owncloud/data/testuser/files_trashbin/files# ls -al
insgesamt 40
drwxr-xr-x 2 www-data www-data 4096 Dez 27 21:18 .
drwxr-xr-x 5 www-data www-data 4096 Dez 27 17:42 ..
-rw-r--r-- 1 www-data www-data 29055 Dez 27 21:18 testfile.txt.d1451247492

sudo -u www-data php ./occ app:list
Enabled:

  • activity: 2.1.3
  • calendar: 0.8.1
  • contacts: 0.5.0.0
  • direct_menu: 0.5
  • files: 1.2.0
  • files_external: 0.3.0
  • files_pdfviewer: 0.7
  • files_sharing: 0.7.0
  • files_texteditor: 2.0
  • files_trashbin: 0.7.0
  • files_versions: 1.1.0
  • files_videoviewer: 0.1.3
  • firstrunwizard: 1.1
  • gallery: 14.2.0
  • provisioning_api: 0.3.0
  • templateeditor: 0.1
  • user_otp: 2.5

Disabled:

  • documents
  • encryption
  • external
  • notifications
  • ownbackup
  • storagecharts2
  • user_external
  • user_ldap

System:
Owncloud: 8.2.2 [ http://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/ ]
System: Ubuntu 14.04 LTS
Webserver: apache2 2.4.7-1ubuntu4.8
PHP: php5 5.5.9+dfsg-1ubuntu4.14
Database: mysql 5.5.46-0ubuntu0.14.04.2

Ciao
Marcus

@PVince81
Collaborator
PVince81 commented Jan 7, 2016

Not critical, it's just a warning that appears when populating the trashbin in the web UI.
Stack:

0  OC\Files\FileInfo->getPermissions() /srv/www/htdocs/owncloud/lib/private/files/fileinfo.php:177
1  OC\Files\FileInfo->offsetGet() /srv/www/htdocs/owncloud/lib/private/files/fileinfo.php:88
2  OCA\Files\Helper::formatFileInfo() /srv/www/htdocs/owncloud/apps/files_trashbin/lib/helper.php:148
3  OCA\Files_Trashbin\Helper::formatFileInfos() /srv/www/htdocs/owncloud/apps/files_trashbin/lib/helper.php:118
4  require_once()  /srv/www/htdocs/owncloud/apps/files_trashbin/ajax/list.php:44
5  __lambda_func() /srv/www/htdocs/owncloud/lib/private/route/route.php%28154%29%20:%20runtime-created%20function:1
6  call_user_func:{/srv/www/htdocs/owncloud/lib/private/route/router.php:291}() /srv/www/htdocs/owncloud/lib/private/route/router.php:291
7  OC\Route\Router->match() /srv/www/htdocs/owncloud/lib/private/route/router.php:291
8  OC::handleRequest() /srv/www/htdocs/owncloud/lib/base.php:851
9  {main}          /srv/www/htdocs/owncloud/index.php:39

Actually we are calling $entry['permissions'] = xxx, but before setting the value it seems that PHP wants to call offsetGet anyway. Maybe the workaround is simply to return the READ permission whenever the attribute is not defined.

Or another idea is to make the trashbin code actually set a permission value to all files.

@schiesbn @icewind1991

@PVince81 PVince81 added the sev3-medium label Jan 7, 2016
@PVince81 PVince81 added this to the 9.0-current milestone Jan 7, 2016
@PVince81
Collaborator
PVince81 commented Jan 7, 2016

To clarify: it is still possible to delete the files from trashbin. It's only an annoying warning that appears when displaying the list.

@icewind1991
Member

Fix is here: #21544

@localguru

#21544 doesn't fix it:

{... ,"app":"PHP","message":"Class 'OCA\Files_Trashbin\Constants' not found at /var/www/owncloud/apps/files_trashbin/lib/helper.php#95","level":3,"time":"2016-01-10T21:42:55+01:00"}

@PVince81
Collaborator

That's even worse. @icewind1991

@PVince81
Collaborator

@localguru how did you patch it ? Maybe you missed the line with use ?

@VenkatesanPrabhu

Thank for this excellent article on undefined index error in PHP ..Please visit my article on the same!
http://www.wikitechy.com/fix-error/notice-undefined-index-in-php

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