Questions tagged [calloutexception]
The calloutexception tag has no usage guidance.
32 questions
0
votes
2
answers
129
views
How to catch "System.UnexpectedException: Unable to fetch the OAuth token."
I have a Queueable class that makes a callout using Named Credentials. Sometimes I get
System.UnexpectedException: Unable to fetch the OAuth token.
I surrounded the send method with try/catch block
...
0
votes
0
answers
114
views
REST API call - cvent 401 error Code
I'm trying to write a CVENT REST API call in my code. According to the documentation, I'm sending all the required parameters. The same request works perfectly in Postman, but in my code, it returns a ...
1
vote
0
answers
287
views
Unable to make callouts after Salesforce Instance Refresh. Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable"
Over the weekend, Salesforce has refreshed our org instance AP53.
Since then our integration with Equifax is not working.
Whenever we try to make a callout to the Equifax servers, we get the following ...
1
vote
1
answer
120
views
Getting 'uncommitted work pending' even after putting in a queuable class
Getting 'You have uncommitted work pending. Please commit or rollback before calling out' error even after making the callout in a queuable class. Below the essence of the logic
QueuableDummyclass.cls
...
0
votes
0
answers
204
views
Get Presigned URL using named credentials
I successfully obtained the pre-signed URL to upload large file to aws s3 bucket using the method described in the article https://mtr-design.com/news/how-to-create-a-presigned-url-for-aws-s3-using-...
0
votes
0
answers
1k
views
Named callout Null in http request with named credential - What would cause it?
I am making a callout and getting the error
"System.CalloutException: The callout couldn't access the endpoint. You might not have the required permissions, or the named credential "XXX"...
0
votes
0
answers
39
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, ...
2
votes
1
answer
1k
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
6k
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
159
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....
1
vote
1
answer
4k
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 ...
0
votes
0
answers
72
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 ...
0
votes
2
answers
936
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 ...
1
vote
1
answer
2k
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 ...
1
vote
0
answers
2k
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', '...
2
votes
3
answers
3k
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
1k
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 ...
1
vote
1
answer
118
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
105
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 ...
0
votes
0
answers
39
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(...
1
vote
1
answer
3k
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
901
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
118
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
906
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
413
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 ...
1
vote
0
answers
59
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
334
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 ...
0
votes
0
answers
605
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 ...
5
votes
3
answers
3k
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 ...
4
votes
1
answer
3k
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=...
1
vote
0
answers
8k
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, ...