newrelic / newrelic-salesforce-exporter

New Relic integration for Salesforce logs.
Apache License 2.0
10 stars 15 forks source link

Unable to authenticate to Salesforce sandbox instance #6

Closed senithdesilva closed 8 months ago

senithdesilva commented 1 year ago

Hi there,

I am trying to create a test integration with Salesforce and I have been following the instruction in this repo, but unable to proceed due to the following issue.

its returning the following response..

<!doctype html>

Error stack Traceback (most recent call last): File "/Users/sedesilva/dev/repo/newrelic/newrelic-logs-salesforce-eventlogfile/src/__main__.py", line 102, in <module> main() File "/Users/sedesilva/dev/repo/newrelic/newrelic-logs-salesforce-eventlogfile/src/__main__.py", line 79, in main integration.run() File "/Users/sedesilva/dev/repo/newrelic/newrelic-logs-salesforce-eventlogfile/src/newrelic_logging/integration.py", line 48, in run if not client.authenticate_with_password(sfdc_session): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sedesilva/dev/repo/newrelic/newrelic-logs-salesforce-eventlogfile/src/newrelic_logging/salesforce.py", line 175, in authenticate_with_password resp_json = resp.json() ^^^^^^^^^^^ File "/Users/sedesilva/Library/Python/3.11/lib/python/site-packages/requests/models.py", line 910, in json return complexjson.loads(self.text, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

im using the password grant type

image

Could anyone help?

FYI, i'm using python3, if that makes any diff.

shahramk commented 1 year ago

@senithdesilva salesforce offers their docs for enabling and using logfile monitoring on an account. In salesforce you need to make sure that the account is enabled to generate logfiles, and create a"connected app" (or use an existing one) to obtain your consumer key and secret.

In Salesforce NOTE: depending on you version of salesforce (classic, lightning, etc.) these instructions may vary.

In New Relic logfile agent

senithdesilva commented 1 year ago

Thanks @shahramk, will go through this and give it a go.

asllop commented 9 months ago

@senithdesilva did you fix the issue? Also, we released a new version last week: https://github.com/newrelic/newrelic-logs-salesforce-eventlogfile/releases/tag/1.0.0

asllop commented 8 months ago

Closing due to inactivity.