Issue 45661: IndexOutOfBounds exception when going to a samples detail page on a M1 / MSSQL environment

issues
Status:open
Assigned To:cnathe
Type:Defect
Area:Sample Manager
Priority:4
Milestone:TBD
Opened:2022-06-10 11:27 by Dan Duffek
Changed:2022-06-10 11:27 by Dan Duffek
Resolved:
Resolution:
Support Ticket: 
Pull Requests:
Closed:
2022-06-10 11:27 Dan Duffek
Title»IndexOutOfBounds exception when going to a samples detail page on a M1 / MSSQL environment
Assigned To»cnathe
Type»Defect
Area»Sample Manager
Priority»4
Milestone»TBD
This only impacts users who have a Mac M1 machine and are running MSSQL.

The root of the problem is that Microsoft does not support a version of MSSQL on the M1, you have to make do with Azure SQL Edge.
Unfortunately Azure SQL Edge does not support CLR functions. This impact a few LKS features.

In LKSM the lack of CLR support causes an IndexOutOfBounds exception when going to a sample's overview page (callstack below).

To my knowledge none of our users/customers have hit this. However it is kind of a pain if you are trying to use LKSM locally on an M1 system.
It would be nice if some kind of work around could be implemented that would allow LKSM to run more reliable on an M1/MSSQL system.



java.lang.StringIndexOutOfBoundsException: offset 1419, length 1166
at java.lang.String.checkOffset(String.java:4571) ~[?:?]
at java.lang.AbstractStringBuilder.insert(AbstractStringBuilder.java:1170) ~[?:?]
at java.lang.StringBuilder.insert(StringBuilder.java:336) ~[?:?]
at org.labkey.api.data.SQLFragment.insert(SQLFragment.java:534) ~[api-22.6-SNAPSHOT.jar:?]
at org.labkey.bigiron.mssql.BaseMicrosoftSqlServerDialect.getSelectConcat(BaseMicrosoftSqlServerDialect.java:734) ~[bigiron-22.6-SNAPSHOT.jar:?]
at org.labkey.bigiron.mssql.MicrosoftSqlServer2008R2Dialect.getSelectConcat(MicrosoftSqlServer2008R2Dialect.java:26) ~[bigiron-22.6-SNAPSHOT.jar:?]
at org.labkey.api.data.MultiValuedLookupColumn.getLookupSql(MultiValuedLookupColumn.java:168) ~[api-22.6-SNAPSHOT.jar:?]
at org.labkey.experiment.api.LineageForeignKey$_MultiValuedForeignKey$2.getLookupSql(LineageForeignKey.java:401) ~[experiment-22.6-SNAPSHOT.jar:?]
at org.labkey.api.data.MultiValuedLookupColumn.addLookupSql(MultiValuedLookupColumn.java:82) ~[api-22.6-SNAPSHOT.jar:?]
at org.labkey.api.data.LookupColumn.declareJoins(LookupColumn.java:255) ~[api-22.6-SNAPSHOT.jar:?]
at org.labkey.query.sql.QuerySelectView.getSelectSQL(QuerySelectView.java:338) ~[query-22.6-SNAPSHOT.jar:?]
at org.labkey.query.sql.QuerySelectView.getSql(QuerySelectView.java:155) ~[query-22.6-SNAPSHOT.jar:?]
at org.labkey.query.QueryServiceImpl.getSelectSQL(QueryServiceImpl.java:2577) ~[query-22.6-SNAPSHOT.jar:?]
at org.labkey.api.data.TableSelector$TableSqlFactory.getSql(TableSelector.java:570) ~[api-22.6-SNAPSHOT.jar:?]
at org.labkey.api.data.TableSelector.getSql(TableSelector.java:506) ~[api-22.6-SNAPSHOT.jar:?]
at org.labkey.api.query.ReexecutableRenderContext.lambda$selectForDisplay$0(ReexecutableRenderContext.java:46) ~[internal-22.6-SNAPSHOT.jar:?]