I installed module builder on my local wamp, folder paths are given then i get a list of APIs then when i click on update "problem loading page with message "The connection was reset"

Comments

inteja’s picture

Same issue here. XAMPP running on Windows 7.

inteja’s picture

More info:

Going to admin/modules/module_builder

I get error message "No hooks were found. Please check the documentation path specified in the Administer >> Site configuration >> Development >> Module builder page."

And the page is blank other than the text "This page allows you to generate the files for a custom module with scaffolding code for hook implementations."

On going to admin/config/development/module_builder

The hooks folder is correct (and there are actually "*.api.php" files in /sites/default/files/hooks).

However, on going to admin/config/development/module_builder/update

I get the contradictory information:

The hook documentation has not yet been downloaded.

You have the following hook definition files saved in public://hooks:

  • aggregator.api.php
  • block.api.php
  • comment.api.php
  • etc
  • etc

When I click the Update button, I get "The connection was reset error".

inteja’s picture

I tried running "drush mbdl" and that did work. It downloaded api files again, hooks_processed.php was successfully created and module builder now works as expected.

So, the above seems to be an issue just with the web interface when updating and processing hooks.

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Are you actually on 7 or on 6?

On 7 no downloading is actually done.

inteja’s picture

Definitely Drupal 7.12 and Module Builder 7.x-2.x-dev (2012-Mar-19)

inteja’s picture

I just rechecked /sites/default/files/hooks/

And the downloaded *.api.php files have the same timestamp as the generated hooks_processed.php

The files are being downloaded, as I didn't put them there. Maybe some legacy code or functions from the 6.x version?

Jon Nunan’s picture

I came across this as well, from what I can gather 'system.api.php' is too big for the 'preg_match_all' call in the _module_builder_process_hook_file function.

I tested this by removing the file from $hook_files:

function module_builder_update_data() {
  // Update the hook documentation.
  module_builder_include('update');
  $hook_files = module_builder_update_documentation();
  //CHANGE: unset the large system.api.php 
  unset($hook_files['system.api.php']);
  // Process the hook files.
  module_builder_include('process');
  module_builder_process_hook_data($hook_files);

  return TRUE; // FTW!
}

With it gone, everything seems to work. Well, except of course, system hooks are missing in the builder.

I think it must have something to do with PCRE setting in XAMPP. I tried adding some 0's to the following in php.ini

pcre.backtrack_limit=1000000
pcre.recursion_limit=1000000

but it still crashed php. I'm just going to manually add any hooks I need from system.api.php and leave it at that.

terikon’s picture

I had same issue.
According to this:
http://stackoverflow.com/questions/6382330/does-this-php-code-crash-apac...
you should decrease value of pcre.backtrack_limit .
I set it to 500, and it didn't crash.
For some reason now I get following error after this:
Notice: Undefined offset: 1 in module_builder_update_documentation() (line 82)
and module builder doesn't build any hooks except of hook_help. But at least update doesn't crash php.

mlg4035’s picture

Issue summary: View changes

I had this same exact issue (Windows 7 with XAMPP, Drupal 7.55) and setting pcre.backtrack_limit and pcre.recursion_limit to 500 as terikon suggested in #8 resolved the problem for me!

Thx all!