Hello,
I’m trying to move a layer from one Geoserver instance to another. Both
instances have the same security settings (I literally copied the security
folder over). I ran the backup plugin, and then attempted to restore that
backup archive into the new instance. I get the error listed below. The error
is occurring in the
org.geoserver.security.GeoServerSecurityManager.migrateFrom21 method, which
seems strange to me because my security version.properties file is clearly
indicating version 2.5:
#Current version of the security directory. Do not remove or alter this file
#Tue Oct 08 00:30:16 UTC 2019
version=2.5
So it seems to me that migrateFrom21 should never be called. Looking at the
code of org.geoserver.security.GeoServerSecurityManager.getSecurityVersion, I
see that BASE_VERSION is 2.1, so I’m guessing that BASE_VERSION is being
returned instead of the correct version, but I’m unable to figure out why it is
not loading the security version properly. Everything else seems to be working
fine. Any help would be appreciated.
Stacktrace:
2020-05-15 18:42:07,982 ERROR
[org.springframework.batch.core.step.AbstractStep] - Encountered an error
executing step restoreGeoServerSecurityManager in job restoreJob
java.util.concurrent.ExecutionException:
org.springframework.batch.core.UnexpectedJobExecutionException: Exception
occurred while storing GeoServer security and services settings!
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at
org.geoserver.backuprestore.tasklet.AbstractCatalogBackupRestoreTasklet.execute(AbstractCatalogBackupRestoreTasklet.java:226)
at
org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)
at
org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at
org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)
at
org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:81)
at
org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:374)
at
org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
at
org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)
at
org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)
at
org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:200)
at
org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at
org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
at
org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
at
org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169)
at
org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
at
org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)
at
org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306)
at
org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
at
org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:275)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.springframework.batch.core.UnexpectedJobExecutionException:
Exception occurred while storing GeoServer security and services settings!
at
org.geoserver.backuprestore.tasklet.CatalogSecurityManagerTasklet.doExecute(CatalogSecurityManagerTasklet.java:147)
at
org.geoserver.backuprestore.tasklet.AbstractCatalogBackupRestoreTasklet$4.call(AbstractCatalogBackupRestoreTasklet.java:207)
at
org.geoserver.backuprestore.tasklet.AbstractCatalogBackupRestoreTasklet$4.call(AbstractCatalogBackupRestoreTasklet.java:203)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 1 more
Caused by: java.lang.RuntimeException:
org.geoserver.security.xml.XMLSecurityConfigException: Password policy default
already exists
at
org.geoserver.security.GeoServerSecurityManager.reload(GeoServerSecurityManager.java:415)
at
org.geoserver.backuprestore.tasklet.CatalogSecurityManagerTasklet.doExecute(CatalogSecurityManagerTasklet.java:141)
... 4 more
Caused by: org.geoserver.security.xml.XMLSecurityConfigException: Password
policy default already exists
at
org.geoserver.security.xml.XMLSecurityConfigValidator.createSecurityException(XMLSecurityConfigValidator.java:177)
at
org.geoserver.security.validation.SecurityConfigValidator.validateAddNamedService(SecurityConfigValidator.java:322)
at
org.geoserver.security.validation.SecurityConfigValidator.validateAddPasswordPolicy(SecurityConfigValidator.java:355)
at
org.geoserver.security.GeoServerSecurityManager.savePasswordPolicy(GeoServerSecurityManager.java:1083)
at
org.geoserver.security.GeoServerSecurityManager.migrateFrom21(GeoServerSecurityManager.java:2133)
at
org.geoserver.security.GeoServerSecurityManager.reload(GeoServerSecurityManager.java:399)
... 5 more
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
If you want to request a feature or an improvement, also see this:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users