2
subscriber = FuelSDK.ET_Subscriber()
subscriber.auth_stub = client
subscriber.props = profile_attributes

response = subscriber.post()

When I log various attributes of the response object .code is 500, but .message is None, .results is None, .reason is None. I am using version0.9.4 of the FeulSDK python library. The application had been working well with only occasional 500 responses but now maybe one request will succeed and then all following requests with return a 500. What steps can I take to debug further? What could be the issue?

  • Hi Matt, welcome. It would be good if you can post more details or code from your classes. – AjFmO May 6 '19 at 17:08
2
+50

The 500 response error (Internal Server Error) could be a multitude of things. Oftentimes, the 500 errors are just bad calls in or not in a format it expects.

  1. Make sure you're using the correct ClientId and Client Secret
  2. Check that your payload is correct and in the correct format. For example, if using a JSON payload, wrap it in [{}]
  3. Are you writing into a data extension? Check that there is no primary key constraint error in the data extension and/or non-nullable fields
  4. Are you using the correct auto-generated CustomerKey of the subscriber in your endpoint? For example: /hub/v1/dataevents/key: refers to the CustomerKey not a GUID
  5. Are you making a lot of API calls at once? (Rate limiting)
  6. Are you passing the correct payload values? i.e. Keys instead of Key

The 500 Internal Server Error is usually accompanied with a response:

See the response returned by the HTTP routing assertion.

Also if your response has a true value for MoreResults, you can use the getMoreResults method to retrieve more information. i.e.

Retrieve Status: True
Code: 200
Message: OK
MoreResults: False
Results Length: 1
Results: [(List){
   Client =
      (ClientID){
         ID = 113903
      }
   PartnerKey = None
   CreatedDate = 2013-07-29 04:43:32.000073
   ModifiedDate = 2013-07-29 04:43:32.000073
   ID = 1966872
   ObjectID = None
   CustomerKey = "343431CD-031D-43C7-981F-51B778A5A47F"
   ListName = "PythonSDKList"
   Category = 578615
   Type = "Private"
   Description = "This list was created with the PythonSDK"
   ListClassification = "ExactTargetList"
 }]

If the post call that you entered in your original post was what you used verbatim, try using the create subscriber example below as your attributes aren't in an array:

import ET_Client
myclient = ET_Client.ET_Client()
subscriber = ET_Client.ET_Subscriber()
subscriber.auth_stub = myclient
subscriber.props = {"EmailAddress" : "example@example.com", "SubscriberKey" : "SDKSubscriber"}
subscriber.props['Attributes'] = [{'Name': 'First Name', 'Value': 'ExactTarget Example'}]
results = subscriber.post()
print results
  • Thanks for your help. How would I go about viewing the "HTTP Routing Assertion"? – Matt May 7 '19 at 13:38
  • I was hoping that there would some attribute on the response such as response._secret_attr.full_http_response_with_meaningful_message. Of the points you listed the only one I can't rule out is number 5. I am in the process of implementing rate limiting. – Matt May 7 '19 at 14:01
  • You can access values like this: print response.Results[0].SendDate – Jackson Chen May 7 '19 at 16:56
  • was capital R intentional? i've looked at response.results and it is None – Matt May 8 '19 at 14:17
  • From the source it appears that since these attributes are None there is no more information to be had at this level. Is there a way to make the library making the http request log the response. Is there any developer console to see records of these errors. Is there any developer support that could help in these situations? – Matt May 8 '19 at 14:59

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.