java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes)

JIRA | Carlos Silva | 2 years ago
  1. 0

    I found this interesting issue with session timeouts/logouts and data import. When we start a data import operation (doesn't matter the type), the actual work is done in a separate in a separate thread. At some point in the import process, the credentials/session is checked (actually done in SecuredDatasource.getValueTable). The delay between the start of the job and this moment depends on the amount of rows/data being imported. When the data to import is small, there is no problem, but when the data file is 'big', and i mean more than 50k rows (for example), there is a change the Opal session timed out, or simply the used logged out, and then the import fails. From the design point of view, i would expect the jobs to be really autonomous, and be able to finish without the need of an active session. Because of this late authorization check in SecuredDatasource, that is not the case. Some kind of session heartbeat solution only works for timeouts, but not for logouts, so probably we must to all the permission checks even before starting the job. Here the stack traces for both the timeout and logout: {code} 1747456 [pool-1-thread-3] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'sesidev288.500k' (copyMetadata=true, copyValues=false). 1755398 [pool-1-thread-3] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.apache.shiro.session.mgt.SimpleSession.validate(SimpleSession.java:292) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doValidate(AbstractValidatingSessionManager.java:186) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.validate(AbstractValidatingSessionManager.java:143) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:120) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 13.81 min 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.service.impl.DefaultCommandJobService - CommandJob 3 finished executing {code} {code} 3647217 [pool-1-thread-5] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'carlos.500k' (copyMetadata=true, copyValues=false). 3654264 [pool-1-thread-5] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170) at org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:261) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 3654264 [pool-1-thread-5] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 12.14 min {code}

    JIRA | 2 years ago | Carlos Silva
    java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes)
  2. 0

    I found this interesting issue with session timeouts/logouts and data import. When we start a data import operation (doesn't matter the type), the actual work is done in a separate in a separate thread. At some point in the import process, the credentials/session is checked (actually done in SecuredDatasource.getValueTable). The delay between the start of the job and this moment depends on the amount of rows/data being imported. When the data to import is small, there is no problem, but when the data file is 'big', and i mean more than 50k rows (for example), there is a change the Opal session timed out, or simply the used logged out, and then the import fails. From the design point of view, i would expect the jobs to be really autonomous, and be able to finish without the need of an active session. Because of this late authorization check in SecuredDatasource, that is not the case. Some kind of session heartbeat solution only works for timeouts, but not for logouts, so probably we must to all the permission checks even before starting the job. Here the stack traces for both the timeout and logout: {code} 1747456 [pool-1-thread-3] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'sesidev288.500k' (copyMetadata=true, copyValues=false). 1755398 [pool-1-thread-3] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.apache.shiro.session.mgt.SimpleSession.validate(SimpleSession.java:292) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doValidate(AbstractValidatingSessionManager.java:186) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.validate(AbstractValidatingSessionManager.java:143) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:120) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 13.81 min 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.service.impl.DefaultCommandJobService - CommandJob 3 finished executing {code} {code} 3647217 [pool-1-thread-5] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'carlos.500k' (copyMetadata=true, copyValues=false). 3654264 [pool-1-thread-5] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170) at org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:261) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 3654264 [pool-1-thread-5] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 12.14 min {code}

    JIRA | 2 years ago | Carlos Silva
    java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes)
  3. 0

    I found this interesting issue with session timeouts/logouts and data import. When we start a data import operation (doesn't matter the type), the actual work is done in a separate in a separate thread. At some point in the import process, the credentials/session is checked (actually done in SecuredDatasource.getValueTable). The delay between the start of the job and this moment depends on the amount of rows/data being imported. When the data to import is small, there is no problem, but when the data file is 'big', and i mean more than 50k rows (for example), there is a change the Opal session timed out, or simply the used logged out, and then the import fails. From the design point of view, i would expect the jobs to be really autonomous, and be able to finish without the need of an active session. Because of this late authorization check in SecuredDatasource, that is not the case. Some kind of session heartbeat solution only works for timeouts, but not for logouts, so probably we must to all the permission checks even before starting the job. Here the stack traces for both the timeout and logout: {code} 1747456 [pool-1-thread-3] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'sesidev288.500k' (copyMetadata=true, copyValues=false). 1755398 [pool-1-thread-3] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.apache.shiro.session.mgt.SimpleSession.validate(SimpleSession.java:292) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doValidate(AbstractValidatingSessionManager.java:186) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.validate(AbstractValidatingSessionManager.java:143) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:120) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 13.81 min 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.service.impl.DefaultCommandJobService - CommandJob 3 finished executing {code} {code} 3647217 [pool-1-thread-5] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'carlos.500k' (copyMetadata=true, copyValues=false). 3654264 [pool-1-thread-5] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170) at org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:261) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 3654264 [pool-1-thread-5] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 12.14 min {code}

    JIRA | 2 years ago | Carlos Silva
    java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I found this interesting issue with session timeouts/logouts and data import. When we start a data import operation (doesn't matter the type), the actual work is done in a separate in a separate thread. At some point in the import process, the credentials/session is checked (actually done in SecuredDatasource.getValueTable). The delay between the start of the job and this moment depends on the amount of rows/data being imported. When the data to import is small, there is no problem, but when the data file is 'big', and i mean more than 50k rows (for example), there is a change the Opal session timed out, or simply the used logged out, and then the import fails. From the design point of view, i would expect the jobs to be really autonomous, and be able to finish without the need of an active session. Because of this late authorization check in SecuredDatasource, that is not the case. Some kind of session heartbeat solution only works for timeouts, but not for logouts, so probably we must to all the permission checks even before starting the job. Here the stack traces for both the timeout and logout: {code} 1747456 [pool-1-thread-3] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'sesidev288.500k' (copyMetadata=true, copyValues=false). 1755398 [pool-1-thread-3] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes) at org.apache.shiro.session.mgt.SimpleSession.validate(SimpleSession.java:292) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doValidate(AbstractValidatingSessionManager.java:186) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.validate(AbstractValidatingSessionManager.java:143) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:120) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 13.81 min 1755434 [pool-1-thread-3] INFO org.obiba.opal.shell.service.impl.DefaultCommandJobService - CommandJob 3 finished executing {code} {code} 3647217 [pool-1-thread-5] INFO org.obiba.magma.support.DatasourceCopier - Copying ValueTable '500k' to 'carlos.500k' (copyMetadata=true, copyValues=false). 3654264 [pool-1-thread-5] ERROR org.obiba.opal.shell.commands.ImportCommand - Runtime error while importing data java.lang.RuntimeException: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105) at org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87) at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155) at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89) at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68) ... Caused by: org.apache.shiro.session.UnknownSessionException: There is no session with id [89d982c3-37f4-4356-84ad-d55cc5483215] at org.apache.shiro.session.mgt.eis.AbstractSessionDAO.readSession(AbstractSessionDAO.java:170) at org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:261) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236) at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222) at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:108) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:112) at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:209) at org.apache.shiro.session.mgt.DelegatingSession.getAttribute(DelegatingSession.java:141) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.session.ProxiedSession.getAttribute(ProxiedSession.java:121) at org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack(DelegatingSubject.java:469) at org.apache.shiro.subject.support.DelegatingSubject.getPrincipals(DelegatingSubject.java:153) at org.apache.shiro.subject.support.DelegatingSubject.hasPrincipals(DelegatingSubject.java:126) at org.apache.shiro.subject.support.DelegatingSubject.isPermitted(DelegatingSubject.java:158) at org.obiba.magma.security.shiro.ShiroAuthorizer.isPermitted(ShiroAuthorizer.java:21) at org.obiba.magma.security.SecuredDatasource.authzReadTable(SecuredDatasource.java:68) at org.obiba.magma.security.SecuredDatasource.getValueTable(SecuredDatasource.java:30) at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:214) at org.obiba.magma.support.MultithreadedDatasourceCopier.copyVariables(MultithreadedDatasourceCopier.java:222) at org.obiba.magma.support.MultithreadedDatasourceCopier.write(MultithreadedDatasourceCopier.java:182) at org.obiba.magma.support.MultithreadedDatasourceCopier.copy(MultithreadedDatasourceCopier.java:172) at org.obiba.opal.core.service.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:159) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42) at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31) at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:149) ... 13 more 3654264 [pool-1-thread-5] INFO org.obiba.opal.shell.commands.ImportCommand - Import failed in 12.14 min {code}

    JIRA | 2 years ago | Carlos Silva
    java.lang.RuntimeException: org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes)
  6. 0

    general - Bug#790784: marked as done (exiv2: Package description incomplete) - msg#23051 - Recent Discussion OSDir.com

    osdir.com | 5 months ago
    java.lang.RuntimeException: org.apache.tez.dag.api.SessionNotRunning: TezSession has already shutdown. No cluster diagnostics found" for some of the jobs I am running. The cluster are heavily loaded. I am suspecting this to be some kind of time-out issue. Any pointer or tez setting that needs to be looked into would be helpful. From the log I can infer even the application has not started.Logs:16/04/09 14:15:11 WARN conf.HiveConf: HiveConf of name hive.semantic.analyzer.factory.impl does not existLogging initialized using configuration in file:/etc/hive/conf/hive-log4j.propertiesSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/usr/hdp/2.2.4.2-2/hadoop/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/usr/hdp/2.2.4.2-2/hive/lib/hive-jdbc-0.14.0.2.2.4.2-2-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]Exception in thread "main" java.lang.RuntimeException: org.apache.tez.dag.api.SessionNotRunning: TezSession has already shutdown. No cluster diagnostics found.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.RuntimeException

      org.apache.shiro.session.ExpiredSessionException: Session with id [5601dd9c-072c-44e7-9126-15b8c29ca98a] has expired. Last access time: 2/18/15 11:07 AM. Current time: 2/18/15 11:21 AM. Session timeout is set to 120 seconds (2 minutes)

      at org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables()
    2. org.obiba.opal
      ImportCommand.execute
      1. org.obiba.opal.core.service.DataImportServiceImpl.copyValueTables(DataImportServiceImpl.java:157)
      2. org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:105)
      3. org.obiba.opal.core.service.DataImportServiceImpl.importData(DataImportServiceImpl.java:87)
      4. org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:155)
      5. org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:89)
      6. org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:68)
      6 frames