Shioaji
Shioaji copied to clipboard
api.login > api.Contracts stuck at evaluating
In python code, after executing the following
api = sj.Shioaji()
tw_national_id = os.environ['TW_NATIONAL_ID']
accounts = api.login(api_key=_cached_sinotrade_api_key_yaml[tw_national_id]['api_key'],
secret_key=_cached_sinotrade_api_key_yaml[tw_national_id]['api_key_secret'])
api.activate_ca(ca_path=_cached_temp_pfx_path, ca_passwd=tw_national_id,
person_id=tw_national_id)
contracts = [api.Contracts.Stocks[symbol] for symbol in stock_symbols]
api.Contracts gets stuck at evaluating in PyCharm debugging mode. It' been happening in the last 26 minutes.
terminal output
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1763241067.879661 3675020 alts_credentials.cc:93] ALTS creds ignored. Not running on GCP and untrusted ALTS is not enabled.
Successfully cached SinoTrade API key from Secret Manager.
E0000 00:00:1763241068.215687 3675020 alts_credentials.cc:93] ALTS creds ignored. Not running on GCP and untrusted ALTS is not enabled.
Successfully cached Sinotrade CA PFX file from Secret Manager. Path: /tmp/tmpth8yfu10.pfx
Response Code: 0 | Event Code: 0 | Info: host '210.59.255.xxx:80', hostname '210.59.255.xxx:80' IP 210.59.255.xxx:80 (host 1 of 1) (host connection attempt 1 of 1) (total connection attempt 1 of 1) | Event: Session up
Response Code: 200 | Event Code: 16 | Info: APISUB/V1/SYS/CONTRACT | Event: Subscribe or Unsubscribe ok
The issue is resolved. Please investigate the root cause to prevent future down time.
2025-11-16 16:36:20.555 | WARNING | importlib._bootstrap:_call_with_frames_removed:488 - Optional: pip install shioaji[speed] or uv add shioaji --extra speed for better performance.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1763307380.706958 3786432 alts_credentials.cc:93] ALTS creds ignored. Not running on GCP and untrusted ALTS is not enabled.
Successfully cached SinoTrade API key from Secret Manager.
E0000 00:00:1763307381.091046 3786432 alts_credentials.cc:93] ALTS creds ignored. Not running on GCP and untrusted ALTS is not enabled.
Successfully cached Sinotrade CA PFX file from Secret Manager. Path: /tmp/tmp53wz1r80.pfx
Response Code: 0 | Event Code: 0 | Info: host '210.59.255.xxx:80', hostname '210.59.255.xxx:80' IP 210.59.255.xxx:80 (host 1 of 1) (host connection attempt 1 of 1) (total connection attempt 1 of 1) | Event: Session up
Response Code: 200 | Event Code: 16 | Info: APISUB/V1/SYS/CONTRACT | Event: Subscribe or Unsubscribe ok
TSE.2330 has current buy price at 1430.0
TSE.006208 has current buy price at 144.2
TSE.00662 has current buy price at 99.9
Process finished with exit code 0