sassoftware / python-swat

The SAS Scripting Wrapper for Analytics Transfer (SWAT) package is the Python client to SAS Cloud Analytic Services (CAS). It allows users to execute CAS actions and process the results all from Python.
Other
147 stars 63 forks source link

Failed to access file /cascache/cascache/ #151

Open FK7 opened 1 year ago

FK7 commented 1 year ago

Hi Team,

I attempted to utilize the swat package to push a pandas dataframe as a Sas table to a Sas server, but I encountered an error message that states "Failed to access cache file." Below is the code that I am executing for your reference. I would highly appreciate your assistance.

Code:

Verify file existence at a designated path

if not os.path.exists(castable_path):
raise ValueError("Unable to locate CASTable at the specified path.")

Transfer CASTable to SAS server

try:
conn.loadactionset("table")
conn.upload(castable_path, casout=dict(name="mytable_1", replace=True, caslib='CASUSER(sasboot)'))
print("CASTable successfully uploaded!")
except swat.CASActionError as e:
print(f"An error occurred while uploading CASTable: {e}")

Please note that I received the following output while running the code:

NOTE: Added action set 'table'. CASTable uploaded successfully!

ERROR: Failed to access file /cascache/cascache/_f_1e7ad78a_7f7b9bcc1b68.sashdat. ERROR: The action stopped due to errors.

bkemper24 commented 1 year ago

The upload action is failing on the CAS server side. Do you have access to the CAS controller log file at the time that the upload was being done ? Are there any errors reported in the CAS controller log ? If you are able to turn up the log levels in the CAS server, TRACE level of the App.cas.tables logger would be helpful.

Also, how big is the file you are trying to upload ?

FK7 commented 1 year ago

Thank you for your message @bkemper24 . I will request our SAS admin to check the controller logs and I will follow up with you once I receive more information.

Furthermore, I am not attempting to upload a file. Instead, I have created a sample dataframe with dummy records, which you can review in the code that I provided.

bkemper24 commented 1 year ago

Also, do you know if the CAS_DISK_CACHE was kustomized ?