SugarCRM ZuckerReports Encoded Settings

I love the reports we get out of SugarCRM now but ZuckerReports sometimes does things that throw me off for a while and then make me kick myself when I understand them later. Today’s case in point I needed to add someone to an existing scheduled report. Zucker (at the moment) does not have any facility for this, you just delete the old one and set up a new one, but I was not having any of this and dived into the database.

Now in the interface and the database the scheduled reports settings are “encoded” and it would appear that adding an e-mail address should have been straight forward. An example :

a:7:{s:10:”FooCoUsers”;s:8:”j.smiths”;s:6:”format”;s:3:”PDF”;s:15:”parent_category”;s:0:””;s:13:”parent_module”;s:0:””;s:9:”parent_id”;s:0:””;s:10:”send_email”;s:38:”d.badgers@fooco.com,j.smiths@fooco.com”;s:6:”record”;s:36:”44989f47-f46e-f334-c287-4c45cb79ff98″;}

Pretty obvious where the email addresses are and they simply appear to be comma separated. So all you do is add the email address in after the last one prefaced with a comma? Not quite…

If you do this then the report will fail silently and will not run and you will be digging around trying to find out what happened! 🙂

The Reason aka why you are here

Breaking down the report setting encoding is simple (not sure what the a7 bit is) but then you have inside the curly braces a number of data values each separated by a semi colon ( ; ) the values are in “quote marks” and then they are prefaced by an s:$: value. This value is the a number of characters inside the data quotes for that entry eg s:6:”record” because the word record is 6 letters long. In the case of the e-mail address list it is everything (including the commas) between the quote marks. If you don’t change the s:$: value for a record and change the value (unless the new data is exactly the same length) it will fail silently!

Anyway I hope this helps someone as I was fiddling with this for ages 🙂

UPDATED! G1 home, call button not working and lock not working FIXED WITHOUT RESET!

Hurrah,   this is a problem I have come across on my G1 a few times usually after the phone has powered off due the battery running out and each time I have had to hard reset to fix :-(  but today I found a way to restore functionality without having to reinstall everything.

Go to the market and install “Anycut” (which is free) then open it and create a new shortcut to an action.  In the action list scroll down to Setup Wizard (there will be about 4 of these) and select the last one.   Accept the name at the prompt and then exit to the home screen by using the back button repeatedly.

Anycut is no longer in the market but there is another free application called “dg QuickCut” which will do the job.

Install “dg QuickCut” and run it,  you will then want to “create a desktop shortcut”

Select Actions

Scroll down to Setup Wizard (there are three of these on mine)  and select the last one.

Return to the home screen and select the Icon you have just created.

This will bring up the setup wizard,  go through it and sign into your Google Account

After doing this it will start looping,  ie going back to the sign in but this does not matter as you can press the home key AND IT WILL WORK!

If the short cut takes you a point half way through the setup wizard,  run through it and then go back into dg Quick Cut and select a different startup wizard entry.


Find the Setup Wizard icon on your homescreen (it will be where ever it fits) and run it,   you may need to sign into your google account again and just follow the steps,  when it exits your phone should be working again 🙂

ADW.Launcher Crash!

ADW.Launcher is a wonderful application that replaces the home screen on Android and for us poor G1 owners, adds loads of features found in later versions of Android 🙂

This morning I turned my phone on and nothing, black blank screen, there is the status bar but nothing else 🙁 Could not load any apps or anything! HELP!

At this point I thought I was going to have to do a hard reset to get it back. Fortunately I decided to put it down and have a think before doing anything rash. What I needed to do was get into the Settings menu, but how?

The keyboard shortcuts was the key (if you forgive the pun) sadly there is no shortcut to the settings but it can be done.

Slide the keyboard out and press the Menu key and the B key. This brings up the browser, then press the search key (magnifying glass) button twice, this brings up the Search dialog box then type in Settings. Then a drop down search results box will appear and then you can select “Settings (Application)”. Then go into Applications -> ADW.Launcher and then in the Defaults part, click the Clear Defaults option. Then when you press the home button you can select Home instead of ADW.Launcher 🙂

Hurrah!

I then re-installed ADW.Launcher and everything is back to normal, lost the ADW.Launcher settings but I would rather have that that a hard reset.

BackupExec RALUS Woes

This had me tearing my hair out…. Jobs on some OpenSuSE machines were failing with :

Job ended: 14 June 2010 at 14:31:02
Completed status: Failed
Final error: 0xe00084af – The directory or file was not found, or could not be accessed.
Final error category: Job Errors

For additional information regarding this error refer to link V-79-57344-33967

and on a diff server :

Job ended: 14 June 2010 at 00:51:39
Completed status: Failed
Final error: 0xe0008488 – Access is denied.
Final error category: Security Errors

For additional information regarding this error refer to link V-79-57344-33928

Errors
Click an error below to locate it in the job log
Backup- \\192.168.199.200\[ROOT] V-79-57344-33928 – Access is denied.
Access denied to directory /.

Security errors? Access is denied? After a bit of digging I then went to the Backup Sources selection and tried to check credentials. This oddly connected to the machine but then on the next line failed to connect to the selection (v.odd especially as it uses the same connection for both). Anyhoo, after much hair pulling I discover that an NFS share, that is not part of any backup selection, was unmounted (it was non-production and I had taken it offline to do some work on it). This makes the RALUS agent fail. Interestingly it is not quite as clean cut as this as on one server it got about half way through before failing and on another it fails immediately with a “security error”!

So if you have any of the above messages, check for missing mounted disks or drives and make sure they are properly unmounted and also comment them out of /etc/fstab just incase.

I know I should have done that anyway before doing the maintainance but I in hindsight, if anything is going to bite you it will be RALUS/BackupExec 🙂

Outlook default reminders, 18 hour madness

Microsoft in their infinite wisdom have two defaults for reminders on meeting requests, one is for appointments and one for all day events. The option in Tools -> Options is for appointments/meetings only and the defaults for all day events is hardcoded to 18 hours and can’t be changed. Now depending on how you create the appointment and which view you are in will depend on which default you get.

If you are in month view and click on a date it will use the all day default (hardcoded to 18 hours) even if it is not an all day event! If you click the new button or are in week or day view it will use the meeting/appointment default (whatever you set in the options).

Madness!

Grepping Hell

Well that was a tad embarrassing I thought I had lost the ability to grep. All I wanted to do was find any instances of jt1.name in files in the current directory, simple I thought :
grep jt1.name *

Nope
That returned loads of hits that didn’t match at all eg :


modules/UpgradeWizard/commit.php:$from_dir = clean_path(remove_file_extension($install_file) . "-restore");
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store the meta data for the original file
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store the meta data for the new file
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store the meta data for the custom file
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store an associative array contianing all the fields that are used in the original meta data file
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store an associative array contianing all the fields that are used in the new meta data file
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store an associative array contianing all the fields that are used in the custom meta data file
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * this will store an associative array contianing all the merged fields
modules/UpgradeWizard/SugarMerge/EditViewMerge.php: * Merges the fields together and stores them in $this->mergedFields
modules/UpgradeWizard/preflight.php: //Check the current and target versions and store them in session variables
modules/UpgradeWizard/silentUpgrade.php://look for session vars there and restore them
modules/UpgradeWizard/uw_ajax.php: $desc .= $persistence['uw_restore_dir']."\n\n";
modules/UpgradeWizard/uw_utils.php: * Backs-up files that are targeted for patch/upgrade to a restore directory
modules/UpgradeWizard/uw_utils.php: // create restore file directory
modules/UpgradeWizard/uw_utils.php: $_SESSION['uw_restore_dir'] = clean_path($rest_dir);
modules/UpgradeWizard/uw_utils.php: // get name of current file to place in restore directory
modules/UpgradeWizard/uw_utils.php: // only copy restore files for replacements - ignore new files from patch
modules/UpgradeWizard/uw_utils.php: $desc .= $_SESSION['uw_restore_dir'] . "\n\n";
modules/UpgradeWizard/uw_utils.php: if(isset($_SESSION['uw_restore_dir']))
modules/UpgradeWizard/uw_utils.php: unset($_SESSION['uw_restore_dir']);
modules/Meetings/Meeting.php:// Meeting is used to store customer information.

Pages of this came up. When I found the culprit I nearly fell off my chair, some fluffy-kittening person at SugarCRM decided that when doing an upgrade they would make a backup unfortunately they made an interesting choice of names…


drwxrws--- 3 www-data www-data 4096 Jan 12 10:42 -restore
drwxr-xr-x 19 www-data www-data 4096 Mar 9 16:43 .
drwxr-xr-x 3 root root 4096 Jan 23 2009 ..
-rw-r--r-- 1 www-data www-data 342 Mar 9 16:43 .htaccess
-rw-r--r-- 1 www-data www-data 2535 Mar 9 16:43 HandleAjaxCall.php
-rw-r--r-- 1 www-data www-data 155 Dec 17 2008 INSTALLATION.txt
-rw-r--r-- 1 www-data www-data 35147 Dec 17 2008 LICENSE.txt
drwxr-xr-x 3 www-data www-data 4096 Oct 22 14:52 ModuleInstall
-rw-r--r-- 1 www-data www-data 5075 Dec 17 2008 SugarSecurity.php
-rw-r--r-- 1 www-data www-data 5590 Dec 17 2008 TreeData.php
-rw-r--r-- 1 www-data www-data 2488 Mar 9 16:43 WebToLeadCapture.php
drwxr-xr-x 2 www-data www-data 4096 Dec 17 2008 XTemplate
-rw-r--r-- 1 www-data www-data 2490 Dec 17 2008 acceptDecline.php
drwxr-xr-x 17 www-data www-data 4096 Mar 9 16:44 cache

That explains why it recursed too…. I didn’t think you could add flags after the search string…

Cisco Standard Answers

Developed by Tommeh and myself on #staffslug on irc.freenode.org

# 1: “You probably need a new IOS”
# 2: “It’s a feature”
# 3: “That hardware isn’t supported on your platform”
# 4: “That hardware is about to go EOL”
# 5: “That feature is not licensed on your device”
# 6 : “Insufficient memory / space”
# 7 : “Your configuration file does not meet Ciscos MAS” (Minimum Acronym Standard)
# 8 : “User licenses on ASA hardware”    (new from Tommeh 03/11/2010)
# 9 : “You installed from the Warranty CD” (added 3/8/2011)*

 

* http://www.cisco.com/warp/public/707/cisco-sr-20110803-cd.shtml

 

 

Openfire Increasing Java Memory Limits Debian/Ubuntu

Openfire ships with a 64Meg  JVM limit which is fine for testing purposes but you may find that you are using it all up.    I went round the forums a few times and found conflicting advice.

Anyhoo the instructions were close but seemed to give one massive red-herring which was they kept talking about OPENFIRE_OPTS in /etc/defaults/openfire which did not exist,   add it your self and Openfire will ignore it.    Where the data needs to go is in DEAMON_OPTS.

To cut a long story short you need to make /etc/defaults/openfire look like :

# Defaults for openfire initscript
# sourced by /etc/init.d/openfire
# installed at /etc/default/openfire by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Additional options that are passed to the Daemon.
DAEMON_OPTS=”-Xms256m -Xmx512m”

This will tell the JRE to use a minimum of 256Meg RAM and limit it to 512Meg.

Hope this helps 🙂

A quick note on RedHat x64 from Mike (Hi Mike 🙂 )
(slightly edited from an Openfire conversation for clarity and so it makes sense without the other bits!)

you said that on Ubuntu the default OPENFIRE_OPTS didn’t work and you had to change it to DAEMON_OPTS, OPENFIRE_OPTS works fine on CentOS 6.0 x64

also

I had to add libldb.i686 for openfire to work on CentOS-64 bit. 32-bit was fine, just the 64-bit version required it

Cheers Mike,  so just leave it alone for CentOS but install libldb.i686 if you are running the 64 bit version.