BookmarkSubscribeRSS Feed
a20121248
Obsidian | Level 7

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:

a20121248_0-1681260415867.png

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:

a20121248_0-1681260279884.png

This is an screenshoot of the error. The full log is attached.

a20121248_1-1681261759660.png

 

I hope you can help me. Thank you in advance!!

4 REPLIES 4
ScottLindauer
SAS Employee

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? 

a20121248
Obsidian | Level 7

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:

a20121248_4-1681868983183.png

Python code:

a20121248_3-1681868956530.png

Error when running an Scenario test:

a20121248_2-1681868886953.png

a20121248_1-1681868640368.png


@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).

a20121248_0-1681868086005.png


@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:

Ejecucion Python en SAS Viya.png

 

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.

ScottLindauer
SAS Employee

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

  • uninstall matplotlib from the Python site-packages (and then attempt either process again with your username)
  • use an admin account to run either the scoring test or the decision flow

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.

a20121248
Obsidian | Level 7

Hi!

Sorry for late reply, we fix some premission and don't have the matplotlib error, but still got a _pyConnect error.

a20121248_0-1685403734773.png

Is it helpful to get a more complete log? We still have the problem with python in ID and Model Manager

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Discussion stats
  • 4 replies
  • 1935 views
  • 1 like
  • 2 in conversation