An error has occured

I am installing a third party module from Module loader and after it is done, Studio stops working. Every module I click on studio, shows the popup of An error has occurred.

I traced the error and its coming from ModuleBuilder.js and throwing the exception. I am attaching the screen shot of error screen.

Also, If I uninstall the that module, Studio starts working fine.

what is done wrong here? Any help would be super helpful.

Which 3rd party module is that? There was recently a similar thread here, that’s why I am asking.

1 Like

Some module developed by my company. It has very few lines of code in it.

And can you please redirect me to that similar thread?

:question: I already included the link right there in my post :point_up:

Try removing the add-on and see if it changes things. A missing delimiter in one file is enough to cause what you’re seeing.

Anyway, start with a Quick Repair and Rebuild, and some JS rebuilds, that might be enough to fix things if it’s a transient issue like cache file corruption.

1 Like

As I told before, If I uninstall the module from Module loader, errors go away and Studio starts working fine again.

I tried

  • display_errors = off
  • Turn off Warnings and Notices
  • disable AjaxUI
  • Quick Repair and Build
  • Repair JS Files.

None of them are working for me except uninstalling the module. What should be my next step?

Go look for specific PHP errors in individual files of the module under custom dir.

If you’re lucky, you might have an error in your PHP log (not the suitecrm.log) telling you exactly where the issue is.

1 Like

This error showed up. I think it is the reason.

 [php7:warn] [pid 7824:tid 1816] [client ::1:65445] 
PHP Warning:  sugar_file_put_contents_atomic() : 
fatal rename failure 'C:\\xampp\\htdocs\\SuiteCRM\\cache\\modules\\Users\\tem5F4A.tmp' 
-> 'cache/modules/Users/Uservardefs.php' 
in C:\\xampp\\htdocs\\SuiteCRM\\include\\utils\\sugar_file_utils.php on line 228, 
referer: http://localhost/SuiteCRM/index.php?module=ModuleBuilder&action=index&type=studio


 [core:error] [pid 7824:tid 1812] (20024)The given path is misformatted or contained invalid characters: 
[client ::1:65458] AH00127: Cannot map GET /%22custom//themes//SuiteP//images//icon_home.png?v=EFvu0O1fG11WLcS5dTI2SQ\\%22 HTTP/1.1 to file, 
referer: http://localhost/SuiteCRM/index.php?module=ModuleBuilder&action=index&type=studio

I don’t know what to make of that. It looks strange and I’ve never seen anything like it.

This can be hard to trace because you’re are feeding some files (like vardefs, etc) into other PHP files. The latter breaks with an error, but the real cause if probably earlier, in the module files…

1 Like

Hi @faizan
you’re getting input from @pgr , who is well known on this forum as a very knowledgeable helper. My knowledge is only basic in comparison.

It may be helpful to getting good advice here - if you could let us know:
a) what level / length of time, of xperience you have of PHP; and of SuiteCRM’s PHP especially.
b) also, the same questions for your colleagues at work who passed you the module

And lastly - how confident are you they have passed to you a working module? Eg Have you seen it working in practise? Maybe on a different SuiteCRM instance? If so -what version of SuiteCRM/PHP.

1 Like

Hi @DJuser ,

Thank you for replying back. Here are the answers

a) with PHP, its 2+ years now, and with Suite CRM, now it is almost 2 months.
b) They have been working on SuiteCRM and PHP for 12+ years.

I was working on a working module, as it was working on every page except with the studio page,

Reason for interrupting the flow is still unknown, I just concluded that in studio, it first loads some icons, But this custom module was loading some icons of itself in Navbar, so maybe they collide?

I solved it by not running the UI_Footer logic hook when the module name is ModuleBuilder AND type is Studio.

Thanks for helping you both, specially @pgr .

Curious… can you share what was in that Custom UI_Footer logic? Maybe there’s a bug there (even if it only shows itself under specific conditions)

This is a very specific case. First we don’t know what their custom code is doing in order to trigger the issue… Second, based on the information provided the issue only occurs when your module is enabled, which means issues is not in SuiteCRM (at least on principle).

It will be good if you share the solution with the community and help others that might experience the same issue in the future.

Hey all,
I am dealing with this exact issue except nothing is logging to my logs, and the error is seemingly entirely random.
If I find a solution based on faizan’s solution, I will post it here.

This error displays when we add/call our custom script in the LogicHook file.
For fixing this error we need to add the Module Builder condition in the LogicHook.php file.

If you’ve any LogicHook file in /include then add Module Builder Condition as shown in the below screenshot.