SQL error with integration of external app with OIDC

24 views
Skip to first unread message

Niral Kunadia

unread,
Aug 4, 2023, 11:40:50 AM8/4/23
to CAS Community
Hello,

I am trying to integrate mangoapps (external app) with CAS using OIDC connect. It was working perfectly fine with CAS 6.5.9.

I upgraded cas with CAS 6.6.10 and I am getting this error in logs.

2023-08-04 15:26:12,503 ERROR [org.hibernate.engine.jdbc.batch.internal.BatchingBatch] - <HHH000315: Exception executing batch [java.sql.BatchUpdateException: data exception: string data, right truncation ; size limit: 32000 table: CAS_TICKETS column: BODY], SQL: insert into Cas_Tickets (body, creation_Time, parent_Id, principal_Id, type, id) values (?, ?, ?, ?, ?, ?)>
2023-08-04 15:26:12,505 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - <SQL Error: 3401, SQLState: 22001>
2023-08-04 15:26:12,507 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] - <data exception: string data, right truncation ; size limit: 32000 table: CAS_TICKETS column: BODY>

and also this
2023-08-04 15:26:12,527 ERROR [org.apereo.cas.support.oauth.web.endpoints.OAuth20AuthorizeEndpointController] - <could not execute batch; SQL [insert into Cas_Tickets (body, creation_Time, parent_Id, principal_Id, type, id) values (?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.DataException: could not execute batch
        HibernateJpaDialect.java:convertHibernateAccessException:280
        HibernateJpaDialect.java:translateExceptionIfPossible:233
        JpaTransactionManager.java:doCommit:566
>

Ganesh and Sashi Prasad

unread,
Aug 4, 2023, 1:39:40 PM8/4/23
to cas-...@apereo.org
Hi Niral,

Sorry, I don't have an answer to your question, but I need some help from you. I have been struggling to set up CAS to be an OIDC provider. Can you please help me with the setup by either sending me the overlay you started with (removing all sensitive information, of course), or the steps needed to set it up?

I'm not able to set up anything more complex than just basic CAS.

Thanks and regards,
Ganesh

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/4c40ec4d-4b21-4ae4-af29-6a4004875f53n%40apereo.org.

Petr Bodnár

unread,
Aug 4, 2023, 7:31:24 PM8/4/23
to CAS Community, Ganesh Prasad
Hi Niral,

it looks like you are using JPA / database ticket registry for tickets. And probably while storing the OAuth ticket, its serialized length exceeds 32000 bytes (or chars) which are reserved for the target BODY column in the CAS_TICKETS table. Note that you can set <Logger name=" org.apereo.cas.support.oauth.web.endpoints.OAuth20AuthorizeEndpointController " level="debug" />  in your log4j2.xml to see the whole exception stacktrace and confirm the exact place of failure.

The solution should be to change (probably manually) the type of the BODY column e.g. to TEXT or whatever long-enough datatype your target database supports.

Reason: I guess that maybe you've already had a larger column in the database and depending on what you've got set in the cas.ticket.registry.jpa.ddl-auto setting, it was changed to CAS's default VARCHAR(32000) or similar during running the new CAS - or you are simply using a fresh database instance? And maybe in the new CAS version the OAuth ticket holds more data than before. Even if 32k looks like being sufficient, it apparently isn't in this case...

Petr
Reply all
Reply to author
Forward
0 new messages