pondersource / nextcloud-mfa-awareness

Make Nextcloud aware of whether the current user is logged in with Multi-Factor Authentication
MIT License
0 stars 2 forks source link

Problem in setup-gss.sh #73

Closed mrvahedi68 closed 9 months ago

mrvahedi68 commented 9 months ago

after running setup-gss.sh not started completely and have this log:

    Installing Nextcloud
    Nextcloud was successfully installed
    Enabling apps
    firstrunwizard 2.13.0 disabled
    App "Global Site Selector" cannot be installed because it is not compatible with this version of the server.
    mfachecker 0.0.1 enabled
    Editing config
    Configuring user_saml on sunet-nc1
    OCI runtime exec failed: exec failed: unable to start container process: exec: "mysql": executable file not found in $PATH: unknown
mrvahedi68 commented 9 months ago

mysql error is for using the latest tag in the docker-compose for mariadb. after changing it to version 10 we have only the following error:

    App "Global Site Selector" cannot be installed because it is not compatible with this version of the server.
mrvahedi68 commented 9 months ago

This error appears because the Global Site Selector app supports Nextcloud from version 25 and the script using Nextcloud 24. By changing the info.xml for the app the installation will progress successfully.

mrvahedi68 commented 9 months ago

After successfully running the script by entering http://sunet-nc1 will face an internal server error. with flowing log:


    {"reqId":"X996v2PdSNsBfxua4fVG","level":4,"time":"2023-09-17T13:42:12+00:00","remoteAddr":"172.19.0.5","user":"--","app":"globalsiteselector","method":"GET","url":"/index.php/csrftoken","message":"Error during app service registration: Class \"OCP\\Server\" not found","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"24.0.12.1","exception":{"Exception":"Error","Message":"Class \"OCP\\Server\" not found","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":136,"function":"register","class":"OCA\\GlobalSiteSelector\\AppInfo\\Application","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":91,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/html/lib/base.php","line":661,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/html/lib/base.php","line":1111,"function":"init","class":"OC","type":"::"},{"file":"/var/www/html/index.php","line":34,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/apps/globalsiteselector/lib/AppInfo/Application.php","Line":110,"message":"Error during app service registration: Class \"OCP\\Server\" not found","exception":{"xdebug_message":"<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Error: Class \"OCP\\Server\" not found in /var/www/html/apps/globalsiteselector/lib/AppInfo/Application.php on line <i>110</i></th></tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\n<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0002</td><td bgcolor='#eeeeec' align='right'>361736</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/var/www/html/index.php' bgcolor='#eeeeec'>.../index.php<b>:</b>0</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0003</td><td bgcolor='#eeeeec' align='right'>362016</td><td bgcolor='#eeeeec'>require_once( <font color='#00bb00'>'/var/www/html/lib/base.php</font> )</td><td title='/var/www/html/index.php' bgcolor='#eeeeec'>.../index.php<b>:</b>34</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0004</td><td bgcolor='#eeeeec' align='right'>362056</td><td bgcolor='#eeeeec'>OC::init(  )</td><td title='/var/www/html/lib/base.php' bgcolor='#eeeeec'>.../base.php<b>:</b>1111</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.0292</td><td bgcolor='#eeeeec' align='right'>884288</td><td bgcolor='#eeeeec'>OC\\AppFramework\\Bootstrap\\Coordinator->runInitialRegistration(  )</td><td title='/var/www/html/lib/base.php' bgcolor='#eeeeec'>.../base.php<b>:</b>661</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.0402</td><td bgcolor='#eeeeec' align='right'>928936</td><td bgcolor='#eeeeec'>OC\\AppFramework\\Bootstrap\\Coordinator->registerApps( <span>$appIds = </span><span>[0 =&gt; &#39;files&#39;, 1 =&gt; &#39;accessibility&#39;, 2 =&gt; &#39;activity&#39;, 3 =&gt; &#39;circles&#39;, 4 =&gt; &#39;cloud_federation_api&#39;, 5 =&gt; &#39;comments&#39;, 6 =&gt; &#39;contactsinteraction&#39;, 7 =&gt; &#39;dashboard&#39;, 8 =&gt; &#39;dav&#39;, 9 =&gt; &#39;federatedfilesharing&#39;, 10 =&gt; &#39;federation&#39;, 11 =&gt; &#39;files_pdfviewer&#39;, 12 =&gt; &#39;files_rightclick&#39;, 13 =&gt; &#39;files_sharing&#39;, 14 =&gt; &#39;files_trashbin&#39;, 15 =&gt; &#39;files_versions&#39;, 16 =&gt; &#39;files_videoplayer&#39;, 17 =&gt; &#39;globalsiteselector&#39;, 18 =&gt; &#39;logreader&#39;, 19 =&gt; &#39;lookup_server_connector&#39;, 20 =&gt; &#39;nextcloud_announcements&#39;, 21 =&gt; &#39;notifications&#39;, 22 =&gt; &#39;oauth2&#39;, 23 =&gt; &#39;password_policy&#39;, 24 =&gt; &#39;photos&#39;, 25 =&gt; &#39;privacy&#39;, 26 =&gt; &#39;provisioning_api&#39;, 27 =&gt; &#39;recommendations&#39;, 28 =&gt; &#39;serverinfo&#39;, 29 =&gt; &#39;settings&#39;, 30 =&gt; &#39;sharebymail&#39;, 31 =&gt; &#39;support&#39;, 32 =&gt; &#39;survey_client&#39;, 33 =&gt; &#39;systemtags&#39;, 34 =&gt; &#39;text&#39;, 35 =&gt; &#39;theming&#39;, 36 =&gt; &#39;twofactor_backupcodes&#39;, 37 =&gt; &#39;updatenotification&#39;, 38 =&gt; &#39;user_saml&#39;, 39 =&gt; &#39;user_status&#39;, 40 =&gt; &#39;viewer&#39;, 41 =&gt; &#39;weather_status&#39;, 42 =&gt; &#39;workflowengine&#39;]</span> )</td><td title='/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php' bgcolor='#eeeeec'>.../Coordinator.php<b>:</b>91</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.0553</td><td bgcolor='#eeeeec' align='right'>1779136</td><td bgcolor='#eeeeec'>OCA\\GlobalSiteSelector\\AppInfo\\Application->register( <span>$context = </span><span>class OCP\\AppFramework\\Bootstrap\\IRegistrationContext@anonymous { private $appId = &#39;globalsiteselector&#39;; private $context = class OC\\AppFramework\\Bootstrap\\RegistrationContext { private $capabilities = [...]; private $crashReporters = [...]; private $dashboardPanels = [...]; private $profileLinkActions = [...]; private $talkBackendRegistration = NULL; private $calendarResourceBackendRegistrations = [...]; private $calendarRoomBackendRegistrations = [...]; private $userMigrators = [...]; private $services = [...]; private $aliases = [...]; private $parameters = [...]; private $eventListeners = [...]; private $middlewares = [...]; private $searchProviders = [...]; private $alternativeLogins = [...]; private $initialStates = [...]; private $wellKnownHandlers = [...]; private $templateProviders = [...]; private $notifierServices = [...]; private $twoFactorProviders = [...]; private $calendarProviders = [...]; private $logger = class OC\\Log\\PsrLoggerAdapter { ... }; private $previewProviders = [...] } }</span> )</td><td title='/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php' bgcolor='#eeeeec'>.../Coordinator.php<b>:</b>136</td></tr>\n"},"CustomMessage":"Error during app service registration: Class \"OCP\\Server\" not found"}}```
mrvahedi68 commented 9 months ago

By changing global site selector into stable24 branch the error changed:

    {"reqId":"tGuae9JRLIvXXMLImofm","level":3,"time":"2023-09-17T14:16:25+00:00","remoteAddr":"172.19.0.2","user":"--","app":"index","method":"GET","url":"/index.php/apps/user_saml/saml/login?requesttoken=ZVPV7YEi4Xf0yRJU7uHh0X95OfkIsrpfoR3XSZ6zQis%3D:Kj2xncdssw6emlE%2Bi9SEhSYRQ4xvy%2Bk1k3G6AdPYO2Y%3D&originalUrl=&idp=1","message":"Invalid array settings: idp_sso_url_invalid","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"24.0.12.1","exception":{"Exception":"OneLogin\\Saml2\\Error","Message":"Invalid array settings: idp_sso_url_invalid","Code":2,"Trace":[{"file":"/var/www/html/apps/user_saml/3rdparty/vendor/onelogin/php-saml/src/Saml2/Auth.php","line":177,"function":"__construct","class":"OneLogin\\Saml2\\Settings","type":"->"},{"file":"/var/www/html/apps/user_saml/lib/Controller/SAMLController.php","line":206,"function":"__construct","class":"OneLogin\\Saml2\\Auth","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"login","class":"OCA\\User_SAML\\Controller\\SAMLController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1030,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/apps/user_saml/3rdparty/vendor/onelogin/php-saml/src/Saml2/Settings.php","Line":141,"CustomMessage":"--"}}
mrvahedi68 commented 9 months ago

By trying to log in directly will face another error with the following logs:

    {"reqId":"iJ2VhjPAzcuKCuDo6VsH","level":4,"time":"2023-09-17T14:22:11+00:00","remoteAddr":"172.19.0.2","user":"--","app":"globalsiteselector","method":"POST","url":"/index.php/login","message":"Can not lookup user, no lookup server registered","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"24.0.12.1","data":{"app":"globalsiteselector"}}
    {"reqId":"iJ2VhjPAzcuKCuDo6VsH","level":3,"time":"2023-09-17T14:22:11+00:00","remoteAddr":"172.19.0.2","user":"--","app":"no app in context","method":"POST","url":"/index.php/login","message":"Could not find location for user, Admin","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"24.0.12.1","exception":{"Exception":"OC\\HintException","Message":"Could not find location for user, Admin","Code":0,"Trace":[{"file":"/var/www/html/lib/private/legacy/OC_Hook.php","line":106,"function":"handleLoginRequest","class":"OCA\\GlobalSiteSelector\\Master","type":"->"},{"file":"/var/www/html/lib/private/Server.php","line":604,"function":"emit","class":"OC_Hook","type":"::"},{"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Hooks/EmitterTrait.php","line":106,"function":"call_user_func_array"},{"file":"/var/www/html/lib/private/Hooks/PublicEmitter.php","line":40,"function":"emit","class":"OC\\Hooks\\BasicEmitter","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php","line":48,"function":"emit","class":"OC\\Hooks\\PublicEmitter","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/Chain.php","line":108,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->"},{"file":"/var/www/html/core/Controller/LoginController.php","line":341,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1030,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/apps/globalsiteselector/lib/Master.php","Line":178,"Hint":"Could not find location for user, Admin","CustomMessage":"--"}}
mrvahedi68 commented 9 months ago

We must test again with NC 26

mrvahedi68 commented 9 months ago

by switching to NC 26 previous error remains.

mrvahedi68 commented 9 months ago

If disable saml on run scripts and try to login with Admin user on http://sunet-nc2 the error will change to bellow:

    {"reqId":"gDFvQ2pW04vaZw6MwRBF","level":4,"time":"2023-09-24T07:49:44+00:00","remoteAddr":"172.19.0.2","user":"--","app":"globalsiteselector","method":"POST","url":"/index.php/login","message":"Can not lookup user, no lookup server registered","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"26.0.7.0","data":{"app":"globalsiteselector"}}
mrvahedi68 commented 9 months ago

Continue in: https://github.com/pondersource/nextcloud-mfa-awareness/issues/79