IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
208 stars 83 forks source link

IllegalStateException error "Branch MAIN is already locked" when trying to import new INT release #60

Closed Lotili closed 5 years ago

Lotili commented 5 years ago

Hi there,

I'm trying to import the latest International release (20190731) RF2 files into Snowstorm. My understanding was that this should be done by creating a DELTA import job on the MAIN branch. However once I upload the RF2 zip file, I get an IllegalStateException with the following message : "Branch MAIN is already locked". I tried to update the MAIN branch to unlock it, but as expected, this branch can't be modified.

Am I missing something? Thanks

Full copy of the logs: https://pastebin.com/4RwAALbc And here's the full error:


java.lang.IllegalStateException: Branch MAIN is already locked
at io.kaicode.elasticvc.api.BranchService.lockBranch(BranchService.java:254)
at io.kaicode.elasticvc.api.BranchService.openCommit(BranchService.java:244)
at io.kaicode.elasticvc.api.BranchService.openCommit(BranchService.java:235)
at org.snomed.snowstorm.core.rf2.rf2import.ImportComponentFactoryImpl.loadingComponentsStarting(ImportComponentFactoryImpl.java:165)
at org.ihtsdo.otf.snomedboot.ReleaseImporter$ImportRun.doLoadReleaseFiles(ReleaseImporter.java:188)
at org.ihtsdo.otf.snomedboot.ReleaseImporter$ImportRun.doLoadReleaseFiles(ReleaseImporter.java:159)
at org.ihtsdo.otf.snomedboot.ReleaseImporter$ImportRun.access$100(ReleaseImporter.java:145)
at org.ihtsdo.otf.snomedboot.ReleaseImporter.loadDeltaReleaseFiles(ReleaseImporter.java:51)
at org.ihtsdo.otf.snomedboot.ReleaseImporter.loadDeltaReleaseFiles(ReleaseImporter.java:85)
at org.snomed.snowstorm.core.rf2.rf2import.ImportService.importArchive(ImportService.java:101)
at org.snomed.snowstorm.core.rf2.rf2import.ImportService.lambda$importArchiveAsync$1(ImportService.java:145)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)```
kaicode commented 5 years ago

Hi @Lotili, Branches are locked during a commit to prevent a second commit starting on the same branch at the same time. If you are sure there are no commits running on the MAIN branch you can use the REST API endpoint POST /branches/{path}/actions/unlock to remove the branch lock. From there you should be able to run the DELTA import to update the International Edition, this is the right approach. Kind regards, Kai

Lotili commented 5 years ago

Thanks @kaicode I successfully uploaded the last release. Closing the issue.

kaicode commented 5 years ago

Great news. Thanks for letting us know 👍