[
https://issues.jboss.org/browse/GTNPORTAL-3284?page=com.atlassian.jira.pl...
]
Marek Posolda commented on GTNPORTAL-3284:
------------------------------------------
I have a fix in this commit
https://github.com/mposolda/gatein-portal/commit/6cc77533f9d4f721adcc7421...
. For some reason, I can't send PR right now due to some strange github behaviour.
Will try it later...
I didn't reproduce the issue with GateIn/JPP, but I can imagine how it could happen.
Maybe it happens just for access tokens of some people for particular social network (For
some reason access tokens of some users could be longer than my access tokens etc).
However I've reproduced the issue with unit test with H2 profile (mvn test -Ph2), so I
think that I have a fix as unit test is passing now. The fix is actually trying to split
long access tokens into more "children" attributes (chunks) and add all those
chunked attributes into UserProfile. Solution should be backward-compatible with already
existing DB and JPP 6.1.
Errors in saving long access-token for some social networks
-----------------------------------------------------------
Key: GTNPORTAL-3284
URL:
https://issues.jboss.org/browse/GTNPORTAL-3284
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.6.3.Final
Reporter: Marek Posolda
Assignee: Marek Posolda
Fix For: 3.7.0.Final
In some cases, it could happen that during binding of user to some social network
(Facebook/Google/Twitter), the binding is not successful because of the fact that access
token or refresh token is too long and DB throws error because of size limit of particular
column (H2 has default limit of 255 characters per column)
The exception stacktrace could look like this:
{code}
12:06:50,595 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
(http-/127.0.0.1:8080-3) SQL Error: 22001, SQLState: 22001
12:06:50,595 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
(http-/127.0.0.1:8080-3) Value too long for column "ATTR_VALUE VARCHAR(255)":
"STRINGDECODE('VvjdI6prHvZXN6CG95jWIpkPLS0i6WMtitYVNeE8TRIfI3y+sCOxxJRqKIP9iCojWCajhup0QTro\nUe0YrgTbhKQbH7fMLEYOWKgtTNDt2omE5A0g...
(259)"; SQL statement:
insert into jbid_io_attr_text_values (TEXT_ATTR_VALUE_ID, ATTR_VALUE) values (?, ?)
[22001-168]
12:06:50,597 INFO [org.exoplatform.services.organization.idm.UserProfileDAOImpl]
(http-/127.0.0.1:8080-3) Identity operation error: :
org.hibernate.exception.DataException: could not execute statement
at
org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:134)
at
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
at
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at
org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:136)
at
org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:58)
at
org.hibernate.persister.collection.AbstractCollectionPersister.insertRows(AbstractCollectionPersister.java:1474)
at
org.hibernate.action.internal.CollectionUpdateAction.execute(CollectionUpdateAction.java:86)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:278)
at
org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:328)
at
org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:62)
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1205)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1655)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374)
at
org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl.getAttributes(HibernateIdentityStoreImpl.java:2108)
[picketlink-idm-hibernate-1.4.3.Final-redhat-2.jar:1.4.3.Final-redhat-2]
at
org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository.getAttributes(WrapperIdentityStoreRepository.java:392)
[picketlink-idm-core-1.4.3.Final-redhat-2.jar:1.4.3.Final-redhat-2]
at
org.picketlink.idm.impl.api.session.managers.AttributesManagerImpl.getAttributes(AttributesManagerImpl.java:194)
[picketlink-idm-core-1.4.3.Final-redhat-2.jar:1.4.3.Final-redhat-2]
at
org.picketlink.idm.impl.api.session.managers.AttributesManagerImpl.updateAttributes(AttributesManagerImpl.java:255)
[picketlink-idm-core-1.4.3.Final-redhat-2.jar:1.4.3.Final-redhat-2]
at
org.picketlink.idm.impl.api.session.managers.AttributesManagerImpl.updateAttributes(AttributesManagerImpl.java:280)
[picketlink-idm-core-1.4.3.Final-redhat-2.jar:1.4.3.Final-redhat-2]
at
org.exoplatform.services.organization.idm.UserProfileDAOImpl.setProfile(UserProfileDAOImpl.java:259)
[exo.portal.component.identity-3.6.3.Final-redhat-4.jar:3.6.3.Final-redhat-4]
at
org.exoplatform.services.organization.idm.UserProfileDAOImpl.saveUserProfile(UserProfileDAOImpl.java:97)
[exo.portal.component.identity-3.6.3.Final-redhat-4.jar:3.6.3.Final-redhat-4]
at
org.gatein.security.oauth.data.SocialNetworkServiceImpl.updateOAuthInfo(SocialNetworkServiceImpl.java:136)
[exo.portal.component.web.oauth-common-3.6.3.Final-redhat-4.jar:3.6.3.Final-redhat-4]
at
org.gatein.security.oauth.web.OAuthLinkAccountFilter.doFilter(OAuthLinkAccountFilter.java:91)
[exo.portal.component.web.oauth-web-3.6.3.Final-redhat-4.jar:3.6.3.Final-redhat-4]
at
org.gatein.sso.integration.SSODelegateFilter$SSOFilterChain.doFilter(SSODelegateFilter.java:119)
[sso-integration-1.3.4.Final-redhat-2.jar:1.3.4.Final-redhat-2]
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira