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

OCP\Files\NotFoundException if Shared File is in a Subdir #103

Closed
wscheicher opened this issue Jun 13, 2017 · 3 comments
Closed

OCP\Files\NotFoundException if Shared File is in a Subdir #103

wscheicher opened this issue Jun 13, 2017 · 3 comments
Labels
bug Something isn't working

Comments

@wscheicher
Copy link

Steps to reproduce

  1. Share a directory by link, allow upload and editing
  2. Put a office document in a subdir
  3. Access that share in a browser without authentification using the link
  4. Try to open that document

Expected behaviour

Document opens and can be viewed and edited

Actual behaviour

Internal Server Error

The Nextcloud Log contains OCP\Files\NotFoundException and the filenames and paths in the log suggest that the information about the subfolder got lost.

Note: If the toplevel dir of the share contains a file with identical name, this one is opened instead (despite url and everything suggests the file in the subfolder would be edited)

Server configuration

Server configuration

Operating system: Linux puck 4.9.0-0.bpo.3-amd64 #1 SMP Debian 4.9.25-1~bpo8+1 (2017-05-19) x86_64

Web server: Apache/2.4.10 (Debian) (apache2handler)

Database: pgsql PostgreSQL 9.6.3 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit

PHP version: 5.6.30-0+deb8u1
Modules loaded: Core, date, ereg, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, SPL, iconv, mbstring, session, posix, Reflection, standard, shmop, SimpleXML, soap, sockets, Phar, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, apache2handler, PDO, apcu, curl, gd, imagick, intl, json, ldap, mcrypt, pdo_pgsql, pgsql, readline, mhash, apc, Zend OPcache

Nextcloud version: 12.0.0 - 12.0.0.29

List of activated apps:

App list
Enabled:
 - activity: 2.5.2
 - audioplayer: 2.0.2
 - bookmarks: 0.10.0
 - bruteforcesettings: 1.0.2
 - calendar: 1.5.3
 - circles: 0.10.0
 - comments: 1.2.0
 - contacts: 1.5.3
 - dav: 1.3.0
 - deck: 0.1.4
 - federatedfilesharing: 1.2.0
 - federation: 1.2.0
 - files: 1.7.2
 - files_external: 1.3.0
 - files_markdown: 1.0.1
 - files_pdfviewer: 1.1.1
 - files_sharing: 1.4.0
 - files_texteditor: 2.4.1
 - files_trashbin: 1.2.0
 - files_videoplayer: 1.1.0
 - firstrunwizard: 2.1
 - gallery: 17.0.0
 - issuetemplate: 0.2.1
 - logreader: 2.0.0
 - lookup_server_connector: 1.0.0
 - nextant: 1.0.8
 - nextcloud_announcements: 1.1
 - notifications: 2.0.0
 - oauth2: 1.0.5
 - ocsms: 1.12.0
 - password_policy: 1.2.2
 - provisioning_api: 1.2.0
 - richdocuments: 1.12.32
 - serverinfo: 1.2.0
 - sharebymail: 1.2.0
 - spreed: 2.0.1
 - survey_client: 1.0.0
 - systemtags: 1.2.0
 - tasks: 0.9.5
 - theming: 1.3.0
 - twofactor_backupcodes: 1.1.1
 - updatenotification: 1.2.0
 - user_ldap: 1.2.1
 - workflowengine: 1.2.0

Disabled:
 - admin_audit
 - encryption
 - files_versions
 - notes
 - spreedme
 - user_external

The content of config/config.php:

Config report
{
    "instanceid": "ochv8io4j0ik",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "\/var\/www\/nextcloud\/data",
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "pgsql",
    "version": "12.0.0.29",
    "dbname": "nextcloud",
    "dbhost": "\/var\/run\/postgresql",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "UTC",
    "installed": true,
    "ldapIgnoreNamingRules": false,
    "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "htaccess.RewriteBase": "\/",
    "maintenance": false,
    "updater.release.channel": "stable",
    "loglevel": 2,
    "theme": ""
}

Are you using external storage, if yes which one: \OC\Files\Storage\Local

Are you using encryption: no

Are you using an external user-backend, if yes which one: ActiveDirectory

Client configuration

Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36

Operating system: Linux puck 4.9.0-0.bpo.3-amd64 #1 SMP Debian 4.9.25-1~bpo8+1 (2017-05-19) x86_64

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` OCP\Files\NotFoundException: /***USER***/files/***SHARE***/A.ods /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 133: OC\Files\Node\Root->get('/***USER***/files/Tes...') /var/www/nextcloud/apps/richdocuments/lib/Controller/DocumentController.php - line 177: OC\Files\Node\Folder->get('A.ods') [internal function] OCA\Richdocuments\Controller\DocumentController->publicPage('***REMOVED SENSITIVE VALUE***', 'A.ods') /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array) /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Richdocuments\Controller\DocumentController), 'publicPage') /var/www/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Richdocuments\Controller\DocumentController), 'publicPage') /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('DocumentControl...', 'publicPage', Object(OC\AppFramework\DependencyInjection\DIContainer), Array) [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array) /var/www/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array) /var/www/nextcloud/lib/base.php - line 1000: OC\Route\Router->match('/apps/richdocum...') /var/www/nextcloud/index.php - line 40: OC handleRequest() {main} ```
@patschi
Copy link
Member

patschi commented Jun 20, 2017

I can verify this bug on my setup too (NC 12.0.0.29, App v1.12.33). This happens with shared read-only folders as well, even that opening using Collabora Online makes to sense on a read-only share (except its any sort of readonly mode then).

So basically this bug breaks the download of all supported mimeTypes of this app. Probably a bit related with #83. Should be considered as high priority IMHO.

Stacktrace:

OCP\Files\NotFoundException: /<username>/files/Unterlagen/Fragenkatalog - Informatik.docx
/var/www/nextcloud/lib/private/Files/Node/Folder.php - line 133: OC\Files\Node\Root->get('/<username>/fil...')
/var/www/nextcloud/apps/richdocuments/lib/Controller/DocumentController.php - line 177: OC\Files\Node\Folder->get('Fragenkatalog -...')
[internal function] OCA\Richdocuments\Controller\DocumentController->publicPage('<SHARE_ID>', 'Fragenkatalog -...')
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Richdocuments\Controller\DocumentController), 'publicPage')
/var/www/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Richdocuments\Controller\DocumentController), 'publicPage')
/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OCA\\Richdocumen...', 'publicPage', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/var/www/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/var/www/nextcloud/lib/base.php - line 1000: OC\Route\Router->match('/apps/richdocum...')
/var/www/nextcloud/index.php - line 40: OC handleRequest()
{main}

@patschi patschi added the bug Something isn't working label Jun 20, 2017
@thebearon
Copy link
Collaborator

I tried this, and could open the folder and then the file inside with an external, unauthenticated user just fine. NC is 12.0.0, app is 1.12.33. Not sure what could be the difference... it was a local test installation, though.

@andyboeh
Copy link
Contributor

andyboeh commented Jun 28, 2017

I do not get a FileNotFoundException, but it's not working either. I had a quick look at the code, it seems that the "dir" parameter is not added to the public page request:
https://github.com/nextcloud/richdocuments/blob/master/js/viewer/viewer.js#L69

And it seems that publicPage in the DocumentController is not able to handle folders at all, or am I misinterpreting the code?
https://github.com/nextcloud/richdocuments/blob/master/lib/Controller/DocumentController.php#L163

EDIT: This seems to be a duplicate of #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants