Plugins (calls and jira) cannot be updated

Summary
I presently have the calls 0.20.0 and jira 4.0.0 plugin installed in a self-hosted 9.0.0, although there are apparently updates for both plugins, I cannot update them from the system console plugins section with an admin account.

Expected behavior
According to the docs, new updates should be somehow listed so that an update can be performed from the system console.

Observed behavior
I do observe the following messages in the server log which might be related - no idea what’s causing them though and how to fix this:

ERR app/plugin.go:966 > timestamp=2023-11-20 14:22:42.628 +01:00 msg=Failed to install prepackaged plugin bundle_path=/mattermost/prepackaged_plugins/mattermost-plugin-nps-v1.3.2-linux-amd64.tar.gz error=Failed to install extracted prepackaged plugin /mattermost/prepackaged_plugins/mattermost-plugin-nps-v1.3.2-linux-amd64.tar.gz: installExtractedPlugin: Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name., destination already exists

ERR app/plugin.go:966 > timestamp=2023-11-20 14:22:42.669 +01:00 msg=Failed to install prepackaged plugin bundle_path=/mattermost/prepackaged_plugins/mattermost-plugin-channel-export-v1.0.0-linux-amd64.tar.gz error=Failed to install extracted prepackaged plugin /mattermost/prepackaged_plugins/mattermost-plugin-channel-export-v1.0.0-linux-amd64.tar.gz: installExtractedPlugin: Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name., destination already exists

ERR app/plugin.go:966 > timestamp=2023-11-20 14:22:42.832 +01:00 msg=Failed to install prepackaged plugin bundle_path=/mattermost/prepackaged_plugins/mattermost-plugin-apps-v1.2.2-linux-amd64.tar.gz error=Failed to install extracted prepackaged plugin /mattermost/prepackaged_plugins/mattermost-plugin-apps-v1.2.2-linux-amd64.tar.gz: installExtractedPlugin: Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name., destination already exists

ERR app/plugin.go:966 > timestamp=2023-11-20 14:22:42.932 +01:00 msg=Failed to install prepackaged plugin bundle_path=/mattermost/prepackaged_plugins/mattermost-plugin-playbooks-v1.38.1-linux-amd64.tar.gz error=Failed to install extracted prepackaged plugin /mattermost/prepackaged_plugins/mattermost-plugin-playbooks-v1.38.1-linux-amd64.tar.gz: installExtractedPlugin: Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name., destination already exists

I have the docker hosts’s volumes mounted like this into the container:

      - ${MATTERMOST_PLUGINS_PATH}:/mattermost/plugins:rw
      - ${MATTERMOST_CLIENT_PLUGINS_PATH}:/mattermost/client/plugins:rw

and apart from that error, there are no apparent problems, except Jira “loosing its token” some hours after the container was started and Jira notifications were handled without problems:

ERR app/plugin_api.go:980 > timestamp=2023-11-20 12:47:47.993 +01:00 msg=PostNotifications: error while getting jiraClient, err: failed to get a Jira client for : no access token, please use /jira connect plugin_id=jira

→ restart the container and everything is back to normal

(that’s why I first wanted to update the jira plugin to latest)

Hello Arminus,

Thank you for reaching out on the Mattermost peer-to-peer forums and providing such a detailed post regarding your issues with plugin updates on your self-hosted 9.0.0 instance.

It seems like your Mattermost instance is having issues moving extracted plugins from a temporary directory to their final destination. You’re getting errors saying that “Another plugin may be using the same directory name, destination already exists.”

Here are a few steps you can take to troubleshoot:

  1. Check for Directory Issues: You may want to manually check the directories mentioned in the error logs, specifically /mattermost/prepackaged_plugins/ and /mattermost/plugins. Ensure that there are no residual or uncompleted installations left in these directories. Clear out any data from a previous installation that failed or was not completed.

  2. Verify Permissions: Confirm if the permissions on your Mattermost directories (especially the plugins directory) are set correctly for your instance and the admin account used to run Mattermost has the necessary access.

  3. Manual Updates: Try manually downloading and installing the newer versions of the plugins via the System Console. A point to note here - it would be a safer option to backup your data (especially the plugin configurations) before proceeding with this step.

  4. Investigate Docker Volume Mounts: The docker volumes for your plugins may be interfering with the installation process. Assuming the syntax being correct, check to make sure the MATTERMOST_PLUGINS_PATH and MATTERMOST_CLIENT_PLUGINS_PATH variables are correctly mapped to their respective paths.

  5. Address the Jira Token Issue: The error log you provided mentions Jira “losing its token”. Make sure the token isn’t expiring or being invalidated for some reason. You may want to reconnect with /jira connect, as suggested by the error log, once you’ve addressed the above issues.

If you continue to encounter issues after these steps, please provide us with further information about your setup, such as the OS you’re running Mattermost on, the version of Docker being used, and any other relevant details that might help us in diagnosing the issue.

Let’s work through this together to solve your problem and get those plugins updated.

Best,
~Mattermost AI Assistant :robot:

[Disclaimer: This was an AI assisted response powered by Mattermost AI. Were any of the above suggestions inaccurate? Let us know by replying to this comment!]