Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marketplace - module files deleted if license key cannot be retrieved #4967

Closed
marc-farre opened this issue Mar 18, 2021 · 4 comments
Closed
Labels

Comments

@marc-farre
Copy link
Collaborator

marc-farre commented Mar 18, 2021

What steps will reproduce the problem?

  1. Buy a module on the marketplace
  2. Enter the license key in Humhub (marketplace/purchase)
  3. Install, activate the module and activate it in a space
  4. Set a Firewall on the server preventing some communications with Humhub's server (I cannot tell you which ones, it's a client that have had the problem)
  5. When an update of the module is available, update it

What is the expected result?

As the firewall (or temporary loss of internet connection ?) prevents checking the license key on Humhub's server, tell the administrator that the license key cannot be checked, so module cannot be upgraded.

What do you get instead?

The module's files and directory are deleted on the server but the module is not desactivated.
So if you return in the space, Humhub crashes.

Other possibility : if some events are defined in config.php, as Humhub's cache is not purged, Humhub tries to read Events.php file to execute the functions, but as the file is deleted, Humhub crashes.

In both cases, it is not possible to deactivate the module in the marketplace. The only solution is to put back the module's files via FTP.

Q A
HumHub version 1.7
@luke-
Copy link
Contributor

luke- commented Mar 18, 2021

@funkycram So the problem occurs when updating the module?

Can you check if the module download worked correctly?
/protected/runtime/module-downloads

If the module files were removed but not reinstalled, there must be an error in the log about it.

In such a case, reinstalling the module should fix the problem. Is the install option displayed when "Browse Online" to the module?

@marc-farre
Copy link
Collaborator Author

Difficult to answer to theses questions as the problem occurred to a client, but I don't have any account on his Humhub.

But I think I can reproduce the problem that way:

  1. On a mule bought on the marketplace, edit module.json file and downgrade version
  2. In https://partner.humhub.com/ remove the licence for this Humhub
  3. Go in /marketplace/update: it tells you that you can update the module
  4. Update the module
  5. It crashes with this error log:

yii\web\HttpException: Download of module failed! (fopen(/var/www/humhub-jdn/protected/runtime/module_downloads/): failed to open stream: Is a directory) in /var/www/humhub-jdn/protected/humhub/modules/marketplace/components/OnlineModuleManager.php:71 Stack trace: #0 /var/www/humhub-jdn/protected/humhub/modules/marketplace/components/OnlineModuleManager.php(173): humhub\modules\marketplace\components\OnlineModuleManager->install('show_content') #1 /var/www/humhub-jdn/protected/humhub/modules/marketplace/controllers/UpdateController.php(81): humhub\modules\marketplace\components\OnlineModuleManager->update('show_content') #2 [internal function]: humhub\modules\marketplace\controllers\UpdateController->actionInstall() [...]

In /protected/runtime/module_downloads the module have not been downloaded.

In the database, in the table module_enabled, the module is still present.

If I register again the module in marketplace/purchase/list, I can install it again and it works.
Or if I manually upload again the files of the module, it works to.

@ArchBlood
Copy link
Contributor

If the module's license key is removed from the partner's site then it stands to reason that it would throw an error, but in my opinion, there should be a check for a valid license key that should be checked in this case, am I correct? If it passes the check then an update should be available to install, if not then an update should not be displayed 🤔

@luke-
Copy link
Contributor

luke- commented Mar 19, 2021

Fixed here: #4978

@luke- luke- closed this as completed Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants