2

I have an app that makes API Rest calls to my cratch org. Till yesterday everything was working fine. Yesterday I have configured scheduled apex class job to run in the night. But when checked the result I have found the strange response/error.

The code is:

Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(URL.getSalesforceBaseUrl().toExternalForm() + '/services/data/v47.0/composite/tree/DatedConversionRate/');
        req.setBody(requestBody);
        req.setHeader('Authorization', 'OAuth ' + sessionId);
        req.setHeader('Content-Type', 'application/json');
        req.setMethod('POST');

        HttpResponse res = h.send(req);

And it was working fine. But starting from today I started getting the next response:

17:10:38:747 CALLOUT_REQUEST [120]|System.HttpRequest[Endpoint=https://nosoftware-efficiency-6832-dev-ed.cs83.my.salesforce.com/services/data/v47.0/composite/tree/DatedConversionRate/, Method=POST] 17:10:38:776 CALLOUT_RESPONSE [120]|System.HttpResponse[Status=Temporary Redirect, StatusCode=307]

The body of the response:

The URL has moved here

So it makes 307 redirect to the same URI.

Additionally, today stopped working integration of SFDX command line (and Visual Studio Code plugin) with this org. When I am trying to make push/pull/open org I get nothing. The command stays running forever without any error.

When I am trying to make auth

sfdx force:auth:web:login -r https://test.salesforce.com I enter credentials ... and redirected back to login page without any error. At the same time if I go to https://test.salesforce.com page manually and enter login/password, everything works fine and I am logged in.

The only thing I found in logs of sfdx:

{"name":"sfdx","hostname":"NB192","pid":49599,"log":"AuthInfo","level":20,"username":"test-q3rosalizsaj@example.com","orgId":"00D4E000000EKWGUA4","accessToken":"","refreshToken":"","instanceUrl":"https://nosoftware-efficiency-6832-dev-ed.cs83.my.salesforce.com","loginUrl":"https://CS83.salesforce.com","clientId":"PlatformCLI","createdOrgInstance":"CS83","created":"1577968426604","devHubUsername":"yuriy.peskov@curious-panda-wl62rz.com","isDevHub":false,"msg":"","time":"2020-01-04T09:57:30.731Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"AuthInfo","level":30,"msg":"Saved auth info for username: test-q3rosalizsaj@example.com","time":"2020-01-04T09:57:30.732Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"connection","level":20,"msg":"Connection refresh completed.","time":"2020-01-04T09:57:30.733Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"connection","level":20,"msg":" method=GET, url=https://nosoftware-efficiency-6832-dev-ed.cs83.my.salesforce.com/services/data/v48.0","time":"2020-01-04T09:57:30.733Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"connection","level":20,"msg":"elappsed time : 303msec","time":"2020-01-04T09:57:31.037Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"connection","level":20,"msg":" status=401, url=https://nosoftware-efficiency-6832-dev-ed.cs83.my.salesforce.com/services/data/v48.0","time":"2020-01-04T09:57:31.037Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"connection","level":20,"msg":"","time":"2020-01-04T09:57:31.037Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"AuthInfo","level":30,"msg":"Access token has expired. Updating...","time":"2020-01-04T09:57:31.037Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"crypto","level":20,"msg":"retryStatus: undefined","time":"2020-01-04T09:57:31.038Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"keyChain","level":20,"msg":"platform: darwin","time":"2020-01-04T09:57:31.039Z","v":0} {"name":"sfdx","hostname":"NB192","pid":49599,"log":"AuthInfo","level":30,"msg":"Updated auth info for username: test-q3rosalizsaj@example.com","time":"2020-01-04T09:57:31.275Z","v":0}

but not sure to interpret it, but it is repeated forever if not to stop the cli command.

I would be very appreciate for any help or ideas.

0

I don't what is was, but several days later everything is working fine again. It looks like Salesforce had some issues there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.