cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Highlighted
Occasional Participant

Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

I have a custom bulk import procedure that does the following:

1. Gets a list of  "Email List" to see if the specific list already exists

2. If the list doesn't exist create it

3. Builk import to the designated email list.

 

Everything works flawlessly (same dataset, same code) while running from dev. machine, but getting 504 GATEWAY_TIMEOUT errors when running from the production server during the bulk import call (/v2/activities/addcontacts?api_key=XXX)

 

Any help is greatly appreciated.

 

Tags (2)
7 REPLIES 7
Honored Contributor

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Hello,

 

After investigating this issue, it looks like there was a brief time where some requests timed out as an unexpected side-effect of some maintenance work. This was resolved last night and should not be continuing to cause any problems. Have you continue to experience this issue? If yes, can you provide me with with the time that you last experienced a 504?

 

Please also let me know if you have any questions!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Elijah,

  I am still experiencing the issue. I am now getting 408 (REQUEST_TIMEOUT).

Our export process executes every two minutes and is throttled down to 1 request per second so we dons't exceed API request limit rate.

 

 

408 - 2015-11-12 20:57:03,546 (UTC)

408 - 2015-11-12 20:59:02,546 (UTC)

 

Thank you.

Honored Contributor

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Hello,

 

After looking at our logs, I see two successful requests on our logs at the following times:

15:56:02 (EST)

15:58:02 (EST)

 

It looks like these two requests are the ones which had an error on your side, and I also see that they both returned a success status while trying to get the lists associated with your account. You mentioned before that it was working fine on the development machine but has always had issues on the production server. I strongly suspect at this point that our maintenance was a coincidence and the real problem may be a network configuration (such as a proxy) that is preventing your server from receiving the API response from Constant Contact.

 

 

If I can provide any information to help with troubleshooting this, please let me know!

 

Sincerely,

 

Elijah G.
API Support Engineer
Occasional Participant

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Hello Elijah,

  As I mentioned in my original post each request consists of at least 2 api calls possibly 3. (get the list, check if it doesn't exist then create it and finally do the batch upload).

I think the successful requests you're seeing are the list requests. The requests that fail are the addcontact requests.

Is there way to get a private message, I wouldn’t want to share any more information in public forum.

 

Here is an extract from the log:

 

"POST /v2/activities/addcontacts?api_key=REDACTED HTTP/1.1[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Accept: application/json, application/*+json[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Content-Type: application/json[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Authorization: Bearer XXXX[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Content-Length: 2786[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Host: api.constantcontact.com[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "User-Agent: Apache-HttpClient/4.3.5 (java 1.5)[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "[\r][\n]"
2015-11-12 21:18:02,656 [scheduler-9] DEBUG wire - http-outgoing-2 >> "{"lists":["....

2015-11-12 21:19:03,475 [scheduler-9] DEBUG wire - http-outgoing-2 << "HTTP/1.1 408 REQUEST_TIMEOUT[\r][\n]"
2015-11-12 21:19:03,475 [scheduler-9] DEBUG wire - http-outgoing-2 << "Content-Length:0[\r][\n]"
2015-11-12 21:19:03,475 [scheduler-9] DEBUG wire - http-outgoing-2 << "Connection: Close[\r][\n]"

 

Thank you.

 

Honored Contributor

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Hello,

 

I agree that at this point it's probably best to move to a private conversation so we can get into the details. The best option for that is to email us at webservices@constantcontact.com. I will also do some additional digging to see if I can find anything more.

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Thanks. I just sent an email to webservices@constantcontact.com. I've disabled the iptables on the machine that's running the process without any success. 

Honored Contributor

Re: Getting 504 GATEWAY_TIMEOUT during bulk import via API v2 call

Thank you for the additional information! We will be in touch via email so that we can get into some further detail on this.

 

Sincerely,

Elijah G.
API Support Engineer