TonyM1958 / FoxESS-Cloud

Access to Fox ESS Cloud Data
MIT License
25 stars 4 forks source link

Running scheduled job on Saturn Cloud fails #2

Closed FencingFanatic closed 1 year ago

FencingFanatic commented 1 year ago

Hi,

I set up following your instructions here on github and got the URLS unblocked as described. Ran it and it worked but every time it gets to a scheduled run time it hangs and errors then fails to complete part way through the calculating amount to charge (not that I am actually using that part actively).

Any suggestions?

Error:

2023-11-01T12:03:29.867172448Z stdout F sleeping 2023-11-01T12:03:28.025698067Z stdout F mkdir -p /home/jovyan/setup-logs 2023-11-01T12:03:28.040509271Z stdout F sudo chown jovyan:jovyan /home/jovyan 2023-11-01T12:03:28.11164694Z stdout F sudo chmod 744 /home/jovyan 2023-11-01T12:03:28.12940594Z stdout F mkdir -p /home/jovyan/.conda 2023-11-01T12:03:28.13112386Z stdout F mkdir -p /home/jovyan/.conda/pkgs 2023-11-01T12:03:28.134379478Z stdout F mkdir -p /home/jovyan/.local/bin 2023-11-01T12:03:28.137185726Z stdout F mkdir -p /home/jovyan/.ssh 2023-11-01T12:03:28.141450732Z stdout F touch /home/jovyan/.conda/environments.txt 2023-11-01T12:03:28.146883596Z stdout F git config --global user.email 2023-11-01T12:03:28.172139851Z stdout F git config --global user.name 2023-11-01T12:03:28.175346337Z stdout F cp /home/jovyan/.saturn/authorized_keys /home/jovyan/.ssh/authorized_keys 2023-11-01T12:03:28.181428178Z stdout F cp /home/jovyan/.saturn/known_hosts /home/jovyan/.ssh/known_hosts 2023-11-01T12:03:28.183467008Z stdout F chmod 600 /home/jovyan/.ssh/known_hosts 2023-11-01T12:03:28.184821594Z stdout F cp /home/jovyan/.saturn/ssh_config /home/jovyan/.ssh/config 2023-11-01T12:03:28.186445101Z stdout F chmod 600 /home/jovyan/.ssh/config 2023-11-01T12:03:28.187855689Z stdout F chmod 700 /home/jovyan/.ssh 2023-11-01T12:03:28.190368005Z stdout F mkdir -p /home/jovyan/project 2023-11-01T12:03:28.192051356Z stdout F chmod 600 /home/jovyan/.ssh/authorized_keys 2023-11-01T12:03:34.900672659Z stdout F INSTALL PACKAGES 2023-11-01T12:03:34.900707719Z stdout F ================================================= 2023-11-01T12:03:34.907575581Z stdout F Running pip install 2023-11-01T12:03:38.067038479Z stdout F Collecting random-user-agent 2023-11-01T12:03:38.137308778Z stdout F Downloading random_user_agent-1.0.1-py3-none-any.whl (8.2 MB) 2023-11-01T12:03:38.268803497Z stdout F ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.2/8.2 MB 65.3 MB/s eta 0:00:00 2023-11-01T12:03:38.393124333Z stdout F Collecting foxesscloud 2023-11-01T12:03:38.393609376Z stdout F Obtaining dependency information for foxesscloud from https://files.pythonhosted.org/packages/e5/0e/d6c7f414961cd9bc97d956b56af346646e2f75fd390ba48b52340866527c/foxesscloud-0.8.7-py3-none-any.whl.metadata 2023-11-01T12:03:38.420270486Z stdout F Downloading foxesscloud-0.8.7-py3-none-any.whl.metadata (37 kB) 2023-11-01T12:03:38.440164724Z stdout F Downloading foxesscloud-0.8.7-py3-none-any.whl (43 kB) 2023-11-01T12:03:38.447125062Z stdout F ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.6/43.6 kB 9.6 MB/s eta 0:00:00 2023-11-01T12:03:40.266878497Z stdout F Installing collected packages: random-user-agent, foxesscloud 2023-11-01T12:03:40.432758459Z stdout F Successfully installed foxesscloud-0.8.7 random-user-agent-1.0.1 2023-11-01T12:03:40.9293287Z stdout F 2023-11-01T12:03:40.929381049Z stdout F START SCRIPT 2023-11-01T12:03:40.929389887Z stdout F ================================================= 2023-11-01T12:03:40.951020774Z stdout F 2023-11-01T12:03:40.951053834Z stdout F RUNNING 2023-11-01T12:03:40.951060395Z stdout F ================================================= 2023-11-01T12:03:40.982390419Z stdout F FoxESS-Cloud version 0.8.7 2023-11-01T12:03:44.109538143Z stdout F 2023-11-01T12:03:44.10969377Z stdout F ---------------- set_tariff ----------------- 2023-11-01T12:03:44.109701427Z stdout F Parameters: 2023-11-01T12:03:44.109704994Z stdout F find = flux 2023-11-01T12:03:44.10970807Z stdout F update = 1 2023-11-01T12:03:44.109738844Z stdout F region = H 2023-11-01T12:03:44.109745871Z stdout F 2023-11-01T12:03:44.109750154Z stdout F Tariff set to Octopus Flux 2023-11-01T12:03:44.109753801Z stdout F 2023-11-01T12:03:44.109756946Z stdout F ---------------- charge_needed ---------------- 2023-11-01T12:03:44.109760191Z stdout F Parameters: 2023-11-01T12:03:44.109763794Z stdout F update_settings = 0 2023-11-01T12:03:44.109766709Z stdout F timed_mode = 0 2023-11-01T12:03:44.10976984Z stdout F charge_current = 16 2023-11-01T12:03:44.10977299Z stdout F tariff = Octopus Flux 2023-11-01T12:03:44.109832175Z stdout F datetime = 2023-11-01 12:03 2023-11-01T12:05:55.576517035Z stderr F Traceback (most recent call last): 2023-11-01T12:05:55.576737637Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn 2023-11-01T12:05:55.577287152Z stderr F conn = connection.create_connection( 2023-11-01T12:05:55.577301637Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/util/connection.py", line 95, in create_connection 2023-11-01T12:05:55.577567428Z stderr F raise err 2023-11-01T12:05:55.577576707Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection 2023-11-01T12:05:55.577746464Z stderr F sock.connect(sa) 2023-11-01T12:05:55.577864449Z stderr F TimeoutError: [Errno 110] Connection timed out 2023-11-01T12:05:55.577869722Z stderr F 2023-11-01T12:05:55.577873467Z stderr F During handling of the above exception, another exception occurred: 2023-11-01T12:05:55.577876231Z stderr F 2023-11-01T12:05:55.577947318Z stderr F Traceback (most recent call last): 2023-11-01T12:05:55.577952525Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen 2023-11-01T12:05:55.578434635Z stderr F httplib_response = self._make_request( 2023-11-01T12:05:55.578444951Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connectionpool.py", line 386, in _make_request 2023-11-01T12:05:55.578664705Z stderr F self._validate_conn(conn) 2023-11-01T12:05:55.578672793Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn 2023-11-01T12:05:55.579021058Z stderr F conn.connect() 2023-11-01T12:05:55.579030062Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connection.py", line 363, in connect 2023-11-01T12:05:55.579376861Z stderr F self.sock = conn = self._new_conn() 2023-11-01T12:05:55.579447074Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connection.py", line 186, in _new_conn 2023-11-01T12:05:55.579619444Z stderr F raise NewConnectionError( 2023-11-01T12:05:55.579969014Z stderr F urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7feb03eb1520>: Failed to establish a new connection: [Errno 110] Connection timed out 2023-11-01T12:05:55.580035141Z stderr F 2023-11-01T12:05:55.580041189Z stderr F During handling of the above exception, another exception occurred: 2023-11-01T12:05:55.580043988Z stderr F 2023-11-01T12:05:55.580114356Z stderr F Traceback (most recent call last): 2023-11-01T12:05:55.580178085Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/requests/adapters.py", line 486, in send 2023-11-01T12:05:55.580565647Z stderr F resp = conn.urlopen( 2023-11-01T12:05:55.580624653Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/connectionpool.py", line 787, in urlopen 2023-11-01T12:05:55.581051478Z stderr F retries = retries.increment( 2023-11-01T12:05:55.581091152Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment 2023-11-01T12:05:55.581384905Z stderr F raise MaxRetryError(_pool, url, error or ResponseError(cause)) 2023-11-01T12:05:55.581434859Z stderr F urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.foxesscloud.com', port=443): Max retries exceeded with url: /c/v0/errors/message (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7feb03eb1520>: Failed to establish a new connection: [Errno 110] Connection timed out')) 2023-11-01T12:05:55.581443095Z stderr F 2023-11-01T12:05:55.581446925Z stderr F During handling of the above exception, another exception occurred: 2023-11-01T12:05:55.581449862Z stderr F 2023-11-01T12:05:55.581453217Z stderr F Traceback (most recent call last): 2023-11-01T12:05:55.581456731Z stderr F File "/home/jovyan/workspace/script.py", line 13, in 2023-11-01T12:05:55.581549197Z stderr F f.charge_needed(update_settings=0,charge_current=16,timed_mode=0) 2023-11-01T12:05:55.58155457Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/foxesscloud/foxesscloud.py", line 2048, in charge_needed 2023-11-01T12:05:55.582652285Z stderr F get_settings() # also needed to fetch data on the inverter 2023-11-01T12:05:55.582662165Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/foxesscloud/foxesscloud.py", line 667, in get_settings 2023-11-01T12:05:55.582864664Z stderr F get_charge() 2023-11-01T12:05:55.582871332Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/foxesscloud/foxesscloud.py", line 499, in get_charge 2023-11-01T12:05:55.583021367Z stderr F if get_device() is None: 2023-11-01T12:05:55.583027782Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/foxesscloud/foxesscloud.py", line 323, in get_device 2023-11-01T12:05:55.583151892Z stderr F if get_token() is None: 2023-11-01T12:05:55.583158144Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/foxesscloud/foxesscloud.py", line 105, in get_token 2023-11-01T12:05:55.583284186Z stderr F get_messages() 2023-11-01T12:05:55.583290622Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/foxesscloud/foxesscloud.py", line 68, in get_messages 2023-11-01T12:05:55.583349986Z stderr F response = requests.get(url="https://www.foxesscloud.com/c/v0/errors/message", headers=headers) 2023-11-01T12:05:55.583355183Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/requests/api.py", line 73, in get 2023-11-01T12:05:55.583421546Z stderr F return request("get", url, params=params, kwargs) 2023-11-01T12:05:55.58342747Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/requests/api.py", line 59, in request 2023-11-01T12:05:55.583487241Z stderr F return session.request(method=method, url=url, kwargs) 2023-11-01T12:05:55.58349247Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/requests/sessions.py", line 589, in request 2023-11-01T12:05:55.583632142Z stderr F resp = self.send(prep, send_kwargs) 2023-11-01T12:05:55.583638347Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/requests/sessions.py", line 703, in send 2023-11-01T12:05:55.583854127Z stderr F r = adapter.send(request, kwargs) 2023-11-01T12:05:55.583867846Z stderr F File "/opt/saturncloud/envs/saturn/lib/python3.9/site-packages/requests/adapters.py", line 519, in send 2023-11-01T12:05:55.58401984Z stderr F raise ConnectionError(e, request=request) 2023-11-01T12:05:55.584026849Z stderr F requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.foxesscloud.com', port=443): Max retries exceeded with url: /c/v0/errors/message (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7feb03eb1520>: Failed to establish a new connection: [Errno 110] Connection timed out'))

=============== Terminated at Wed, 01 Nov 2023 12:05:55 GMT ===============

TonyM1958 commented 1 year ago

It's explained in the trouble shooting here: https://github.com/TonyM1958/FoxESS-Cloud/wiki/Using-Saturn-Cloud#time-out-error-accessing-fox-ess-cloud