Web service step that calls function requiring login falls when triggered by external service
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with classes/steps/actions/webservice_action_step.php, where the traceback shows the external function call, and trace how the step handles calls triggered from scheduled tasks. Compare the front end and LDAP or external database workflows described in the issue. Done means the web service step succeeds for both user creation paths; no test file is named in the payload.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Using a workflow with a webservices step fails if the event is triggered by an external service. Consider a workflow like this:
- When a new user is created, look up the user, then do a WS step calling enrol_manual_enrol_users to enroll the user in an orientation course.
It works fine if the user is creation is initiated from the front end. However if the user is created by an authentication plugin/scheduled task the WS call fails as below. I can replicate this with LDAP and external database, on Moodle 3.10 and tool_trigger 2021030406
Replication steps:
- Import the attached workflow
- Make sure you have a course with ID=2 (or modify workflow for a course on your site)
- Manually create a user and confirm they are enrolled in the course
- Create a user via LDAP or external database and confirm an error similar to below
Workflow ID: 13
Trigger Number: 373
Event description:
'User created'
'The user with id \'2\' created the user with id \'1003\'.'
[Enroll_New_User_in_Orientation_20220815_1824.zip](https://github.com/catalyst/moodle-tool_trigger/files/9339800/Enroll_New_User_in_Orientation_20220815_1824.zip)
Step ID: 851
Step results:
'{
"message": "Web service is not available. (The session has been logged out or has expired.)",
"errorcode": "servicerequireslogin",
"backtrace": "* line 228 of \\/lib\\/externallib.php: moodle_exception thrown\\n* line 116 of \\/admin\\/tool\\/trigger\\/classes\\/steps\\/actions\\/webservice_action_step.php: call to external_api::call_external_function()\\n* line 142 of \\/admin\\/tool\\/trigger\\/classes\\/steps\\/actions\\/webservice_action_step.php: call to tool_trigger\\\\steps\\\\actions\\\\webservice_action_step->run_function()\\n* line 74 of \\/admin\\/tool\\/trigger\\/classes\\/helper\\/processor_helper.php: call to tool_trigger\\\\steps\\\\actions\\\\webservice_action_step->execute()\\n* line 217 of \\/admin\\/tool\\/trigger\\/classes\\/event_processor.php: call to tool_trigger\\\\event_processor->execute_step()\\n* line 197 of \\/admin\\/tool\\/trigger\\/classes\\/event_processor.php: call to tool_trigger\\\\event_processor->process_realtime_workflow()\\n* line 109 of \\/admin\\/tool\\/trigger\\/classes\\/event_processor.php: call to tool_trigger\\\\event_processor->process_realtime_workflows()\\n* line 70 of \\/admin\\/tool\\/trigger\\/classes\\/event_processor.php: call to tool_trigger\\\\event_processor->write()\\n* line ? of unknownfile: call to tool_trigger\\\\event_processor::process_event()\\n* line 155 of \\/lib\\/classes\\/event\\/manager.php: call to call_user_func()\\n* line 75 of \\/lib\\/classes\\/event\\/manager.php: call to core\\\\event\\\\manager::process_buffers()\\n* line 834 of \\/lib\\/classes\\/event\\/base.php: call to core\\\\event\\\\manager::dispatch()\\n* line 483 of \\/auth\\/db\\/auth.php: call to core\\\\event\\\\base->trigger()\\n* line 60 of \\/auth\\/db\\/classes\\/task\\/sync_users.php: call to auth_plugin_db->sync_users()\\n* line 253 of \\/lib\\/cronlib.php: call to auth_db\\\\task\\\\sync_users->execute()\\n* line 167 of \\/admin\\/cli\\/scheduled_task.php: call to cron_run_inner_scheduled_task()\\n",
"link": "http:\\/\\/localhost\\/moodle310\\/",
"moreinfourl": "https:\\/\\/docs.moodle.org\\/310\\/en\\/error\\/webservice\\/servicerequireslogin",
"debuginfo": "\\nError code: servicerequireslogin"
```}'
- Lingua principale
- PHP
- Stelle
- 46
- Fork
- 29
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di catalyst/moodle-tool_trigger
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
catalyst/moodle-tool_trigger#253 ·
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
catalyst/moodle-tool_trigger#251 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
catalyst/moodle-tool_trigger#249 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
catalyst/moodle-tool_trigger#248 ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
catalyst/moodle-tool_trigger#243 ·
Tutte le issue di catalyst/moodle-tool_trigger
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
taskforcesh/bullmq#5238 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itForse già presa @bfs2021 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Automattic/jetpack#55517 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
area/import type/enhancement when/later
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno