# Internal Server Error on get\_clock()

**URL:** <https://forum.alpaca.markets/t/internal-server-error-on-get-clock/10134>\
**Category:** Alpaca Integration Applications\
**Created:** [July 28, 2022, 3:22pm UTC](https://forum.alpaca.markets/t/internal-server-error-on-get-clock/10134 "2022-07-28T15:22:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZlaTanskY](https://avatars.discourse-cdn.com/v4/letter/z/43a26b/32.png) [@ZlaTanskY](https://forum.alpaca.markets/u/ZlaTanskY)\
**Post date:** [July 28, 2022, 3:22pm UTC](https://forum.alpaca.markets/t/internal-server-error-on-get-clock/10134/1 "2022-07-28T15:22:03Z")

</div>

The used code:

import alpaca\_trade\_api as apca  
from alpaca\_trade\_api.entity import Clock  
class HelloWorld:  
self.apca = apca.REST(api\_version=‘v2’)  
def get\_clock(self) → Clock:  
“”“Get clock wrapper from Alpaca.”“”  
return self.apca.get\_clock()

I haven’t changed anything in my code and it has been running for some weeks without errors, yesterday (July 27th) before market hours, (while waiting for markets to open), the following error occurred:  
File “/home/pi/Documents/ML40/src/bot/ml40.py”, line 326, in time\_to\_market\_open  
clock = self.get\_clock()  
File “/home/pi/Documents/ML40/src/bot/ml40.py”, line 312, in get\_clock  
return self.apca.get\_clock()  
File “/home/pi/Documents/ML40/venv/lib/python3.9/site-packages/alpaca\_trade\_api/rest.py”, line 1005, in get\_clock  
resp = self.get(‘/clock’)  
File “/home/pi/Documents/ML40/venv/lib/python3.9/site-packages/alpaca\_trade\_api/rest.py”, line 250, in get  
return self.\_request(‘GET’, path, data)  
File “/home/pi/Documents/ML40/venv/lib/python3.9/site-packages/alpaca\_trade\_api/rest.py”, line 213, in \_request  
return self.\_one\_request(method, url, opts, retry)  
File “/home/pi/Documents/ML40/venv/lib/python3.9/site-packages/alpaca\_trade\_api/rest.py”, line 234, in \_one\_request  
resp.raise\_for\_status()  
File “/home/pi/Documents/ML40/venv/lib/python3.9/site-packages/requests/models.py”, line 1021, in raise\_for\_status  
raise HTTPError(http\_error\_msg, response=self)  
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: [https://paper-api.alpaca.markets/v2/clock](https://paper-api.alpaca.markets/v2/clock)

Currently it is working again, but I would like to avoid this error in the future. Any ideas what might have caused this error? Alpaca server down at that time? If so, can we check the planned maintenances somewhere?  
Thanks in advance.

Kind regards

Kind regards
