Obama '08

               
   

Go Back   Mike Simonds > Salesforce > Salesforce PHP Tutorials

This is a discussion on PHP SOAP problems with versions 5.2.1 to 5.2.3 within the Salesforce PHP Tutorials forums, part of the Salesforce category; While I was away on vacation the UNIX administrator upgraded the two

Reply
 
LinkBack Thread Tools Rate Thread
  #1  
Old 08-31-2007, 07:52 AM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike
PHP SOAP problems with versions 5.2.1 to 5.2.3

While I was away on vacation the UNIX administrator upgraded the two servers which are used with our instance of Salesforce.com. On these two servers are all of the php scripts that handle our updates and our data backups between Sforce and our local Oracle database. He had left me an email stating that the changes were made and that I needed to test to make sure everything still works as before. One process that updates the Account and other Account related objects worked as it did prior to my departure. It was the database replication scripts that were not working with the new versions of PHP.

This process was built be me to download our data from certain objects within Salesforce so we can have a backup and local copy of our data. Prior to the new PHP version, it worked flawlessly. I knew this due to the two emails I received from the script, one to let me know it started and one to let me know that the script was finished. So it was a total of 20 emails, 10 scripts, which told me that everything ran fine. I then noticed that the scripts which handled the larger data sets were not finishing due to the second email not being sent out, so I manually ran these. The affected objects, such as the opportunity and contact tables, have as much as 100,000+ records and 30+ fields

Here is the error that I started to see right after submitting the scripts:

Code:
SoapFault Object
(
    [message:protected] => Allowed memory size of 25165824 bytes exhausted (tried to allocate 1946835 bytes)
    [string:private] => 
    [code:protected] => 0
    [file:protected] => /users/msimonds/public_html/includes/soapclient/SforceBaseClient.php
    [line:protected] => 477
    [trace:private] => Array
To see the entire error please download the attached text file: php_soap_error.txt

I had not changed the scripts at all and was completely astonished that I was receiving errors. I first thought that it was something that was changed with the new API version of Salesforce to 10.0 and immediately contacted Nick Tran to see if he may know why this was happening. I then asked the UNIX admin to upgrade the PHP to 5.2.2 and ran the same scripts and still errors occurred. Same results with PHP 5.2.3, which is the latest PHP version. So I asked the admin to reinstall PHP 5.2.0 and reran the scripts and they worked.

Something has changed in PHP 5.2.1 - 5.2.3 which is causing the memory to load to such high levels that it is causing scripts to crash. I searched bugs.php.net but could not find any reported bugs.

Right now I am concentrating on Dreamforce '07, but when I return from the conference, I am going to track down these bugs and report them to php.net. If anyone is receiving errors or is willing to help me correct these problems, I would really be grateful.

Thanks,
Mike
Attached Files
File Type: txt php_soap_error.txt (5.7 KB, 160 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2  
Old 09-06-2007, 03:16 PM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

After struggling for the past few days I was able to get WAMP setup so that I could try and reproduce the error code on my local machine which is Windows XP, running Apache 2.*, PHP 5.2.4 and MySQL 5.* series

I first thought that something was wrong with the Linux environement but after I ran the scripts on my localhost and received the exact same memory error.

Here is the error:

Fatal error: Uncaught SoapFault exception: [Client] Allowed memory size of 8388608 bytes exhausted (tried to allocate 1804141 bytes) in C:\wamp\www\includes\soapclient\SforceBaseClient.p hp:506 Stack trace: #0 [internal function]: SoapClient->__call('queryMore', Array) #1 C:\wamp\www\includes\soapclient\SforceBaseClient.p hp(506): SoapClient->queryMore(Object(stdClass)) #2 C:\wamp\www\extract\export_product2.php(122): SforceBaseClient->queryMore('01g40000001npZ1...') #3 C:\wamp\www\extract\export_product2.php(28): get_products(Object(SforcePartnerClient)) #4 {main} thrown in C:\wamp\www\includes\soapclient\SforceBaseClient.p hp on line 506

This seems to be a PHP bug with versions 5.2.1 to 5.2.4 no matter what type of platform you are running your scripts on. I need to capture the SOAP messages so I can report this bug to PHP Bugs

~Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 09-14-2007, 08:47 AM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

After talking to some other developers, I am going to be submitting a bug on this to bugs.php.net in the next 10 days or so

I will keep this thread up to date with all the responses and resolution on this issue
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 09-27-2007, 02:28 PM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

I did a little more research on this today and was able to see that more and more people are seeing this error, so I was not dreaming!

I have been traveling for the past few weeks and am coming down towards the end of this hectic month. I will be back to the office full time starting next Monday and will hit this error on the head with a hammer

see what I am saying > php problem 5.2.3 memory exhausted - Google Search
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 10-19-2007, 09:17 AM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

Well another update to report on this. I finally submitted this bug to PHP and honestly the reason that I have delayed this over the past month or so was that I was actually afraid of the reprocusions that I would receive from the PHP community. Here is a blog that points our my fear:

What is wrong with the PHP community? | Bill Moran's www world

So here is the link to the SOAP bug
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 10-23-2007, 07:45 AM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

Update! The developers over at php.net have accepted my bug and it has been assigned to the SOAP extension manager
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 11-02-2007, 01:46 PM
Administrator
 
Join Date: May 2007
Posts: 246
Send a message via AIM to mike Send a message via MSN to mike Send a message via Yahoo to mike Send a message via Skype™ to mike

I was finally able to get this bug updated with a set of scripts that reproduce the exact error that I reported and sent them to Dmitry over at php.net so he can trouble shoot and correct the bug. Once this bug is fixed, other developers using PHP as their scripting language that coexists with salesforce's API will not have to worry about the SOAP memory leak that affects all versions of PHP after 5.2.0

I am also extremely disappointed in the lack of help from the development team over at Salesforce. I asked for help from their development team for a Salesforce Org or instance that I could use to load 140,000 bogus records into a product2 object so the developers at PHP.net could trouble shoot the error:

They told me to sign up for a EE trial and load my sandbox data in there and work with that data when I had already expressed that I cannot give any access to our data, wether it is Sandbox or Production due to its sensitive nature. I also asked for a temporary increase in my developers or or an area that they may have. They stated that they cannot help me with either case and that this was not a Salesforce problem.

Well I would like to thank Salesforce Premium support from the entire PHP/Salesforce development community for all the GREAT service that they provided in helping with a PHP scripting bug. We all really appreciate it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump



Powered by vBulletin


SEO by vBSEO 3.2.0 RC8 ©2008, Crawlability, Inc.

1 2 3 4 5