Panopto / Moodle-2.0-plugin-for-Panopto

Panopto's integration with the Moodle LMS.
http://www.panopto.com
GNU General Public License v3.0
18 stars 38 forks source link

Upgrade failure via CLI #103

Closed sharpchi closed 7 years ago

sharpchi commented 7 years ago

Unable to upgrade the plugin (v 2017061000) via CLI. Results in:

Verifying Permission
<div class='alert alert-error alert-block'><strong>Panopto ClientData(old) to Public API(new) Upgrade Error - Not valid user</strong><br/>
UPGRADE BLOCKED: The user does not have access to a provisioned Panopto course folder. Upgrading user must have at least viewer access to all Panopto course folders. It is highly reccommended that the upgrading user is an Administrator on Panopto.</div>

This is problematic for us, as this is our usual method of updating Moodle, in order to avoid timeout issues.

jmalmsten-panopto commented 7 years ago

Hi,

We only support installing this specific update through the Moodle UI as user context is required.

sharpchi commented 7 years ago

That makes for a non-standard upgrade process where everything else, including core Moodle is upgradeable via the CLI.

In fact Moodle's upgrade script instantiates an admin user to apply default settings, so it strikes me that this same method could be used for your bit that requires a user context.

From admin/cli/upgrade.php lin 184

// log in as admin - we need doanything permission when applying defaults
\core\session\manager::set_user(get_admin());

Since only those with direct access to the server can run CLI scripts, I don't see any reason not to do this.

jmalmsten-panopto commented 7 years ago

Hi Mark, The user context is needed because the user applying the upgrade needs to have permissions on all Panopto folders to perform the upgrade (the upgrade is altering Panopto folder permissions to use the new API).

If you could find the username name of the admin user and temporarily make that user an admin on your Panopto server the upgrade should proceed through the CLI (get admin user name, make account on Panopto server with name <instanceName>\<userName>, give that account temp administrator role during the upgrade).

If you need further assistance with this issue please open a Panopto support ticket so we can assist you more directly.

Thanks, Joe M

jmalmsten-panopto commented 7 years ago

Hi,

We are releasing a new version of the block soon that should have the tools needed to allow for a CLI upgrade. I remembered this ticket and thought I would let you know to keep an eye out in the upcoming week for this release.

It generally is the above workaround, but we now display the name of the user attempting the upgrade so you know who to temporarily give them admin privileges on Panopto and try again.

Thanks, Joe M