Hi Team,
I would like to host my api in AWS. my code is working fine in local.
when i deploy the code in AWS. i am getting following error. can any one help one this.
i am using- Python 3.10 and fyers_apiv3. Run it from lamda_function.
issue with the log_path.
fyers = fyersModel.FyersModel(client_id=client_id, is_async=False, token=access_token, log_path=os.getcwd())
{
"errorMessage": "[Errno 30] Read-only file system: '/var/task/fyersApi.log'",
"errorType": "OSError",
"requestId": "",
"stackTrace": [
" File \"/var/lang/lib/python3.10/importlib/__init__.py\", line 126, in import_module\n return bootstrap.gcd_import(name[level:], package, level)\n",
" File \"<frozen importlib._bootstrap>\", line 1050, in gcdimport\n",
" File \"<frozen importlib._bootstrap>\", line 1027, in findand_load\n",
" File \"<frozen importlib._bootstrap>\", line 1006, in findand_load_unlocked\n",
" File \"<frozen importlib._bootstrap>\", line 688, in loadunlocked\n",
" File \"<frozen importlib._bootstrap_external>\", line 883, in exec_module\n",
" File \"<frozen importlib._bootstrap>\", line 241, in callwith_frames_removed\n",
" File \"/var/task/lambda_function.py\", line 101, in <module>\n fyers = fyersModel.FyersModel(client_id=client_id, is_async=False, token=access_token, log_path=os.getcwd())\n",
" File \"/opt/python/fyers_apiv3/fyersModel.py\", line 395, in init\n logger_handler=logging.FileHandler(self.log_path + \"fyersApi.log\"),\n",
" File \"/var/lang/lib/python3.10/logging/__init__.py\", line 1169, in init\n StreamHandler.__init__(self, self._open())\n",
" File \"/var/lang/lib/python3.10/logging/__init__.py\", line 1201, in open\n return openfunc(self.baseFilename, self.mode,\n"
]
}
Thank you.
Yadav