Questions tagged [calloutexception]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

Summer 22 Schedulable Test System.CalloutException

I don't quite know how to explain the behavior we're seeing. I have two test methods that test exactly the same thing (same inputs, same assertions). The only difference is that one schedules the job, ...
  • 1,159
2 votes
1 answer
393 views

Platform Event + Flow + Apex Action not behaving as a separate transaction sometimes

As we have used Async operations (Future and Queueable) very heavily in our codebase. Thus for doing callouts from trigger, I started using Platform Events + Flow. So from Trigger a PE will be raised :...
1 vote
1 answer
2k views

Named Credential Permission Error - How to enable named credentials with "Named Principal"

I've got a new named credential setup using an OIDC auth provider and the named principal type. It's authenticated successfully but when I try to call it I get String namedCredential = 'callout:asdf'; ...
0 votes
1 answer
86 views

When callout is made inside a Post-Install script, it fails with uncommitted work pending

When callout is made inside a Post-Install script, it fails with the error You have uncommitted work pending. Please commit or rollback before calling out If we run the method Limits....
  • 14.7k
1 vote
1 answer
1k views

Apex callout Unable to tunnel through proxy. 403 forbidden. Using Named Credentials; works fine in curl

Given: Apex Callout (POST) to an in-house REST service Named credentials Authorization headers are correct URL is correct Verified working using curl When: Invoked using execute anonymous or ...
  • 66.6k
0 votes
0 answers
65 views

"You have uncommited work pending" when there's no obvious DML?

I have a RestResource which is running some callouts, as well as running some DML (after the callouts). I'm recieving this error: You have uncommited work pending. Please commit or rollback before ...
  • 155
0 votes
2 answers
362 views

HTTP Callout after async DML

I'm trying to do HTTP callout after DML in future method, but I'm getting System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out. What I'm missing? Is ...
  • 769
1 vote
1 answer
721 views

Need to specify full name, Current Name: Id, Required Delimiter

In the below code I am trying to Assign Object and field permissions using metadata API. When I run the below apex class and trying to assign read permission on the field, I am running in to below ...
  • 65
0 votes
0 answers
1k views

Unexpected end of file from server

after sending http request from the anonymous apex HttpRequest httpRequest = new HttpRequest(); httpRequest.setHeader('Content-Type', 'application/json'); httpRequest.setHeader('Content-Length', '...
  • 25
2 votes
3 answers
1k views

System.CalloutException: Script-thrown exception from HTTP class

I am need some help. I create one integration to ERP and before yesterday the integration working fine. But yesterday it's fail and the stack trace give me this information: I think it's because the ...
0 votes
1 answer
322 views

System.CalloutException when making Apex Callout

I have a Apex Callout like bellow which calls the external System API with OAuth2. I am trying to use the Access token if it hasnt expired and generate one if it is expired and store into a encrypted ...
  • 659
1 vote
1 answer
110 views

What is the reason behind uncommitted work pending issue in the callout?

I am getting uncommitted work pending issue in my test class but Limits.getDMLStatements() says there are 0 DML performed before and after callout. What else could cause this issue? Code is ...
0 votes
1 answer
93 views

Batch callout error: Call out made it firstbefore DML

I have review similar questions, and all of them mention to do API before any DML similar question 1 and similar question 2 However, I am trying to do the API in the excecute, and I am still getting ...
  • 1,935
0 votes
0 answers
36 views

Getting Error: System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out [duplicate]

I'm getting the Error stated in the title above in my code. The method is run in a flow that passes a newly created opportunity id to it. Here's the code: global class NewOppUTS { @InvocableMethod(...
0 votes
1 answer
2k views

The following exception has occurred: IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable"

We have a batchable Apex job (process) where we call an external web service for some Accounts. It starts and service is called. Then, for some records it we get the error : Unable to tunnel through ...
1 vote
0 answers
739 views

Web service callout failed: WebService returned a SOAP Fault: System.Web.Services.Protocols.SoapException: Server was unable to process request

I am new to Integration Projects. I have an Apex class generated from the WSDL of a third party. I would like to utilize the methods of that Apex class and write a batch class that utilizes the ...
0 votes
1 answer
102 views

When method called 2 times: Uncommitted work pending. please commit or rollback before calling out

I have a method: public static CreateUpdateAPI (Account acc) { //do WS callout //perform DML } When i call it from Anonymous console with one Account it runs properly. But when i call the ...
2 votes
1 answer
681 views

Unauthorized endpoint when calling Metadata API from Apex in @future

I am running into the exception IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://eu25.salesforce.com/services/Soap/m/42.0 when ...
3 votes
0 answers
328 views

In a test class example of a Post Install script, sending an email and scheduling a class that performs an API callout

Scenario: In my example, as a part of the PostInstall (class implements InstallHandler) script I will be performing two actions; - sending an email to the installing User for the express purpose of ...
  • 149
1 vote
0 answers
56 views

HTTP CalloutException in Summer '19 sandboxes

Yesterday I started experiencing intermittent but frequent errors with HTTP callouts using Named Credentials in Apex in multiple sandboxes (all Summer '19 preview instances). These same callouts had ...
1 vote
0 answers
164 views

Why is this a Callout loop?

When a customer buys my app from AppExchange, Salesforce creates a new Lead in my Partner Business Org (PBO), with lead source set to "Package Install". When that happens, I have written automation to ...
0 votes
2 answers
1k views

Yahoo API callout failing

Below code was working fine few days back. Suddenly stopped working and throws error. String endPoint = 'https://query.yahooapis.com/v1/public/yql?q='; String queryUrl = 'select item.condition from ...
  • 3,909
0 votes
0 answers
512 views

@future method not getting called from catch block

I am calling a webservice (synchronous) and in case of CalloutException, I'm trying to create an error log in a custom object. The problem is, the record insertion is happening in a future method and ...
  • 123
5 votes
3 answers
2k views

Confused by CalloutException

I have a trigger on Account and Opportunity - both do a callout to the Google Geocoding API and then update itself using a future method. Now I also want to send an email before the update if certain ...
  • 2,182
3 votes
1 answer
2k views

Issue while uploading file greater than 5MB

I am trying to upload a file in salesforce and send it to Sharepoint for storage using synchronous call. However, when i upload file more than 5MB i am encountering an issue like below :' {FAILURE=...
0 votes
0 answers
5k views

Anyone familiar with 'no protocol' CalloutException message, and addressing it?

I'm working a process involving third-party webservices, and have made it past the initial authorization hurdle but am running into a new problem. Regardless of whether the content-type is specified, ...