python-swat icon indicating copy to clipboard operation
python-swat copied to clipboard

Failed to access file /cascache/cascache/

Open FK7 opened this issue 2 years ago • 3 comments
trafficstars

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.

FK7 avatar Mar 02 '23 08:03 FK7

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 ?

bkemper24 avatar Mar 02 '23 13:03 bkemper24

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.

FK7 avatar Mar 05 '23 07:03 FK7

Also, do you know if the CAS_DISK_CACHE was kustomized ?

bkemper24 avatar Mar 06 '23 11:03 bkemper24