singer-io / tap-exacttarget

A Singer.io tap for extracting data from the ExactTarget/Salesforce Marketing Cloud API.
GNU Affero General Public License v3.0
14 stars 34 forks source link

API Permission Failed error #58

Open bamuthan opened 3 years ago

bamuthan commented 3 years ago

We are getting 'API Permission failed' errors. Can you please take a look and resolve this issue when you get a chance?

Here is the log for your refernce:

2021-03-09 12:04:50,721Z tap - INFO Syncing stream data_extension.Daily_Metrics with accessor DataExtensionDataAccessObject 2021-03-09 12:04:50,722Z tap - INFO Making RETRIEVE call to 'DataExtension' endpoint with filters '{'SimpleOperator': 'equals', 'Property': 'CustomerKey', 'Value': 'Daily_Metrics'}'. 2021-03-09 12:04:51,434Z tap - ERROR Request failed with 'Error: API Permission Failed.' 2021-03-09 12:04:51,434Z tap - Traceback (most recent call last): 2021-03-09 12:04:51,434Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_exacttarget/init.py", line 136, in do_sync 2021-03-09 12:04:51,434Z tap - stream_accessor.sync() 2021-03-09 12:04:51,434Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_exacttarget/dao.py", line 74, in sync 2021-03-09 12:04:51,434Z tap - return self.sync_data() 2021-03-09 12:04:51,434Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_exacttarget/endpoints/data_extensions.py", line 283, in sync_data 2021-03-09 12:04:51,435Z tap - replication_key=replication_key) 2021-03-09 12:04:51,435Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_exacttarget/endpoints/data_extensions.py", line 209, in _replicate 2021-03-09 12:04:51,435Z tap - for row in result: 2021-03-09 12:04:51,435Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_exacttarget/client.py", line 143, in request_from_cursor 2021-03-09 12:04:51,435Z tap - .format(response.message)) 2021-03-09 12:04:51,435Z tap - RuntimeError: Request failed with 'Error: API Permission Failed.' 2021-03-09 12:04:51,435Z tap - ERROR Failed to sync endpoint, moving on! 2021-03-09 12:04:51,435Z tap - INFO Syncing stream email with accessor EmailDataAccessObject 2021-03-09 12:04:51,435Z tap - INFO Making RETRIEVE call to 'Email' endpoint with filters '{'SimpleOperator': 'greaterThan', 'Property': 'ModifiedDate', 'Value': '2019-07-16T10:20:33Z'}'. 2021-03-09 12:04:52,140Z tap - INFO Done retrieving results from 'Email' endpoint 2021-03-09 12:04:52,140Z tap - INFO Updating state. 2021-03-09 12:04:52,140Z tap - INFO Syncing stream folder with accessor FolderDataAccessObject .......... 2021-03-09 12:06:12,128Z main - INFO State update: changing bookmarks.list_subscriber.last_record from "2021-03-09T04:51:00Z" to "2021-03-09T06:06:00Z" 2021-03-09 12:06:12,792Z tap - INFO Done retrieving results from 'Send' endpoint 2021-03-09 12:06:12,792Z tap - INFO Updating state. 2021-03-09 12:06:12,793Z tap - INFO Updating state. 2021-03-09 12:06:12,793Z tap - INFO Run failed, exiting. 2021-03-09 12:06:12,932Z target - INFO Serializing batch with 1 messages for table send 2021-03-09 12:06:12,932Z target - INFO Sending batch of 3706 bytes to https://api.stitchdata.com/v2/import/batch 2021-03-09 12:06:12,939Z target - INFO [smart-services] event successfully sent to kafka: com.stitchdata.streamRecordCount [1] at offset None 2021-03-09 12:06:12,939Z target - INFO replicated 1 records from "send" endpoint 2021-03-09 12:06:13,074Z target - INFO Requests complete, stopping loop 2021-03-09 12:06:13,117Z main - INFO Target exited normally with status 0 2021-03-09 12:06:13,187Z main - INFO [smart-services] event successfully sent to kafka: com.stitchdata.extractionJobFinished [11] at offset None 2021-03-09 12:06:13,188Z main - INFO No tunnel subprocess to tear down 2021-03-09 12:06:13,188Z main - INFO Exit status is: Discovery succeeded. Tap failed with code 1. Target succeeded.

HansonVPHAM commented 3 years ago

I got the same error. Did you find out a workaround?

rdeshmukh15 commented 1 year ago

@bamuthan and @HansonVPHAM: Are you still facing this issue?

richardb-catalyst commented 6 months ago

@bamuthan and @HansonVPHAM: Are you still facing this issue?

I've just tried today for the first time and am getting this same error on extraction. Any suggestions would be appreciated

2024-03-01 17:01:50,353Z tap - INFO 'send' is not marked selected, skipping. 2024-03-01 17:01:50,353Z tap - INFO 'subscriber' is not marked selected, skipping. 2024-03-01 17:01:50,353Z tap - INFO Syncing stream data_extension.12FFE32B-2D92-43E7-B317-368A9C85B1BA with accessor DataExtensionDataAccessObject 2024-03-01 17:01:50,354Z tap - INFO Making RETRIEVE call to 'DataExtension' endpoint with filters '{'Value': '12FFE32B-2D92-43E7-B317-368A9C85B1BA', 'SimpleOperator': 'equals', 'Property': 'CustomerKey'}'. 2024-03-01 17:01:50,482Z tap - INFO Got 1 results from DataExtension endpoint. 2024-03-01 17:01:50,651Z tap - ERROR Request failed with 'Error: API Permission Failed.' 2024-03-01 17:01:50,651Z tap - Traceback (most recent call last): 2024-03-01 17:01:50,651Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_exacttarget/init.py", line 148, in do_sync 2024-03-01 17:01:50,651Z tap - stream_accessor.sync()

bamuthan commented 6 months ago

@richardb-catalyst, we no longer use stitch. I got the error during the evaluation of stitch. Thanks

richardb-catalyst commented 6 months ago

Fixed this, I was missing the write permission that is needed on data extensions as described here:

https://www.stitchdata.com/docs/integrations/saas/salesforce-marketing-cloud#:~:text=data_extension,your%20Salesforce%20Marketing%20Cloud%20account.&text=Note%3A%20Retrieving%20data%20extension%20data,Write%20permissions%20for%20Data%20Extensions.