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

Modules that have "requires" sometimes disappear #1011

Open
somatonic opened this issue Mar 11, 2015 · 50 comments
Open

Modules that have "requires" sometimes disappear #1011

somatonic opened this issue Mar 11, 2015 · 50 comments

Comments

@somatonic
Copy link

See this thread that is currently a problem with language profile and issue with LanguageSupportTabs
https://processwire.com/talk/topic/8646-problem-with-module-languagetabs-dependecy/

I have same issues in other installs with ProcessLoginHistoryHooks that also has a "requires" dependency.
https://processwire.com/talk/topic/2082-module-process-login-history/?p=88573

Seems like somethings broken with the module dependencies that should be tracked ASAP, as it makes it unpredictable that module just dissapear.

@LostKobrakai
Copy link

I do have the same problem the second time on a clients website. Both times the "LanguageSupportFields" module disappeared after clicking "Refresh" from the dropdown menu. Each time I had just uploaded a new autoload module beforehand via ftp.

The site is maintained by another developer, who has not worked with processwire as much as I have, and it's really not nice to have to ask for the backups again.
screenshot 2015-03-11 17 42 47

@ryancramerdesign
Copy link
Owner

@LostKobrakai: Was that just for a single request after uploading the module, or does the error re-appear on every page load after that? While I've not seen that myself, it's not unexpected that wiping the modules cache may cause some autoload modules to not load for one request. But what's odd is that PW does a redirect immediately after so that you don't have to see the stuff that appears in your screenshot. It looks to me like that redirect isn't occurring in your case. Is it possible some autoload module generated some output (even whitespace) that got sent? That would prevent a redirect header from functioning.

@somatonic: The LanguageTabs issue was fixed several dev versions back (and I was able to reproduce that one at the time). If you are still seeing the issue, double check that you don't have a copy of language tabs in /site/modules/. If still seeing it, can you tell me what other modules are installed in /site/modules/? As for other modules, the situation you describe can occur when you have an autoload module that has a "requires" for a non-autoload module. That dependency can't be fulfilled, so the autoload module isn't able to load at all. Would this be the case with the login history module you are talking about?

@LostKobrakai
Copy link

It's persistent, but could a hook to LazyCron cause this, when lazycron is not installed?

Edit: the module was installed before the refresh, too. Noticed the missing LazyCron only now after reading your post.

@ryancramerdesign
Copy link
Owner

I don't think LazyCron should matter. Hooks to modules that never run are simply ignored. What other modules are installed in /site/modules/?

@ryancramerdesign
Copy link
Owner

Do you see that "Array Array Array" that appears in your nav on every page load in the admin? Just wondering what that is. Seems like something is very amiss in that screenshot. :)

@LostKobrakai
Copy link

screenshot 2015-03-11 20 26 06
The FormBuilder* modules are my custom ones.

@LostKobrakai
Copy link

By now I always thought, that the Array stuff does appear, because the multilanguage module got lost.

@ryancramerdesign
Copy link
Owner

What are the dependencies for those language-related modules: ProcessLanguageTranslatorPlus and LanguageInstantInstall? Are either autoload?

I need to setup something that lets us temporary disable autoload modules on an individual basis so that we can more easily debug this kind of stuff... I think that's what I'll work on now.

@LostKobrakai
Copy link

Just had a look at the backend few aren't even installed.

Modesta
LanguageInstantInstall
ModulesManagerNotification
LangaugeTranslatorPlus
RenderValueShowIfHack

@LostKobrakai
Copy link

Just got a replay from the dev maintaining the site. He said changing one line in the database fixed it again. Dumps here: https://www.dropbox.com/sh/8hzc5t6cg7etjso/AAA1iETXNaOWpuKlRjdZ_-Hfa?dl=0

Why can't I upload textfiles here…

@ryancramerdesign
Copy link
Owner

I can't seem to access that link. Can you describe what database change fixed it?

@LostKobrakai
Copy link

Just managed to get a usefull diff out of these files.

--- /Users/Benni/Dropbox/GitHub/works.txt
+++ /Users/Benni/Dropbox/GitHub/works_NOT.TXT
@@ -16,10 +16,6 @@
 \"178\":{\"name\":\"ProcessLanguage\",\"title\":\"Languages\",\"version\":102,\"icon\":\"language\",\"requires\":[\"LanguageSupport\"],\"requiresVersions\":{\"LanguageSupport\":[\">=\",0]},
 \"installs\":[],\"permission\":\"\",\"permissions\":[],\"autoload\":false,\"singular\":1,\"created\":1423299722,\"installed\":true,\"useNavJSON\":true},
 \"177\":{\"name\":\"LanguageSupport\",\"title\":\"Languages Support\",\"version\":103,\"icon\":\"\",\"requires\":[],\"requiresVersions\":[],\"installs\":[\"ProcessLanguage\",\"ProcessLanguageTranslator\"],\"permission\":\"\",\"permissions\":[],\"autoload\":true,\"singular\":true,\"created\":1423299722,\"installed\":true},
-\"184\":{\"name\":\"LanguageTabs\",\"title\":\"Languages Support - Tabs\",\"version\":111,\"icon\":\"\",\"requires\":[\"LanguageSupport\"],\"requiresVersions\":{\"LanguageSupport\":[\">=\",0]},
-\"installs\":[],\"permission\":\"\",\"permissions\":[],\"autoload\":\"template=admin\",\"singular\":true,\"created\":1423300086,\"installed\":true},
-\"180\":{\"name\":\"LanguageSupportFields\",\"title\":\"Languages Support - Fields\",\"version\":100,\"icon\":\"\",\"requires\":[\"LanguageSupport\"],\"requiresVersions\":{\"LanguageSupport\":[\">=\",0]},
-\"installs\":[\"FieldtypePageTitleLanguage\",\"FieldtypeTextareaLanguage\",\"FieldtypeTextLanguage\"],\"permission\":\"\",\"permissions\":[],\"autoload\":true,\"singular\":true,\"created\":1423299745,\"installed\":true},
 \"182\":{\"name\":\"FieldtypePageTitleLanguage\",\"title\":\"Page Title (Multi-Language)\",\"version\":100,\"icon\":\"\",\"requires\":[\"LanguageSupportFields\",\"FieldtypeTextLanguage\"],\"requiresVersions\":{\"LanguageSupportFields\":[\">=\",0],\"FieldtypeTextLanguage\":[\">=\",0]},
 \"installs\":[],\"permission\":\"\",\"permissions\":[],\"autoload\":false,\"singular\":true,\"created\":1423299745,\"installed\":true},
 \"121\":{\"name\":\"ProcessPageEditLink\",\"title\":\"Page Edit Link\",\"version\":108,\"icon\":\"link\",\"requires\":[],\"requiresVersions\":[],\"installs\":[],\"permission\":\"page-edit\",\"permissions\":[],\"autoload\":false,\"singular\":1,\"created\":0,\"installed\":true,\"permanent\":true},
@@ -137,6 +133,7 @@
 \"191\":{\"name\":\"BatchChildEditor\",\"title\":\"Batch child editor\",\"version\":32,\"icon\":\"child\",\"requires\":[],\"requiresVersions\":[],\"installs\":[],\"permission\":\"\",\"permissions\":[],\"autoload\":true,\"singular\":false,\"created\":1424874425,\"installed\":true,\"permanent\":false},
 \"168\":{\"name\":\"ModulesManager\",\"title\":\"Modules Manager\",\"version\":216,\"icon\":\"\",\"requires\":[\"JqueryDataTables\"],\"requiresVersions\":{\"JqueryDataTables\":[\">=\",0]},
 \"installs\":[],\"permission\":\"modules-manager\",\"permissions\":[],\"autoload\":false,\"singular\":true,\"created\":1421233793,\"installed\":true},
+\"200\":{\"name\":\"FormBuilderFileDownload\",\"title\":\"Form Builder File Download\",\"version\":2,\"icon\":\"\",\"requires\":[],\"requiresVersions\":[],\"installs\":[],\"permission\":\"\",\"permissions\":[],\"autoload\":true,\"singular\":true,\"created\":1425557642,\"installed\":true,\"required\":[\"FormBuilder\",\"LazyCron\"]},
 \"190\":{\"name\":\"InputfieldFormBuilderFile\",\"title\":\"File (for FormBuilder)\",\"version\":1,\"icon\":\"\",\"requires\":[\"FormBuilder\"],\"requiresVersions\":{\"FormBuilder\":[\">=\",0]},
 \"installs\":[],\"permission\":\"\",\"permissions\":[],\"autoload\":false,\"singular\":0,\"created\":1424418947,\"installed\":true},
 \"188\":{\"name\":\"FormBuilder\",\"title\":\"Form Builder\",\"version\":24,\"icon\":\"\",\"requires\":[],\"requiresVersions\":[],\"installs\":[\"ProcessFormBuilder\",\"InputfieldFormBuilderFile\"],\"permission\":\"\",\"permissions\":[],\"autoload\":true,\"singular\":true,\"created\":1424418946,\"installed\":true},

@ryancramerdesign
Copy link
Owner

I'm reading from a cellphone here so might be missing something, but looks like the cached lines for LanguageTabs and LanguageSupportFields were removed, and a line for FormBuilderFileDownload was added? I would think those two Language module lines got added right back after a modules refresh. Though if it's working now, it would be interesting to know what's different (if anything) between how the entries are for those modules (184 and 180) now versus what's here in that diff.

@LostKobrakai
Copy link

The diff is maybe confusing as it's actually inverse. If I got that right, then the 2 language rows didn't get added back to the cache and instead the FormBuilderFileDownload was in the cache. After adding the language modules back in and removing the FormBuilderFileDownload it worked again. One thing I notices I had this \"required\":[\"FormBuilder\",\"LazyCron\"] in the module's information while it should be requires. Could this be the reason?

@ryancramerdesign
Copy link
Owner

Its still quite a mystery. How did you know what lines to add to the
modules cache? I don't think the form builder stuff matters, but I will
definitely look into the requires vs required. Most likely just a typo in
the form builder module that doesn't matter. That modules cache gets
rebuilt every time you click refresh, so removing/replacing lines wouldn't
last long. Still, the more info we can find the better, even if still
mysterious at the moment.
On Mar 11, 2015 5:25 PM, "Benjamin Milde" notifications@github.com wrote:

The diff is maybe confusing as it's actually inverse. If I got that right,
then the 2 language rows didn't get added back to the cache and instead the
FormBuilderFileDownload was in the cache. After adding the language modules
back in and removing the FormBuilderFileDownload it worked again. One thing
I notices I had this "required":["FormBuilder","LazyCron"] in the
module's information while it should be requires. Could this be the
reason?


Reply to this email directly or view it on GitHub
#1011 (comment)
.

@LostKobrakai
Copy link

As I had created this error the second time I emailed Markus ( the other dev) to look for the database backups and this where the only differences before and after the refresh from the database side. I just created the install locally and can't even get it to behave like this.

@wanze
Copy link

wanze commented Mar 12, 2015

I think this is related to: #905

@ryancramerdesign
Copy link
Owner

Yeah it does sound like the same issue. I sure wish I could find a way to reproduce this one. There seems to be something there, but I've yet to see it occur myself. #905 seemed to have some talk of ModulesManager. @LostKobrakai does the installation where you saw the error have ModulesManager? I can't imagine it would matter, but I don't have a way to debug this yet.

@LostKobrakai
Copy link

Jep, ModulesManager is installed there.

@outflux3
Copy link

if i recall correctly, both times i was using modules manager; once i was updating procache from v1 to v2 and it knocked out the reno

@wanze
Copy link

wanze commented Mar 12, 2015

In my case I lost one of my modules (Pages2Pdf) and I don't have ModulesManager installed. It happened after installing another module (manually copied module files, then installed via the admin).

@apeisa
Copy link
Contributor

apeisa commented Mar 12, 2015

Also have had these problems without ModulesManager. Never really understood which causes these problems and how to reproduce, so far they feel totally random. Only hunch is that there is always "requires", "installs" etc. dependencies in play.

@LostKobrakai
Copy link

I just got my local "debug" installation of the site to not show my own module. Maybe I can now help out with information.

ryancramerdesign added a commit that referenced this issue Mar 12, 2015
@ryancramerdesign
Copy link
Owner

Thanks, good to hear, I'll think of more things to try if the latest update doesn't fix it. I've gone through and basically revisited all the parts involved and recoded some parts (in wire/core/Modules.php). But I'm flying blind with regard to this particular issue, since I'm not seeing it here. So just shooting in the dark, hoping I might nail the issue one way or another. Hopefully I didn't break anything. Would you mind giving it a try? Once installed, you'll want to do a Modules > Refresh and click around to another page, then check to see if your module is still gone. Thanks.

@LostKobrakai
Copy link

The update didn't solve it. The module is still gone.

@LostKobrakai
Copy link

I just noticed, that every few seconds this gets logged: Module 'FormBuilderFileDownload' dependency not fulfilled for: LazyCron, which is true. But it's still not visible in the modules section of the page. In the caches table it's path can be found in this row Modules.site/modules/.

@ryancramerdesign
Copy link
Owner

For the module that's gone, what does it state in its getModuleInfo() for the 'requires' property? Is the moduleInfo provided via a getModuleInfo() method or a info.json or info.php file?

@LostKobrakai
Copy link

<?php
class FormBuilderFileDownload extends WireData implements Module, ConfigurableModule {

    public static function getModuleInfo() {

        return array(
            'title' => 'Form Builder File Download', 
            'version' => 2, 
            'summary' => 'Extentions for Form Builder, developed for Made Projects',
            'singular' => true, 
            'autoload' => true,
            'requires' => array("FormBuilder", "LazyCron")
            );
    }
…

@ryancramerdesign
Copy link
Owner

Those two modules installed or uninstalled? I'm going to try and duplicate
same setup here.
On Mar 12, 2015 12:52 PM, "Benjamin Milde" notifications@github.com wrote:

'Form Builder File Download', 'version' => 2, 'summary' => 'Extentions for Form Builder, developed for Made Projects', 'singular' => true, 'autoload' => true, 'requires' => array("FormBuilder", "LazyCron") ); } — Reply to this email directly or view it on GitHub https://github.com//issues/1011#issuecomment-78525052 .

@LostKobrakai
Copy link

FormBuilder is installed and LazyCron is not.

@ryancramerdesign
Copy link
Owner

I just tried to duplicate it but didn't have any luck. Here's the test module I used. I started with FormBuilder installed and LazyCron uninstalled. When I did a modules > refresh, it showed up on the "New" tab but wasn't installable, stating it "requires LazyCron". I installed LazyCron, then installed the module.

class FormBuilderFileDownload extends WireData implements Module, ConfigurableModule {
        public static function getModuleInfo() {
                return array(
                        'title' => 'Form Builder File Download',
                        'version' => 2,
                        'summary' => 'Extentions for Form Builder, developed for Made Projects',
                        'singular' => true,
                        'autoload' => true,
                        'requires' => array("FormBuilder", "LazyCron")
                        );
        }
        public function init() { }
        public function ready() { }
        public static function getModuleConfigInputfields(array $data) {
                return new InputfieldWrapper();
        }
}

Is my test module above missing any key parts you can think of that might help to reproduce the issue? Where is the location of the module file on your file system? Mine was /site/modules/FormBuilderFileDownload.module

@LostKobrakai
Copy link

The path is this: /site/modules/FormBuilderFileDownload/FormBuilderFileDownload.module I'll try to get it replicated on a own fresh install, because it was a bit of moving different module folders around to get to it.

@LostKobrakai
Copy link

I got it to disappear on a fresh installation by having only FormBuilder installed. Then I installed FormBuilderFileDownload with the typo required. Then I moved the module's folder out of site/modules, hit refresh to clear the cache, moved the folder back, fixed the typo to requires and hit refresh again and it didn't reappear.

@ryancramerdesign
Copy link
Owner

Was the module visible to PW when it had the typo? Are you sure the module
directory and file are readable to Apache?

On Thu, Mar 12, 2015 at 1:37 PM, Benjamin Milde notifications@github.com
wrote:

I got it to disappear on a fresh installation by having only FormBuilder
installed. Then I installed FormBuilderFileDownload with the typo required.
Then I moved the module's folder out of site/modules, hit refresh to
clear the cache, moved the folder back, fixed the typo to requires and
hit refresh again and it didn't reappear.


Reply to this email directly or view it on GitHub
#1011 (comment)
.

@LostKobrakai
Copy link

Jep, otherwise I couldn't have installed it (easily…). Chmod is /modules(755)/Form…(755)/Form….module(644)

@ryancramerdesign
Copy link
Owner

I tried what you mentioned about taking that module, giving it a typo for 'required' and refresh, then move it out somewhere else, refresh, then move it back in and fix the typo, refresh, but still not able to reproduce it. I tried it on 2 installations, one blank, and one with a lot of stuff in it (including FormBuilder). Somehow ProcessWire can't see the file, but it's still a large mystery as to why. It sounds like you were looking at those cache tables before. The FormBuilderFileDownload should appear in the ModulesUninstalled cache. That's where PW keeps track of modules that it found on the file system, but not yet installed.

@outflux3
Copy link

i can confirm that the disappearing Reno happens on sites without formbuilder;
not sure if the disappearing reno is totally related to this issue, but in short, the result is that you end up with a module entry in the modules table, but not in the caches, and consequently somehow that prevents the module from loading;

@LostKobrakai
Copy link

Did you install it with the typo already in place? I think that's the key, moving the folder of the installed module away. Then hitting refresh should notice the missing module and remove it's database entry. But if it's dragged back with the typo fixed it errors because of the missing required lazycron (log entry) and because ProcessWire seems to still have it listed as "installed" (caches db, but could also be only the refresh after adding it back). It's just not listed in any way in modules section of the backend.

@ryancramerdesign
Copy link
Owner

I didn't install the module with the typo in place before. Just started over with the blank profile, installed it with the typo in place, moved it out, refresh, fixed typo, moved it back in, refresh. Then I get the error message:

Module 'FormBuilderFileDownload' dependency not fulfilled for: FormBuilder, LazyCron

But that's the correct error message. Basically, PW doesn't know the scope of that dependency so it's not taking risks. It might be a class-extending dependency for all it knows. So it prefers not to touch the file at that point (one of the reasons PW now supports separate info.json/info.php files). If it did, you might then have a fatal error from PHP that PW could not catch (as would be the case with a class extending dependency). So at that point you'd have to meet the dependencies in order to get the module back on your screen. It can't show you the module in your modules list because there's nothing you can do with it. You can't safely uninstall the module because it would have to instantiate the module file to do so (to call its uninstall method). The only ways around this are to meet the dependency or remove the file.

@kfrp
Copy link

kfrp commented Mar 12, 2015

Hi, I just wanted to add (as another datapoint) that AdminThemeReno disappeared when I detected the Procache module. Reported it in the Procache support forum and was guided to this threaded. I was using PW dev 2.5.21 and Procache latest (2.01).

@ryancramerdesign
Copy link
Owner

I was thinking the issue with FormBuilderFileDownload was likely the same thing as what some have seen with AdminThemeReno and LanguageTabs. But now thinking it's something different, because the disappearance of the module in the scenario described above makes sense. But the disappearance of LanguageTabs or AdminThemeReno still doesn't make sense. So I'm still keeping my fingers crossed that today's updates may have fixed that issue.

If anyone sees the issue still turn up with AdminThemeReno or LanguageTabs after the latest updates, please let me know. Or if you were seeing it before and now no longer seeing it, would be interested in that too. :) In either case, one won't be able to tell until doing a Modules > Refresh once or twice though.

@kfrp
Copy link

kfrp commented Mar 12, 2015

PS: I just tried uploading Procache on a fresh install (2.5.22 dev) and AdminThemeReno was fine.

@ryancramerdesign
Copy link
Owner

That's a good sign! Thanks for testing.

@LostKobrakai
Copy link

Hopefully I recreated the same error as on the real page. I'll check the logs. But this error should really be more prominent. I found the errormessage, that you got, too, just because I've actively looked into the log files, but I never got the error message via the system notifcations.

@ryancramerdesign
Copy link
Owner

If you've got debug mode on, you should see it in a red banner across the top of every admin page. But it's not a fatal error (or even a problem to normal operation), so probably not something you want every person in the admin seeing on every page. I know it can be a concern having debug mode on production sites. You might want to enable the $config->debugIf option so that debug mode shows for you, but not for other users on the site.

Thank you for the testing help today. Even though it may have turned out to be a different issue than the original, I think it helped greatly in [hopefully] solving the AdminThemeReno/LanguageTabs/etc. module issue. Though it remains to be seen whether that issue is really fixed... but as much code as I rewrote today, I'm holding out some hope that it is. :)

@wanze
Copy link

wanze commented Mar 13, 2015

https://processwire.com/talk/topic/9362-strange-language-problem-after-installing-module/
The bug seems to be still there, dev 2.5.22

ryancramerdesign added a commit that referenced this issue Mar 13, 2015
… where the issue was occurring, and so finally I was able to see it in action, and that made it easy to pinpoint and fix the issue (at least the one that was occurring in this particular site profile). If anyone else has experienced the issue, please give this commit a try to see if it also fixes it for you. Thanks.
@brightdroid
Copy link

For me it seems to be fixed with 84be3e4

@ryancramerdesign
Copy link
Owner

Good to hear, thanks!

On Fri, Mar 13, 2015 at 8:02 AM, Christoph Roeder notifications@github.com
wrote:

For me it seems to be fixed with 84be3e4
84be3e4


Reply to this email directly or view it on GitHub
#1011 (comment)
.

@somatonic
Copy link
Author

Finally! Let's hope! 💃

@tbba
Copy link

tbba commented Mar 19, 2015

I think that this could be related? Not sure. I had the HannaCodeHelper installed and working for a while. This morning, without having seen an error note before, the module was de-installed and even disappeared from the list of installable modules (its files are still existent within the site/modules folder).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants