Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82814

Debugging notice when loading new preferences REST route

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-82814-main
    • Hide

      Testing 1 - SSL Proxy

      Steps

      1. Public your site using ngrok.
      2. Edit your config.php as below:
        1. $CFG->sslproxy = true;
        2. $CFG->wwwroot   = 'Your_ngrok_URL'; (Example: https://neutral-eternal-heron.ngrok-free.app/m/stable_main )
      3. Start the General test.
      4. Revert your config.php changes.

      Testing 2 - Reverse Proxy

      Steps

      1. Clone this repo: https://github.com/HuongNV13/nginx-reverse
      2. Open the default.conf file inside the cloned repo with your preferred editor.
      3. Find proxy_pass http://change_me/;
      4. Change it to: proxy_pass http://(your_local_ip_address); (Example: proxy_pass http://192.168.88.2/; ) (The trailing slash is very important)
      5. Save the file.
      6. Open your terminal.
      7. Change the directory to the cloned repo.
      8. Run the following command: docker compose up --build
      9. Edit your config.php as below:
        1. $CFG->reverseproxy = true;
        2. $CFG->wwwroot = 'http://localhost:8000/(path_to_your_moodle)'; (Example: Mine is: http://localhost:8000/m/stable_main)
      10. Start the General test.
      11. Revert your config.php changes.
      12. Stop the docker by running: docker compose down

      General test

      1. Login as admin
      2. Navigate to Site Admin > Development > Moodle REST API UI (SwaggerUI)
      3. VERIFY you see Swagger UI without any errors.
      4. Click the Core > User > POST - /user/{user}/preferences/{preference}
      5. At the Parameters tab, fill the preference input text with drawer-open-index
      6. At the request body, fill the textarea with the below value:

        {
          "value": false
        }

        See the image below for sample:

      1. Click the Execute button.
      2. VERIFY the responses code is 200 without any errors.
      Show
      Testing 1 - SSL Proxy Steps Public your site using ngrok . Edit your config.php as below: $CFG->sslproxy = true; $CFG->wwwroot   = 'Your_ngrok_URL'; (Example: https://neutral-eternal-heron.ngrok-free.app/m/stable_main ) Start the General test . Revert your config.php changes. Testing 2 - Reverse Proxy Steps Clone this repo: https://github.com/HuongNV13/nginx-reverse Open the default.conf file inside the cloned repo with your preferred editor. Find proxy_pass http://change_me/ ; Change it to: proxy_pass http://(your_local_ip_address ); (Example: proxy_pass http://192.168.88.2/ ; ) (The trailing slash is very important) Save the file. Open your terminal. Change the directory to the cloned repo. Run the following command: docker compose up --build Edit your config.php as below: $CFG->reverseproxy = true; $CFG->wwwroot = 'http://localhost:8000/(path_to_your_moodle)'; (Example: Mine is: http://localhost:8000/m/stable_main ) Start the General test . Revert your config.php changes. Stop the docker by running: docker compose down General test Login as admin Navigate to Site Admin > Development > Moodle REST API UI (SwaggerUI) VERIFY you see Swagger UI without any errors. Click the Core > User > POST - /user/{user}/preferences/{preference} At the Parameters tab, fill the preference input text with drawer-open-index At the request body , fill the textarea with the below value: {   "value" : false } See the image below for sample: Click the Execute button. VERIFY the responses code is 200 without any errors.
    • 6
    • Team Hedgehog 2024 Sprint 3.2, Team Hedgehog 2024 Sprint 3.3

      Discovered by marycooch in this comment from MDL-81859

      It seems to be related to the new routing from MDL-81031 - when examining the browser request/response we see the following:

      https://qa.moodledemo.net/r.php/api/rest/v2/user/current/preferences

      <div class="notifytiny debuggingmessage" data-rel="debugging">
      	Most probably incorrect set_page() url argument, it does not match the wwwroot!
      	<ul style="text-align: left" data-rel="backtrace">
      		<li>line 1510 of /lib/pagelib.php: call to debugging()</li>
      		<li>line 61 of /lib/classes/router/middleware/moodle_bootstrap_middleware.php: call to moodle_page-&gt;set_url()</li>
      		<li>line 121 of /lib/slim/slim/Slim/MiddlewareDispatcher.php: call to core\router\middleware\moodle_bootstrap_middleware-&gt;process()</li>
      		<li>line 37 of /lib/classes/router/middleware/moodle_route_attribute_middleware.php: call to Psr\Http\Server\RequestHandlerInterface@anonymous/opt/app/lib/slim/slim/Slim/MiddlewareDispatcher.php:108$19-&gt;handle()</li>
      		<li>line 121 of /lib/slim/slim/Slim/MiddlewareDispatcher.php: call to core\router\middleware\moodle_route_attribute_middleware-&gt;process()</li>
      		<li>line 45 of /lib/slim/slim/Slim/Middleware/RoutingMiddleware.php: call to Psr\Http\Server\RequestHandlerInterface@anonymous/opt/app/lib/slim/slim/Slim/MiddlewareDispatcher.php:108$19-&gt;handle()</li>
      		<li>line 121 of /lib/slim/slim/Slim/MiddlewareDispatcher.php: call to Slim\Middleware\RoutingMiddleware-&gt;process()</li>
      		<li>line 59 of /lib/classes/router/middleware/uri_normalisation_middleware.php: call to Psr\Http\Server\RequestHandlerInterface@anonymous/opt/app/lib/slim/slim/Slim/MiddlewareDispatcher.php:108$19-&gt;handle()</li>
      		<li>line 121 of /lib/slim/slim/Slim/MiddlewareDispatcher.php: call to core\router\middleware\uri_normalisation_middleware-&gt;process()</li>
      		<li>line 76 of /lib/slim/slim/Slim/Middleware/ErrorMiddleware.php: call to Psr\Http\Server\RequestHandlerInterface@anonymous/opt/app/lib/slim/slim/Slim/MiddlewareDispatcher.php:108$19-&gt;handle()</li>
      		<li>line 121 of /lib/slim/slim/Slim/MiddlewareDispatcher.php: call to Slim\Middleware\ErrorMiddleware-&gt;process()</li>
      		<li>line 65 of /lib/slim/slim/Slim/MiddlewareDispatcher.php: call to Psr\Http\Server\RequestHandlerInterface@anonymous/opt/app/lib/slim/slim/Slim/MiddlewareDispatcher.php:108$19-&gt;handle()</li>
      		<li>line 199 of /lib/slim/slim/Slim/App.php: call to Slim\MiddlewareDispatcher-&gt;handle()</li>
      		<li>line 183 of /lib/slim/slim/Slim/App.php: call to Slim\App-&gt;handle()</li>
      		<li>line 257 of /lib/classes/router.php: call to Slim\App-&gt;run()</li>
      		<li>line 56 of /r.php: call to core\router-&gt;serve()</li>
      	</ul>
      </div>{     "assign_filter": "" }
      

        1. (1) 2 Passed -- (Main)MDL-82814.png
          (1) 2 Passed -- (Main)MDL-82814.png
          127 kB
        2. (2) 2 Passed -- (Main)MDL-82814.png
          (2) 2 Passed -- (Main)MDL-82814.png
          539 kB
        3. MDL-82814_request.png
          MDL-82814_request.png
          78 kB
        4. MDL-82814_response.png
          MDL-82814_response.png
          79 kB
        5. MDL-82814_Step3_OK.png
          MDL-82814_Step3_OK.png
          228 kB
        6. MDL-82814_Step8_OK.png
          MDL-82814_Step8_OK.png
          104 kB
        7. Screenshot from 2024-08-16 16-16-43.png
          Screenshot from 2024-08-16 16-16-43.png
          123 kB

            dobedobedoh Andrew Lyons
            pholden Paul Holden
            Huong Nguyen Huong Nguyen
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 4 hours, 46 minutes
                3d 4h 46m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.