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

public shares are broken with files_reader #3

Open
le-zell opened this issue Oct 19, 2022 · 5 comments
Open

public shares are broken with files_reader #3

le-zell opened this issue Oct 19, 2022 · 5 comments

Comments

@le-zell
Copy link

le-zell commented Oct 19, 2022

Argument #3 ($userId) must be of type string, null given in file

{"reqId":"XXXXXX","level":3,"time":"2022-10-19T09:39:52+02:00","remoteAddr":"XXXXXX","user":"--","app":"index","method":"GET","url":"/index.phpCKDWLyy5","message":"OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given in file '/data/php/my-cloud-path/public_html/apps/files_reader/lib/Listeners/LoadViewerListener.php' line 32","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.47","version":"24.0.6.1","exception":{"Exception":"Exception","Message":"OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given in file '/data/php/my-cloud-path/public_html/apps/files_reader/lib/Listeners/LoadViewerListener.php' line 32","Code":0,"Trace":[{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\ShareController"},"showShare"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\ShareController","showShare",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["RRfcDX7CKDWLyy5","files_sharing.Share.showShare"]]},{"file":"/data/php/my-cloud-path/public_html/lib/base.php","line":1030,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/s/RRfcDX7CKDWLyy5"]},{"file":"/data/php/my-cloud-path/public_html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"TypeError","Message":"OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given","Code":0,"Trace":[{"function":"__construct","class":"OCA\\Files_Reader\\Listeners\\LoadViewerListener","type":"->","args":[{"__class__":"OC\\AppFramework\\Services\\InitialState"},{"__class__":"OC\\AllConfig"},null]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/Utility/SimpleContainer.php","line":108,"function":"newInstanceArgs","class":"ReflectionClass","type":"->","args":[[{"__class__":"OC\\AppFramework\\Services\\InitialState"},{"__class__":"OC\\AllConfig"},null]]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"__class__":"ReflectionClass","name":"OCA\\Files_Reader\\Listeners\\LoadViewerListener"}]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/Utility/SimpleContainer.php","line":133,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/ServerContainer.php","line":145,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/EventDispatcher/ServiceEventListener.php","line":71,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OCA\\Files_Reader\\Listeners\\LoadViewerListener"]},{"file":"/data/php/my-cloud-path/public_html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->","args":[{"__class__":"OCA\\Viewer\\Event\\LoadViewer"},"OCA\\Viewer\\Event\\LoadViewer",{"__class__":"Symfony\\Component\\EventDispatcher\\EventDispatcher"}]},{"file":"/data/php/my-cloud-path/public_html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[[{"__class__":"Closure"},{"__class__":"Closure"},{"__class__":"Closure"},{"__class__":"Closure"},{"__class__":"Closure"}],"OCA\\Viewer\\Event\\LoadViewer",{"__class__":"OCA\\Viewer\\Event\\LoadViewer"}]},{"file":"/data/php/my-cloud-path/public_html/lib/private/EventDispatcher/EventDispatcher.php","line":88,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[{"__class__":"OCA\\Viewer\\Event\\LoadViewer"},"OCA\\Viewer\\Event\\LoadViewer"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/EventDispatcher/EventDispatcher.php","line":100,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":["OCA\\Viewer\\Event\\LoadViewer",{"__class__":"OCA\\Viewer\\Event\\LoadViewer"}]},{"file":"/data/php/my-cloud-path/public_html/apps/files_sharing/lib/Controller/ShareController.php","line":529,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":[{"__class__":"OCA\\Viewer\\Event\\LoadViewer"}]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"showShare","class":"OCA\\Files_Sharing\\Controller\\ShareController","type":"->","args":[""]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\ShareController"},"showShare"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\ShareController"},"showShare"]},{"file":"/data/php/my-cloud-path/public_html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\ShareController","showShare",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["RRfcDX7CKDWLyy5","files_sharing.Share.showShare"]]},{"file":"/data/php/my-cloud-path/public_html/lib/base.php","line":1030,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/s/RRfcDX7CKDWLyy5"]},{"file":"/data/php/my-cloud-path/public_html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/data/php/my-cloud-path/public_html/apps/files_reader/lib/Listeners/LoadViewerListener.php","Line":32},"CustomMessage":"--"}}

Last NextCloud 24 version. php8.0 fpm.

@mrtumnus
Copy link

Here's a bit more detail, after just encountering this issue:

Bug Description

When I create a public external share link to a folder, an internal sever error is generated when I access it. This happens in any browser, both on mobile and desktop operating systems.

Error displayed in browser:

Internal Server Error
The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details
Remote Address: <ip address>
Request ID: <id>

Steps to reproduce

  1. Install Reader app
  2. Go to any folder
  3. Create public share link
  4. Access folder using created link

Expected behavior

Public share link opens and files can be read and/or uploaded

Installation method

APTitude (Nextcloud)
Nextcloud App repository (files_reader)

Operating system

Debian LXC

PHP engine version

PHP 8.1.11

Web server

Apache

Database engine version

MariaDB 10.5.17

Is this bug present after an update or on a fresh install?

Not sure; didn't notice directly after an upgrade or fresh install. Using Nextcloud 24.0.7 and Reader 1.5.3.

Are you using the Nextcloud Server Encryption module?

No

What user-backends are you using?

  • Default user-backend
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "updatechecker": false,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
             "***REMOVED SENSITIVE VALUE***"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url":  "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.7.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "loglevel": 0,
        "theme": "",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpdebug": true,
        "mail_sendmailmode": "smtp",
        "app_install_overwrite": [
            "calendar",
            "spreed",
            "drawio"
        ],
        "mysql.utf8mb4": true,
        "updater.release.channel": "stable",
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "default_phone_region": "US",
        "default_language": "en"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - apporder: 0.15.0
  - bookmarks: 11.0.4
  - bruteforcesettings: 2.4.0
  - calendar: 3.5.2
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.2.2
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - deck: 1.7.2
  - drawio: 1.0.5
  - end_to_end_encryption: 1.10.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_external: 1.16.1
  - files_pdfviewer: 2.5.0
  - files_photospheres: 1.24.3
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - integration_google: 1.0.8
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - mail: 1.14.2
  - maps: 0.2.1
  - news: 19.0.0
  - nextcloud_announcements: 1.13.0
  - notes: 4.5.1
  - notifications: 2.12.1
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - passwords: 2022.11.21
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - registration: 1.5.0
  - richdocuments: 6.3.1
  - richdocumentscode: 22.5.802
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - socialsharing_email: 2.5.0
  - spreed: 14.0.6
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - tasks: 0.14.5
  - text: 3.5.1
  - theming: 1.15.0
  - theming_customcss: 1.12.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_nextcloud_notification: 3.4.0
  - twofactor_totp: 6.4.1
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - video_converter: 1.0.5
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - encryption: 2.2.0
  - files_reader: 1.5.3
  - user_ldap

Nextcloud Signing status

Nextcloud Logs

{
    "reqId": "0zzzpYkc88QJDPuVnWJU",
    "level": 3,
    "time": "2022-11-12T19:38:30+00:00",
    "remoteAddr": "172.21.0.1",
    "user": "--",
    "app": "index",
    "method": "GET",
    "url": "/index.php/s/SowfRjbxq3C4e6D",
    "message": "OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given in file '/var/www/nextcloud/apps/files_reader/lib/Listeners/LoadViewerListener.php' line 32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
    "version": "24.0.7.1",
    "exception": {
        "Exception": "Exception",
        "Message": "OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given in file '/var/www/nextcloud/apps/files_reader/lib/Listeners/LoadViewerListener.php' line 32",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                "line": 172,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                "line": 298,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 1030,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/var/www/nextcloud/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 165,
        "Previous": {
            "Exception": "TypeError",
            "Message": "OCA\\Files_Reader\\Listeners\\LoadViewerListener::__construct(): Argument #3 ($userId) must be of type string, null given",
            "Code": 0,
            "Trace": [
                {
                    "function": "__construct",
                    "class": "OCA\\Files_Reader\\Listeners\\LoadViewerListener",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
                    "line": 108,
                    "function": "newInstanceArgs",
                    "class": "ReflectionClass",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
                    "line": 116,
                    "function": "buildClass",
                    "class": "OC\\AppFramework\\Utility\\SimpleContainer",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",
                    "line": 133,
                    "function": "resolve",
                    "class": "OC\\AppFramework\\Utility\\SimpleContainer",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",
                    "line": 465,
                    "function": "query",
                    "class": "OC\\AppFramework\\Utility\\SimpleContainer",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/ServerContainer.php",
                    "line": 145,
                    "function": "queryNoFallback",
                    "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",
                    "line": 71,
                    "function": "query",
                    "class": "OC\\ServerContainer",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
                    "line": 251,
                    "function": "__invoke",
                    "class": "OC\\EventDispatcher\\ServiceEventListener",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
                    "line": 73,
                    "function": "callListeners",
                    "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
                    "line": 88,
                    "function": "dispatch",
                    "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
                    "line": 100,
                    "function": "dispatch",
                    "class": "OC\\EventDispatcher\\EventDispatcher",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php",
                    "line": 529,
                    "function": "dispatchTyped",
                    "class": "OC\\EventDispatcher\\EventDispatcher",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 225,
                    "function": "showShare",
                    "class": "OCA\\Files_Sharing\\Controller\\ShareController",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 133,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                    "line": 172,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                    "line": 298,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::"
                },
                {
                    "file": "/var/www/nextcloud/lib/base.php",
                    "line": 1030,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->"
                },
                {
                    "file": "/var/www/nextcloud/index.php",
                    "line": 36,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::"
                }
            ],
            "File": "/var/www/nextcloud/apps/files_reader/lib/Listeners/LoadViewerListener.php",
            "Line": 32
        },
        "CustomMessage": "--"
    }
}

Additional info

No response

@noideaman
Copy link

I have this same issue as well, using ldap backend.
It only happens when the share link is accessed on a browser that is not signed in, or with a user that does not have access to the share.
Using the nextcloud aio docker environment.

@jfqd
Copy link

jfqd commented Dec 13, 2022

Same issue here.

@MuLeiSY2021
Copy link

MuLeiSY2021 commented Aug 11, 2023

Hey guys,I have the same issue here,and I found the solution ,just by disabling the "eBook Reader" app

@Xefir
Copy link

Xefir commented Aug 11, 2023

Hello.

This app has been forked an astronomical times and only few work properly.
I maintain my own fork that fix this bug and rewrite a huge part of the backend to work on NC 27.

You can download here : https://git.crystalyx.net/Xefir/epubreader/releases

It is not on the app store for a lot of reasons, maybe one day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants