Hey fellow specklers,
I am getting the following error โAn error occurred: SpeckleException: Failed to initialize user application data path.โ, when my lambda function is trying to connect to my Speckle server, when i test the lambda locally everything works like a charm, but when i push it to the cloud it gives me this error. I cant seem to understand why?
Here are the more detailed logs :
Core is expecting a set of folders which probably do not exist in your environment.
You should be able to override the default path by setting this env variable: SPECKLE_USERDATA_PATH
Hey @teocomi,
Thanks for the quick response, AWS lambda is using x86_64 serverless architecture, but i am not sure where APPDATA is located, it seems like it goes wrong when finding the platform specific folder path:
def user_application_data_path() -> Path:
path_override = _path()
if path_override:
return path_override
try:
if sys.platform.startswith("win"):
app_data_path = os.getenv("APPDATA")
if not app_data_path:
raise SpeckleException(
message="Cannot get appdata path from environment."
)
return Path(app_data_path)
else:
# try getting the standard XDG_DATA_HOME value
# as that is used as an override
app_data_path = os.getenv("XDG_DATA_HOME")
if app_data_path:
return Path(app_data_path)
else:
return _ensure_folder_exists(Path.home(), ".config")
except Exception as ex:
raise SpeckleException(
message="Failed to initialize user application data path.", exception=ex
)
I found a solution, that is to set the SPECKLE_USERDATA_PATH (like you suggested) to โ/tmpโ, which is a a writable directory during execution of the function.