function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Paul - SalesbriPaul - Salesbri 

Package Upload Failure - Future Methods

Hi All

I'm trying to upload a package to the appexchange that contains an APEX class that has a @future(callout=true) note, the tests all execute fine (apart from the @future as they are not supported) and the code functions without error in the development environment yet when I try to upload I get this error in the debug log.

'Future method cannot be called from a future method: getLicenceKey(String, String)'

It's all very strange, so hopefull someone can help.

Cheers

Paul
tmatthiesentmatthiesen
This has been identified as a bug and should be fixed by Thursday morning. 
Paul - SalesbriPaul - Salesbri
Hi tmatthiesen,

Thanks for the update, however now I am receiving an error on upload on my package when I have removed the class with the @future call.

I don't get any errors on the pre-upload check, (i.e. before you set a password and set managed beta / release) yet when I click upload I get the error:

"Your upload failed. You will receive an e-mail containing additional information."

Yet no email arrives, and there are no errors in the debug log, no exceptions either.

My test coverage is 80% and they all complete without any errors.

Is this related?

Cheers

Paul
tmatthiesentmatthiesen
Hmm that seems to be another issue.  I will forward this along.
A_SmithA_Smith
Hi Paul,

Have you filed a case? If so, can you provide the case number?

Thanks,
Andrew
Paul - SalesbriPaul - Salesbri
Hi Andrew

The case # is 02159482, I was about to delete the package from my instance and re-upload it to see if that made any difference as we've changed the name and changed a lot of its contents.

Please do let me know if you find anything.

Thanks

Paul
Paul - SalesbriPaul - Salesbri
Just a quick update to say that deleting and re-adding the package didn't work.
A_SmithA_Smith
Hi Paul,

Are you trying to upload the salesbridge summary package?  Can you please grant us login access for further investigation?

Thanks,
Andrew
Paul - SalesbriPaul - Salesbri
Hi Andrew

Login access has been granted, could you give me a call when you have moment and I can talk you through what I am doing, my number is under my personal information for my usernname.

Thanks

Paul
A_SmithA_Smith
Hi Paul,

We released a fix yesterday that hopefully resolved the issue. Can you try again and let us know.

Thanks,
Andrew
Paul WeedenPaul Weeden
Hi Andrew,

Can't find my old login for the forum so am replying from my other account.  Am afraid that the problem still exists, can you shed any light on what is causing the problem?  Would there be any use in having a quick call today to see if we can remove any items from the package to persuade it to upload?

Hope to hear from you soon.

Paul
A_SmithA_Smith
Hi Paul,

What kind of error are you getting?  Do you receive an error id?

Thanks,
Andrew
Paul WeedenPaul Weeden
Hi Andrew

That is just it, no error message is presented in the UI, I simply get an error stating an error occurred and that I will receive an email, yet no email ever arrives, no errors are logged in the debug log.

It would really help if I could speak with you or your team as we could get all of the answer to you in one go so you could investigate this issue.  Do you think this will be possible as I tried to call partner support but couldn't get through to you on Friday, and it is now preventing us from delivering the project to our Client.

Thanks

Paul
A_SmithA_Smith
Hi Paul,

I can't do a call today, but we can certainly speak tomorrow.  It sounds like you've hit a bug.  Can you please log a case if you haven't already, include your username, and grant salesforce login access to the org where you are performing the upload.  Then if you'll post your case number here I'll have our engineers look into the issue before we speak and hopefully have an update for you with the root cause.

Thanks,
Andrew
Paul WeedenPaul Weeden
Hi Andrew,

Forgive me, but I am a little confused.  I raised a case and gave you the details earlier in the week, but anyways the case number is: 02159482 .  I have also logged a case through the partner portal and spoken with Danny in 1st level support who told me that all of this was being investigated, and that a fix was in progress, maybe we all got our wires crossed.

However login access has been extended for a further 7 days, but please can you keep me updated as to the progress as we have built this package for a client and they are not able to use it which is going to delay the whole project unless we can find a resolution.

Please let me know if you need any more information.

Thanks.

Paul
A_SmithA_Smith
Hi Paul,

I apologize for the confusion on my part and thanks for the information.  Your case was tied to the wrong bug and after trying the upload again, I found the source of your problem which is a different issue.  I've gone ahead and created a bug and passed it on to our engineers to investigate further.  I should have an update for you tomorrow. 

Thanks,
Andrew
Paul WeedenPaul Weeden
Hi Andrew

It is good to hear it is a bug and that you know the cause.

Hope to hear from you tomorrow.

Enjoy the rest of the weekend.

Paul
HarmpieHarmpie
What's the status here? I am receiving the same error:
Code:
System.AsyncException: Future method cannot be called from a future method: doRequest(LIST:String)

Trigger.testWs: line 6, column 5

System.DmlException: Update failed. First exception on row 0 with id 0017000000TltRTAAZ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, testWs: execution of AfterUpdate

caused by: System.AsyncException: Future method cannot be called from a future method: doRequest(LIST:String)

Trigger.testWs: line 6, column 5

Class.TestWsClass.doRequest: line 96, column 9

 
The code (mostly taken from the Google libraries on code-share):
 
Code:
    @future (callout=true)
    public static void doRequest(list<string> accids) { 
    
        Account[] al = [ select Id, Name, BillingStreet,BillingState,BillingPostalCode,BillingCountry,Debug__c from Account where id in :accids];
 
        for ( Account a: al) { 
            String addressString = '';
            if(a.Name!=null) {
             if(a.Name.length() > 0) {
              addressString += '/'+EncodingUtil.urlEncode(a.Name,'UTF-8');  
             } else {
              addressString += '/';
             }
            } else {
             addressString += '/';
            }
            if(a.BillingStreet!=null) {
             if(a.BillingStreet.length() > 0) {
              addressString += '/'+EncodingUtil.urlEncode(a.BillingStreet,'UTF-8')+'/'+EncodingUtil.urlEncode(a.BillingStreet,'UTF-8')+'/'+EncodingUtil.urlEncode(a.BillingStreet,'UTF-8')+'/';  
             } else {
              addressString += '////';
             }
            } else {
             addressString += '////';
            }            
            // Locality = empty
            addressString += '/';    
                    
            if(a.BillingPostalCode!=null) {
             if(a.BillingPostalCode.length() > 0) {
              addressString += '/'+EncodingUtil.urlEncode(a.BillingPostalCode,'UTF-8');  
             } else {
              addressString += '/';
             }
            } else {
             addressString += '/';
            }
            if(a.BillingState!=null) {
             if(a.BillingState.length() > 0) {
              addressString += '/'+EncodingUtil.urlEncode(a.BillingState,'UTF-8');  
             } else {
              addressString += '/';
             }
            } else {
             addressString += '/';
            }
            
            if(a.BillingCountry!=null) {             
             if(a.BillingCountry.length() > 0) {
              addressString += '/'+EncodingUtil.urlEncode(a.BillingCountry,'UTF-8');  
             }else {
              addressString += '/';
             }
            } else {
             addressString += '/';
            }
            addressString += '/nl/nl';
            xmldom dom = checkAddress(addressString,a); 
            if(dom!=null) {
             a.Debug__c = dom.root.getValue('formatted_address');
            }
            
        }
        update al;
    }

 
Trigger calling the class:
Code:

trigger testWs on Account (after insert, after update) {

string[] todo = new string[]{};

for (Account acc : Trigger.New) {

todo.add((String)acc.Id);

}

TestWsClass.doRequest(todo);

}


 
Value of dom, used in the update attempt:
 

I am very curious what's going wrong here.
 
Variable dom contains valid xml, and dom.root.getValue('formatted_address') returns a correct value as well.

Message Edited by Harmpie on 11-20-2008 06:46 AM

Message Edited by Harmpie on 11-20-2008 06:49 AM
HarmpieHarmpie
Bump. Any news?