Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salesforce ingestion fails with INVALID_TYPE in SF query #6529

Closed
orlandine opened this issue Nov 23, 2022 · 2 comments
Closed

Salesforce ingestion fails with INVALID_TYPE in SF query #6529

orlandine opened this issue Nov 23, 2022 · 2 comments
Labels
bug Bug report

Comments

@orlandine
Copy link
Contributor

Describe the bug
Running Salesforce ingestion using CLI (0.9.2.3) fails with

[...]
  File "/opt/homebrew/lib/python3.10/site-packages/datahub/ingestion/source/salesforce.py", line 260, in get_workunits
    sObjects = self.get_salesforce_objects()
  File "/opt/homebrew/lib/python3.10/site-packages/datahub/ingestion/source/salesforce.py", line 340, in get_salesforce_objects
    entities_response = self.sf._call_salesforce("GET", query_url).json()
  File "/opt/homebrew/lib/python3.10/site-packages/simple_salesforce/api.py", line 610, in _call_salesforce
    exception_handler(result, name=name)
  File "/opt/homebrew/lib/python3.10/site-packages/simple_salesforce/util.py", line 68, in exception_handler
    raise exc_cls(result.url, result.status_code, name, response_content)
simple_salesforce.exceptions.SalesforceMalformedRequest: Malformed request https://INSTANCE.my.salesforce.com/services/data/v56.0/tooling/query/?q=SELECT%20DurableId,QualifiedApiName,DeveloperName,Label,PluralLabel,InternalSharingModel,ExternalSharingModel,DeploymentStatus%20FROM%20EntityDefinition%20WHERE%20IsCustomizable%20=%20true. Response content: [{'message': "sObject type 'EntityDefinition' is not supported.", 'errorCode': 'INVALID_TYPE'}]

To Reproduce
Steps to reproduce the behavior:

  1. Use <config> example from documentation, change to correct values (for instance, user, password, token, is_sandbox=true)
  2. Run 'datahub ingest -c <config>.yaml' where <config> points to a sandbox SF instance

Expected behavior
No query failure, ingestion to continue.

Desktop (please complete the following information):

  • CLI (0.9.2.3)
  • GMS (0.9.2)
@orlandine orlandine added the bug Bug report label Nov 23, 2022
@orlandine
Copy link
Contributor Author

Ok. The above problem gets solved by giving the user the "View setup and Configuration" permission. However, now the next problem is

  File "/opt/homebrew/lib/python3.10/site-packages/datahub/ingestion/source/salesforce.py", line 294, in get_salesforce_object_workunits
    yield from self.get_schema_metadata_workunit(
  File "/opt/homebrew/lib/python3.10/site-packages/datahub/ingestion/source/salesforce.py", line 631, in get_schema_metadata_workunit
    sObject_custom_fields_response = self.sf._call_salesforce(
  File "/opt/homebrew/lib/python3.10/site-packages/simple_salesforce/api.py", line 610, in _call_salesforce
    exception_handler(result, name=name)
  File "/opt/homebrew/lib/python3.10/site-packages/simple_salesforce/util.py", line 68, in exception_handler
    raise exc_cls(result.url, result.status_code, name, response_content)
simple_salesforce.exceptions.SalesforceMalformedRequest: Malformed request https://INSTANCE.my.salesforce.com/services/data/v56.0/tooling/query?q=SELECT%20DeveloperName,CreatedDate,CreatedBy.Username,InlineHelpText,LastModifiedDate,LastModifiedBy.Username%20FROM%20CustomField%20WHERE%20EntityDefinitionId='Account'. Response content: [{'message': "sObject type 'CustomField' is not supported.", 'errorCode': 'INVALID_TYPE'}]

@orlandine
Copy link
Contributor Author

Which (exception from previous comment) in turn gets resolved by granting the SF user the permission "View All Data". It would be great if this were mentioned in the prerequisites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

1 participant