A "500 Internal Server Error" occurs when you upgrade SAS® Business Rules Manager from SAS® 9.4MX to SAS 9.4M9 (TS1M9)


After upgrading SAS with SAS Business Rules Manager from SAS 9.4MX to SAS 9.4M9, the %BRM_GET_RULE_FLOW_CODE macro might return the following:

NOTE: 500 Internal Server Error

The above error occurs as result of the http procedure that the %BRM_GET_RULE_FLOW_CODE macro calls. The 500 Internal Server Error occurs with any rule_flow_sk value that you assign. In addition, the code.sas that the macro creates is invalid.

An alias conflict in the SAS Business Rules Manager environment causes this issue. Hibernate detects duplicate rule_sk column labels in a native SQL query that is used during code generation. 

In addition, catalina.out might contain a message similar to the following:

11:21:03,765 | ERROR | [[rest]] | Servlet.service() for servlet [rest] in context with path [/SASBusinessRulesManagerWeb] threw exception [Request processing failed: com.sas.brm.service.SASDecisionDataServiceException: org.springframework.orm.jpa.JpaSystemException: Encountered a duplicated sql alias [rule_sk] during auto-discovery of a native-sql query] with root cause
org.hibernate.loader.NonUniqueDiscoveredSqlAliasException: Encountered a duplicated sql alias [rule_sk] during auto-discovery of a native-sql query
at org.hibernate.query.results.ResultSetMappingImpl.resolve(ResultSetMappingImpl.
java:289)
~[hibernate-core.jar:6.6.1.Final]

Workaround

The 500 error occurs only when you use an incorrect or non‑existent ruleflow_version. With the correct version, the macro works as expected.

Here is an example of parameters that should work:

ruleflow_sk = 10000
ruleflow_version = 1.0
fileLocation = /install/SASInstall/test/repro_10000_v1.0_body.sas

The macro returns 200 OK and generates the rule flow code successfully.