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

Error when try to reach form from public access #383

Closed
thenamelessthing opened this issue May 13, 2020 · 4 comments
Closed

Error when try to reach form from public access #383

thenamelessthing opened this issue May 13, 2020 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@thenamelessthing
Copy link

Steps to reproduce

I have created successfully a form, It contain, dropdown choice, short answer, long answer.

Expected behaviour

I want anonymous people to be able to access the forms.

https://nxworld.club/index.php/s/ecy9Zip2DFbyJWk/preview

Actual behaviour

When I try to reach the form as "anonymous" (not logged user) with the public link.
I obtain these error:

https://nxworld.club/index.php/s/DCyG9J5Jjw52bAM/preview

Server configuration detail

Operating system: Linux 4.15.0-99-generic #100~16.04.1-Ubuntu SMP Wed Apr 22 23:56:30 UTC 2020 x86_64

Webserver: Apache/2.4.18 (Ubuntu) (apache2handler)

Database: mysql 10.0.38

PHP version:

7.2.30-1+ubuntu16.04.1+deb.sury.org+1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, apache2handler, mysqlnd, PDO, xml, apcu, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, intl, json, exif, memcache, msgpack, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, memcached, libsmbclient, Zend OPcache

Nextcloud version: 18.0.4 - 18.0.4.2

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.4.0
 - activity: 2.11.0
 - admin_audit: 1.8.0
 - bookmarks: 3.0.13
 - bruteforcesettings: 1.6.0
 - calendar: 2.0.3
 - carnet: 0.21.1
 - cloud_federation_api: 1.1.0
 - comments: 1.8.0
 - contacts: 3.3.0
 - dav: 1.14.0
 - drawio: 0.9.5
 - external: 3.5.0
 - federatedfilesharing: 1.8.0
 - federation: 1.8.0
 - files: 1.13.1
 - files_downloadactivity: 1.7.0
 - files_external: 1.9.0
 - files_mindmap: 0.0.21
 - files_pdfviewer: 1.7.0
 - files_rightclick: 0.15.2
 - files_sharing: 1.10.1
 - files_trashbin: 1.8.0
 - files_versions: 1.11.0
 - files_videoplayer: 1.7.0
 - firstrunwizard: 2.7.0
 - forms: 1.1.1
 - issuetemplate: 0.6.0
 - logreader: 2.3.0
 - lookup_server_connector: 1.6.0
 - news: 14.1.7
 - nextbackup: 20.4.0
 - nextcloud_announcements: 1.7.0
 - notes: 3.3.0
 - notifications: 2.6.0
 - oauth2: 1.6.0
 - occweb: 0.0.7
 - ocr: 6.0.39
 - password_policy: 1.8.0
 - phonetrack: 0.6.2
 - photos: 1.0.0
 - previewgenerator: 2.3.0
 - privacy: 1.2.0
 - provisioning_api: 1.8.0
 - ransomware_protection: 1.6.1
 - recommendations: 0.6.0
 - serverinfo: 1.8.0
 - settings: 1.0.0
 - sharebymail: 1.8.0
 - socialsharing_email: 2.0.0
 - socialsharing_facebook: 2.0.0
 - spreed: 8.0.9
 - support: 1.1.0
 - survey_client: 1.6.0
 - systemtags: 1.8.0
 - tasks: 0.13.0
 - text: 2.0.0
 - theming: 1.9.0
 - twofactor_backupcodes: 1.7.0
 - twofactor_totp: 4.1.3
 - updatenotification: 1.8.0
 - viewer: 1.2.0
 - workflowengine: 2.0.0
Disabled:
 - admin_notifications
 - encryption
 - files_clipboard
 - files_reader
 - keeporsweep
 - mindmaps
 - ownbackup
 - ownpad
 - sharelisting
 - unsplash
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "nxworld.club",
        "www.nxworld.club",
        "192.168.1.3"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "18.0.4.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "UTC",
    "loglevel": 0,
    "installed": true,
    "maintenance": false,
    "theme": "",
    "appcodechecker": false,
    "default_language": "fr",
    "enable_previews": "true",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
    "mail_smtpdebug": true,
    "mail_smtpmode": "smtp",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtptimeout": 10,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpsecure": "ssl",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "session_lifetime": 86400,
    "trashbin_retention_obligation": "auto",
    "appstore.experimental.enabled": true,
    "mysql.utf8mb4": true,
    "debug": true,
    "overwrite.cli.url": "http:\/\/192.168.1.3",
    "app_install_overwrite": [
        "calendar"
    ],
    "has_rebuilt_cache": true,
    "twofactor_enforced": "true",
    "twofactor_enforced_groups": [
        "admin"
    ],
    "twofactor_enforced_excluded_groups": []
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36

Operating system: Windows 10 (ver 1909)

Logs

Web server error log
Insert your web server log here 
Nextcloud log


Or in the nextcloud log:

{"reqId":"eow2R9wdHitZjOvcKGNp","level":3,"time":"2020-05-13T14:15:01+00:00","remoteAddr":"","user":"--","app":"forms","method":"","url":"--","message":{"Exception":"RuntimeException","Message":"App class OCA\\Forms\\AppInfo\\Application is not setup via query() but directly","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/forms/lib/AppInfo/Application.php","line":41,"function":"__construct","class":"OCP\\AppFramework\\App","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":107,"function":"__construct","class":"OCA\\Forms\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/ServerContainer.php","line":133,"function":"getAppContainer","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":375,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":353,"function":"setupRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":152,"function":"requireRouteFile","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":333,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/lib/private/URLGenerator.php","line":82,"function":"generate","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/apps/theming/appinfo/app.php","line":37,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":266,"args":["/var/www/nextcloud/apps/theming/appinfo/app.php"],"function":"require_once"},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":155,"function":"requireAppFile","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/app.php","line":128,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/cron.php","line":54,"function":"loadApps","class":"OC_App","type":"::"}],"File":"/var/www/nextcloud/lib/public/AppFramework/App.php","Line":80,"CustomMessage":"--"},"userAgent":"--","version":"18.0.4.2"}
Browser log

Error in the browser:

ID de la demande : oognOgG0gdnO5qYPa5sW
Type : Exception
Code : 0
Message : Argument 2 passed to OCA\Forms\Db\NotificationMapper::findByUserAndForm() must be of the type string, null given, called in /var/www/nextcloud/apps/forms/lib/Controller/PageController.php on line 277
Fichier : /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php
Ligne : 109

Trace
#0 /var/www/nextcloud/lib/private/AppFramework/App.php(125): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Forms\Controller\PageController), 'gotoForm')
#1 /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main('OCA\Forms\Contr...', 'gotoForm', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#2 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
#3 /var/www/nextcloud/lib/private/Route/Router.php(299): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
#4 /var/www/nextcloud/lib/base.php(1008): OC\Route\Router->match('/apps/forms/for...')
#5 /var/www/nextcloud/index.php(38): OC::handleRequest()
#6 {main}

@thenamelessthing thenamelessthing added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels May 13, 2020
@thenamelessthing
Copy link
Author

You can live chat with me on the #nextcloud-dev irc channel

@thenamelessthing
Copy link
Author

As mentionned in the https://help.nextcloud.com/t/forms-internal-server-error/74440/13

I can comment the line #277 of the file /var/www/nextcloud/apps/forms/lib/Controller/PageController.php

but it is the right thing to do?

@jotoeri
Copy link
Member

jotoeri commented May 14, 2020

Thank you for reporting this. The bug itself has been tackled already, so with the next release it will be solved.
Your given solution out of the forum is good, that should work and won't break any functionality.
If you want, you can alternatively install current beta of Forms v2.0. Detailed steps for this are given in #349. However, keep in mind it's not released yet, so can contain other bugs.

And just for the next time - Please search in the old issues, if your problem has been reported yet. This makes life much easier for us to support you. ;)

Greets,
Jonas

@jotoeri jotoeri closed this as completed May 14, 2020
@jotoeri jotoeri added duplicate This issue or pull request already exists and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. labels May 14, 2020
@thenamelessthing
Copy link
Author

OK thank you, sorry for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants