# Sudden uptick in 'connection timeout' errors this week?

**URL:** <https://forum.alpaca.markets/t/sudden-uptick-in-connection-timeout-errors-this-week/18724>\
**Category:** Alpaca Account Troubleshooting\
**Created:** [April 23, 2026, 2:15pm UTC](https://forum.alpaca.markets/t/sudden-uptick-in-connection-timeout-errors-this-week/18724 "2026-04-23T14:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcducttaper](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kcducttaper](https://forum.alpaca.markets/u/kcducttaper)\
**Post date:** [April 23, 2026, 2:15pm UTC](https://forum.alpaca.markets/t/sudden-uptick-in-connection-timeout-errors-this-week/18724/1 "2026-04-23T14:15:34Z")

</div>

## Environment

**Language** :  
Python

**Other Environment Details**  
Running on a dedicated AWS EC2 instance.

## Problem

**Summary**  
Seemingly just this week, I’ve been getting a significant number of timeout errors (like a dozen a day or so where I used to get none) that have been impacting my algos. Usually, I have enough smarts baked in that it can survive, but today it hit just at the perfect time and crashed the controller for one of my strategies. The exact error for this particular case is:  
`HTTPSConnectionPool(host=‘data.alpaca.markets’, port=443): Max retries exceeded with url: /v2/stocks/PAPL/bars?timeframe=1Min&start=2026-04-23T13:30:00Z&end=2026-04-23T13:31:00Z&limit=100&adjustment=raw&feed=sip&sort=asc (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001EA299FA710>, ‘Connection to data.alpaca.markets timed out. (connect timeout=None)’))`

**Paper or Live Tradng?**  
Live

**Example Code:**  
Below is the function that it happened to catch today. However, it is definitely not the only call that’s hit it this past week.

> def getOpeningCandle(ticker):
> 
> ```python
> try:
> 
> now_utc = datetime.datetime.now(timezone.utc)
> 
> local_hour = datetime.datetime.now().hour
> 
> utc_hour = now_utc.hour
> 
> diff = (utc_hour - local_hour) % 24
> 
> if diff == 5:
> 
> opening_utc_time = now_utc.replace(hour=13, minute=30, second=0, microsecond=0)
> 
> elif diff == 6:
> 
> opening_utc_time = now_utc.replace(hour=14, minute=30, second=0, microsecond=0)
> 
> opening_utc_end = opening_utc_time + timedelta(minutes=1)
> 
> opening_utc_time = opening_utc_time.strftime('%Y-%m-%dT%H:%M:%SZ')
> 
> opening_utc_end = opening_utc_end.strftime('%Y-%m-%dT%H:%M:%SZ')
> 
> url = (f"https://data.alpaca.markets/v2/stocks/{ticker}/bars?timeframe=1Min&start={opening_utc_time}&end={opening_utc_end}&limit=100&adjustment=raw&feed=sip&sort=asc")
> 
> headers = {
> 
> "accept": "application/json",
> 
> "APCA-API-KEY-ID": API_Key,
> 
> "APCA-API-SECRET-KEY": API_Secret
> 
> }
> 
> response = json.loads(requests.get(url, headers=headers).text)
> 
> if response\['bars'\] is None:
> 
> return None
> 
> response = response\['bars'\]\[0\]
> 
> item = {
> 
> "open": str(response\['o'\]),
> 
> "close": str(response\['c'\]),
> 
> "high": str(response\['h'\]),
> 
> "low": str(response\['l'\]),
> 
> "volume": str(response\['v'\]),
> 
> "vwap": str(response\['vw'\]),
> 
> "price action": str(round(float(response\['c'\])\*float(response\['v'\]),2)),
> 
> "UTC start time": str(opening_utc_time),
> 
> "UTC end time": str(opening_utc_end),
> 
> "trending": "null"
> 
> }
> 
> if float(item\['open'\]) > float(item\['close'\]):
> 
> item\['trending'\] = "down"
> 
> elif float(item\['open'\]) < float(item\['close'\]):
> 
> item\['trending'\] = "up"
> 
> elif float(item\['open'\]) == float(item\['close'\]):
> 
> item\['trending'\] = "stagnant"
> 
> return(item)
> 
> except Exception as e:
> 
> print("An error occurred during the function getOpeningCandle for " + ticker + ":\\n" + str(e) + "\\n")
> 
> process_files.append("An error occurred during the function getOpeningCandle for " + ticker + ":\\n" + str(e) + "\\n", "main")
> 
> if "ConnectionResetError" in str(e):
> 
> return "ConnectionResetError"
> 
> return None
> 
> ```

---

<div class="post-metadata">

**Author:** ![dcbz](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dcbz](https://forum.alpaca.markets/u/dcbz)\
**Post date:** [April 23, 2026, 5:56pm UTC](https://forum.alpaca.markets/t/sudden-uptick-in-connection-timeout-errors-this-week/18724/2 "2026-04-23T17:56:12Z")

</div>

You may want to follow this thread, it may be related, has been going on for at least 8 days.

> [@Longer access times/timeouts](https://forum.alpaca.markets/t/longer-access-times-timeouts/18700):
>
> Anyone getting longer access times/timeouts \> 1.5 seconds trying to access data.alpaca.markets/v2/stocks/bars or data.alpaca.markets/v2/stocks/snapshots?symbols just started past few days, very similar problem to what happened a month or two ago that was fixed with a configuration reset.

---

<div class="post-metadata">

**Author:** ![kcducttaper](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kcducttaper](https://forum.alpaca.markets/u/kcducttaper)\
**Post date:** [April 23, 2026, 6:14pm UTC](https://forum.alpaca.markets/t/sudden-uptick-in-connection-timeout-errors-this-week/18724/3 "2026-04-23T18:14:37Z")

</div>

Oh dang, didn’t realize it was actually a legit thing happening to lots of folks! Good catch!

@Dan_Whitnable_Alpaca Does someone over yonder have eyes on this?
