Results 1 to 9 of 9

Thread: Error deploying a custom package

  1. #1
    judgej is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    58

    Default Error deploying a custom package

    I have tried creating a custom package and a custom module that creates a relationship between Accounts and Contacts. This relationship is one that I intend to extend with contact roles.

    Now, when I hit the "deploy" button I get this following error message in a popup:

    Code:
    An error has occured during deploy process, your package may not have installed correctly.
    I'm using version 6.2.0beta4 (the latest for now). Is there anywhere I should be looking to try and find out what the error is? Any log files I should be looking in? I'm stumped because there are no further clues in the error message.

    Going to Admin->Module Loader, I can see the module to be deployed waiting there in the available modules section. If I try to install it from there I get this message:

    Code:
    ZIP Error(0): 0
    I can "publish" the module to a zip file, and can open up the zip file and see all the files in it. I'm on PHP 5.3 and running under Linux.

    -- Jason

  2. #2
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: Error deploying a custom package

    Did you have a look into file named 'sugar.log'?
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  3. #3
    judgej is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    58

    Default Re: Error deploying a custom package

    Quote Originally Posted by sts View Post
    Did you have a look into file named 'sugar.log'?
    Nope, no sign of that file. I'll dig through the code and see where it should be attempting to write that log file - perhaps it lacks write permission (though it shouldn't, as I have given apache write permission to everything in the installation, just to try and get over these kinds of hurdles).

    -- Jason

  4. #4
    judgej is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    58

    Default Re: Error deploying a custom package

    According to Admin->System Settings->Logger Settings, it should be logging down to debug level to "sugarcrm.log", but the log file is not being created at all.

    Actually, going back in, I realise the logger settings are not sticking when I save the settings screen, so there is something broken there,

  5. #5
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: Error deploying a custom package

    oops ... sorry, my fault.
    Yes, the file is named 'sugarcrm.log' by default. You should find it in the root directory of your sugar installation (if existing).
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  6. #6
    sts's Avatar
    sts
    sts is offline Sugar Community Member
    Join Date
    Aug 2010
    Posts
    978

    Default Re: Error deploying a custom package

    Here is the logger documentation (for version 6.1 in that case but as far as I know there was no change in the last releases):
    http://developers.sugarcrm.com/docs/...k.html#9000163

    The log-level can be set in the admin->system settings.
    Stefan Ulrich Sauer
    System Analyst

    Devoteam Danet GmbH
    Gutenbergstraße 10
    D-64331 Weiterstadt
    Germany
    email: Stefan-Ulrich.Sauer@devoteam.com
    http://www.devoteam.de

  7. #7
    judgej is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    58

    Default Re: Error deploying a custom package

    apache did not have write permission on config.php, so the system settings were not getting written to it. I've corrected that and now can see the log file. It grows rather quick at the "debug" level - even when I'm not doing anything, which I guess is cron (judging by the regularity of log updates).

    There are certainly no ERROR level log entries when I attempt to install the module or deploy the package.

    Update: not WARNING level log entries either.

    Update: DEBUG and INFO gives me lots of information on queries and hooks, but nothing that seems directly connected with the errors.
    Last edited by judgej; 2011-04-28 at 10:56 PM.

  8. #8
    judgej is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    58

    Default Re: Error deploying a custom package

    Looking through the apache logs, the zip error is from line 64 of include/utils/php_zip_utils.php:

    Code:
    $res = $zip->extractTo($zip_dir);
    This uses the PHP ZipArchive object to unzip the module. It is passed the correct zip source, and the correct destination, and gets as far as extracting the images folder and the manifest.php script, then then stops with this error (with full paths removed to protect the innocent):

    Code:
    PHP Warning:  ZipArchive::extractTo(/myhttproot/cache/upload/upgrades/temp/AwpWNZ/) [<a href='ziparchive.extractto'>ziparchive.extractto</a>]: failed to open stream: Is a directory in /myhttproot/include/utils/php_zip_utils.php on line 64, referer: http://sugar.example.com/index.php?module=Administration&action=UpgradeWizard&view=module
    I'm on PHP 5.3, I have the zip file it is trying to extract, so will run some tests to see why it is having trouble. Winzip has no problem opening the archive. However some clues when trying to extract using the Linux command line:

    Code:
      inflating: manifest.php
       creating: icons/
       creating: icons/default/
       creating: icons/default/images/
      inflating: icons/default/images/Createcrole_contact_roles.gif
      inflating: icons/default/images/crole_contact_roles.gif
      inflating: icons/default/images/icon_Crole_contact_roles.gif
      inflating: icons/default/images/icon_crole_contact_roles_32.gif
    warning:  skipped "../" path component(s) in icons/default/images/../
    warning:  skipped "../" path component(s) in icons/default/../
    warning:  skipped "../" path component(s) in icons/../
    warning:  skipped "../" path component(s) in ../
    ...
    Aha - so the zip archive created by the module builder contains ".." as parts of paths. It looks to me like the zip archive is not being generated correctly.

    Since this is beta, is there somewhere I should be reporting this?

    -- Jason

  9. #9
    judgej is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    58

    Default Re: Error deploying a custom package

    Just to add, the command-line unzip is happy to skip over the invalid directory entries and continues to unzip the whole archive. The PHP ZipArchive object just aborts at the first sign of trouble.

    To try this out, I replaced the PHP unzip command (the "$res = $zip->extractTo($zip_dir);" on line 64) with this:

    Code:
    system("/usr/bin/unzip $zip_archive -d $zip_dir"); 
    $res = true;
    and the module deployed! :-)

    -- Jason
    Last edited by judgej; 2011-04-30 at 02:39 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Serious error when deploying custom module
    By dukeofgaming in forum Help
    Replies: 5
    Last Post: 2011-01-08, 10:34 PM
  2. Deploying package abc hourglass
    By acomber in forum Developer Tutorials
    Replies: 1
    Last Post: 2010-09-13, 09:06 AM
  3. Why does deploying Package delete custom files?
    By dvelguru in forum Developer Help
    Replies: 4
    Last Post: 2010-01-20, 06:13 PM
  4. Need help for deploying custom module
    By vivek6151 in forum Help
    Replies: 3
    Last Post: 2009-10-07, 11:28 AM
  5. Deploying a package deletes role actions
    By djmorton in forum Developer Help
    Replies: 11
    Last Post: 2009-03-20, 10:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •