Hello experts:
I have an on-premise deployment of SAS Viya 3.5 and Python 3.6 with sasctl-1.9.0. I registered 2 Python models with sasctl in the following Python Script:
Then I tried to run some tests in SAS Model Manager, first of all, I've got an error (with no message nor log) but it was solved here (I had to manually change DS2 multi-type to DS2 Package). Now I got a log in the Results column. However, there's still an error for each model:
This is an screenshoot of the error. The full log is attached.
I hope you can help me. Thank you in advance!!
From the error logs, it seems that when the DS2 code is attempting to instantiate a Python instance, it is failing due to issues with creating a folder for matplotlib. This is likely due to a permissions failure in regards to what Python is allowed to access. From my understanding, when matplotlib is imported, it checks the environment variable MPLCONFIGDIR for where it can place a configuration directory. If that location ends up being inaccessible to the Python process, I am guessing that the entire score process fails.
However, the truncation of the traceback is making it difficult to properly confirm that that is the cause of the failure (not to mention a mild amount of confusion as to why matplotlib would be called at all for a score test). Are you able SSH into the Viya 3.5 server? If so, can you access the complete score test logs? or attempt to run the Python score code directly in terminal?
Hi @ScottLindauer :
I am using SAS Intelligent Decisiong to test some APIs with a code file in Python and I get exactly the same error with SAS Model Manager and Python models. I am following this quick Tutorial.
Decision:
Python code:
Error when running an Scenario test:
@ScottLindauer wrote:
Are you able SSH into the Viya 3.5 server? If so, can you access the complete score test logs?
Yes, by the complete score test logs do you mean the Log file of the scoring test, like in the image below? If so, I've downloaded the file and attached in this post (file Prueba Python 1_Scenario_1_executionLog.txt).
@ScottLindauer wrote:
If so, can you access the complete score test logs? or attempt to run the Python score code directly in terminal?
Yes, I connected to the controller, executed the same python code and it worked fine:
I hope you can help in finding the error. To be honest, I don't know what to ask to the administrators and why matplotlib is imported, since it's just a if-else Python script.
Thank you for your support as always.
Yes, by the complete score test logs do you mean the Log file of the scoring test [...]?
No, in this case I am referring to the log files generated within the service logs for the server. Depending upon the service being called, complete logs for on a Viya 3.5 server can be found at /opt/sas/viya/config/var/log. However, in my experience, Python logs may still be truncated within these logs as well, so it may be a fruitless search.
I don't know what to ask to the administrators and why matplotlib is imported, since it's just a if-else Python script.
Agreed on the matplotlib point. Would it be possible to ask your administrator to either
I believe either of these would confirm that a permissions issue is causing the problem. Otherwise, there are ways to work around the Python log truncation, but they require adjustments to the scoring code.
Let me know if either of the above options work for you, or if you'd rather go down the route of modifying the score code to capture the Python traceback.
Hi!
Sorry for late reply, we fix some premission and don't have the matplotlib error, but still got a _pyConnect error.
Is it helpful to get a more complete log? We still have the problem with python in ID and Model Manager
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!