【问题标题】:Unable to Connect Moodle with nextcloud Error: Can Not Download File无法使用 nextcloud 连接 Moodle 错误:无法下载文件
【发布时间】:2022-01-13 23:20:31
【问题描述】:

我正在尝试通过文件活动将文件从 Nextcloud 获取到 Moodle 课程。 选择文件并保存后,提示无法下载文件。

我已经使用 OAuth 2 从 Moodle 连接 Nextcloud,这里是屏幕截图

我不知道为什么登录没有连接。我按照指导方针进行了指导。 https://docs.moodle.org/311/en/OAuth_2_services

这是我的错误日志:

Error code: cannotdownload
* line 380 of /repository/nextcloud/lib.php: repository_exception thrown
* line 1283 of /lib/filelib.php: call to repository_nextcloud->reference_file_selected()
* line 547 of /mod/resource/locallib.php: call to file_save_draft_area_files()
* line 107 of /mod/resource/lib.php: call to resource_set_mainfile()
* line 128 of /course/modlib.php: call to resource_add_instance()
* line 168 of /course/modedit.php: call to add_moduleinfo()" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: moodle.domain.com, request: "POST /course/modedit.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "moodle.domain.com", referrer: "https://moodle.domain.com/course/modedit.php?add=resource&type=&course=7&section=0&return=0&sr=0"

【问题讨论】:

    标签: api oauth-2.0 moodle nextcloud


    【解决方案1】:

    这里有一个故障排除提示,可以尝试再次连接

    https://docs.moodle.org/311/en/OAuth_2_Nextcloud_service#Troubleshooting

    当我尝试创建访问控制链接时,我收到“无法下载此文件”错误。 如果未连接系统帐户,则可能会发生这种情况。转到站点管理 > 服务器 > OAuth 2 服务并尝试再次连接 Nextcloud 系统帐户。

    【讨论】: