IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
181 stars 73 forks source link

Classification with Snowstorm #314

Open waydes opened 2 years ago

waydes commented 2 years ago

I am trying to understand how to use the classification API in Snowstorm. I want to test it on our Veterinary Extension. I think I have the correct files, but not completely sure. I loaded the International edition and then our Veterinary Extension. I tried to create branch classification using GET /{branch}/classifications and received the following error: { "error": "BAD_REQUEST", "message": "Missing branch metadata for previousPackage or dependencyPackage" } I am assuming the steps in classification require creating the classificationID and then using that classificationID to run the classifier.

Since that did not work, I thought I would use the International Release as a test branch. Retrieving the branch names, I decided to try MAIN/2021-01-31. However, when I tried to create the classification, I get the same error message as before: { "error": "BAD_REQUEST", "message": "Missing branch metadata for previousPackage or dependencyPackage" } I suspect I am missing something on this. Can you point me in the right direction or to documention to help me use the classifier?

kaicode commented 2 years ago

Hi @waydes,

At the moment Snowstorm delegates the task of classification to the Classification Service microservice.

Snowstorm Classification Overview The Snowstorm classification API is a way of creating a job for that service including a delta export of any changes from the current authoring cycle. The Snowstorm API will consume the results of the job once it is finished and support presenting the results for review. The user can then choose to save the classification changes which results in changes to the inferred relationships.

Setup

Example branch metadata for classification of the Belgian extension on the MAIN/SNOMEDCT-BE branch:

{
  "metadata": {
    "previousPackage": "SnomedCT_BelgiumExtensionRF2_PRODUCTION_20210315T120000Z.zip",
    "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip",
  }
}

The Classification Service uses the Snomed Owl Toolkit as a Java library. That is capable of classifying SNOMED CT on the command line which can be a nice quick test to check that the classification service will be able to load your release packages. (I know the Veterinary Extension uses datetime stamps which may be problematic).

Kind regards, Kai Kewley

waydes commented 2 years ago

Hi Kai, Thanks so much for the response. I will work on that. I have solved the timestamp simply doing a RegEx search and replace to remove the field for the time. Have a great day.

Wayde Shipman, DVM, MS Veterinary Medical Databases, President Veterinary Medical Information Specialist, Virginia Tech Oaks Veterinary Clinic, League City, Texas

Office - 281-332-9180 (preferred) Cell - 832-444-5538 [image: ]

On Thu, Sep 2, 2021 at 3:43 PM Kai Kewley @.***> wrote:

Hi @waydes https://github.com/waydes,

At the moment Snowstorm delegates the task of classification to the Classification Service microservice https://github.com/IHTSDO/classification-service.

Snowstorm Classification Overview The Snowstorm classification API is a way of creating a job for that service including a delta export of any changes from the current authoring cycle. The Snowstorm API will consume the results of the job once it is finished and support presenting the results for review. The user can then choose to save the classification changes which results in changes to the inferred relationships.

Setup

  • The Classification Service must be set up and running, see setup notes https://github.com/IHTSDO/classification-service#setup
  • Update the Classification-Service Snowstorm configuration https://github.com/IHTSDO/snowstorm/blob/7.1.2/src/main/resources/application.properties#L280
  • Add previousPackage and dependencyPackage items to the branch metadata on the extension branch with the names of the packages the Classification Service should load before applying any authored changes exported from Snowstorm. The previousPackage is the previous release of the extension, containing just the concepts from the extension. The dependencyPackage is the package that the extension is dependent on. Together these make up a whole ontology. To classify the International Edition or any extension that is packaged as an Edition (for example the US Edition) only the previousPackage setting is required.

Example branch metadata for classification of the Belgian extension on the MAIN/SNOMEDCT-BE branch:

{ "metadata": { "previousPackage": "SnomedCT_BelgiumExtensionRF2_PRODUCTION_20210315T120000Z.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", } }

The Classification Service uses the Snomed Owl Toolkit https://github.com/IHTSDO/snomed-owl-toolkit as a Java library. That is capable of classifying SNOMED CT on the command line https://github.com/IHTSDO/snomed-owl-toolkit#snomed-rf2-classification which can be a nice quick test to check that the classification service will be able to load your release packages. (I know the Veterinary Extension uses datetime stamps which may be problematic).

Kind regards, Kai Kewley

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-912041752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF34X33WEJTV6QHMTBU3T77OY5ANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kaicode commented 2 years ago

Great idea! Best of luck.

waydes commented 2 years ago

Hi Kai, Can you clarify where I make these changes so I can try the vet extension? I have looked at the setup files and the api's but I am not certain where I need to make the changes. I copied the zip files for the international release and our extension to the store/releases folder

Example branch metadata for classification of the Belgian extension on the MAIN/SNOMEDCT-BE branch:

{

"metadata": { "previousPackage": "SnomedCT_BelgiumExtensionRF2_PRODUCTION_20210315T120000Z.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", } }

should be changed to:

{ "metadata": { "previousPackage": "SnomedCT_VTSExtensionRF2_PRODUCTION_20210315T120000Z.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", } }

But where do I add these changes? Under an api? Which one? Or do I add it to one of the setup files?

Thanks in advance.

Wayde Shipman, DVM, MS Veterinary Medical Databases, President Veterinary Medical Information Specialist, Virginia Tech Oaks Veterinary Clinic, League City, Texas

Office - 281-332-9180 (preferred) Cell - 832-444-5538 [image: ]

On Thu, Sep 2, 2021 at 3:43 PM Kai Kewley @.***> wrote:

Hi @waydes https://github.com/waydes,

At the moment Snowstorm delegates the task of classification to the Classification Service microservice https://github.com/IHTSDO/classification-service.

Snowstorm Classification Overview The Snowstorm classification API is a way of creating a job for that service including a delta export of any changes from the current authoring cycle. The Snowstorm API will consume the results of the job once it is finished and support presenting the results for review. The user can then choose to save the classification changes which results in changes to the inferred relationships.

Setup

  • The Classification Service must be set up and running, see setup notes https://github.com/IHTSDO/classification-service#setup
  • Update the Classification-Service Snowstorm configuration https://github.com/IHTSDO/snowstorm/blob/7.1.2/src/main/resources/application.properties#L280
  • Add previousPackage and dependencyPackage items to the branch metadata on the extension branch with the names of the packages the Classification Service should load before applying any authored changes exported from Snowstorm. The previousPackage is the previous release of the extension, containing just the concepts from the extension. The dependencyPackage is the package that the extension is dependent on. Together these make up a whole ontology. To classify the International Edition or any extension that is packaged as an Edition (for example the US Edition) only the previousPackage setting is required.

Example branch metadata for classification of the Belgian extension on the MAIN/SNOMEDCT-BE branch:

{ "metadata": { "previousPackage": "SnomedCT_BelgiumExtensionRF2_PRODUCTION_20210315T120000Z.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", } }

The Classification Service uses the Snomed Owl Toolkit https://github.com/IHTSDO/snomed-owl-toolkit as a Java library. That is capable of classifying SNOMED CT on the command line https://github.com/IHTSDO/snomed-owl-toolkit#snomed-rf2-classification which can be a nice quick test to check that the classification service will be able to load your release packages. (I know the Veterinary Extension uses datetime stamps which may be problematic).

Kind regards, Kai Kewley

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-912041752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF34X33WEJTV6QHMTBU3T77OY5ANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kaicode commented 2 years ago

Hi!

The Swagger interface is the easy way to make these sorts of one-off changes. Your browser will be redirected to the Swagger API page when you access the root of the Snowstorm application, for example http://localhost:8080 .

Look for the Branches section and then the PUT /branches/{branch} endpoint. Then input branch: MAIN/SNOMEDCT-VTS (assuming your extension is set up there) and request:

 "metadata": {
    "previousPackage": "SnomedCT_VTSExtensionRF2_PRODUCTION_20210315T120000Z.zip",
    "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip"
  }

Then hit the Try it out! button further down.

You can confirm that the change stuck by getting the branch. Either via swagger or directly, e.g. http://localhost:8080/branches/MAIN/SNOMEDCT-VTS

I hope that helps! Kai

waydes commented 2 years ago

I have notice an error message when using the Snomed Owl Toolkit. I am wondering what the significance, if any of this message:

2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete! 2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete! 2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete! 2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete! 2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete! 2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete! 2021-10-04 10:01:53,244 [WARN ] [main] org.semanticweb.elk.reasoner.indexing.hierarchy.IndexObjectConverter - [reasoner.indexing.dataHasValue]ELK supports DataHasValue only partially. Reasoning might be incomplete!

On Thu, Sep 2, 2021 at 3:43 PM Kai Kewley @.***> wrote:

Hi @waydes https://github.com/waydes,

At the moment Snowstorm delegates the task of classification to the Classification Service microservice https://github.com/IHTSDO/classification-service.

Snowstorm Classification Overview The Snowstorm classification API is a way of creating a job for that service including a delta export of any changes from the current authoring cycle. The Snowstorm API will consume the results of the job once it is finished and support presenting the results for review. The user can then choose to save the classification changes which results in changes to the inferred relationships.

Setup

  • The Classification Service must be set up and running, see setup notes https://github.com/IHTSDO/classification-service#setup
  • Update the Classification-Service Snowstorm configuration https://github.com/IHTSDO/snowstorm/blob/7.1.2/src/main/resources/application.properties#L280
  • Add previousPackage and dependencyPackage items to the branch metadata on the extension branch with the names of the packages the Classification Service should load before applying any authored changes exported from Snowstorm. The previousPackage is the previous release of the extension, containing just the concepts from the extension. The dependencyPackage is the package that the extension is dependent on. Together these make up a whole ontology. To classify the International Edition or any extension that is packaged as an Edition (for example the US Edition) only the previousPackage setting is required.

Example branch metadata for classification of the Belgian extension on the MAIN/SNOMEDCT-BE branch:

{ "metadata": { "previousPackage": "SnomedCT_BelgiumExtensionRF2_PRODUCTION_20210315T120000Z.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", } }

The Classification Service uses the Snomed Owl Toolkit https://github.com/IHTSDO/snomed-owl-toolkit as a Java library. That is capable of classifying SNOMED CT on the command line https://github.com/IHTSDO/snomed-owl-toolkit#snomed-rf2-classification which can be a nice quick test to check that the classification service will be able to load your release packages. (I know the Veterinary Extension uses datetime stamps which may be problematic).

Kind regards, Kai Kewley

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-912041752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF34X33WEJTV6QHMTBU3T77OY5ANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kaicode commented 2 years ago

Yes, this warning from ELK is quite annoying. I have tried more than once to suppress these warning messages but have not been successful. They can be safely ignored for our SNOMED CT purposes.

waydes commented 2 years ago

I have still not been able to get this to work. I am using Windows 10, so I am wondering that is the problem.

I have gone back to Rory's exercise on loading SNOMED International, and I get the same error message: 2021-10-07 13:58:38.990 INFO 4896 --- [pool-2-thread-1] o.s.s.core.rf2.rf2import.ImportService : Starting RF2 SNAPSHOT import on branch MAIN. ID 76fa98f3-66ba-4a9e-b8e1-547b0e692504 2021-10-07 13:58:39.004 ERROR 4896 --- [pool-2-thread-1] o.s.s.core.rf2.rf2import.ImportService : Failed RF2 SNAPSHOT import on branch MAIN. ID 76fa98f3-66ba-4a9e-b8e1-547b0e692504

org.ihtsdo.otf.snomedboot.ReleaseImportException: Failed to unzip Snomed Snapshot release file. at org.ihtsdo.otf.snomedboot.ReleaseImporter.unzipRelease(ReleaseImporter.java:160) at org.ihtsdo.otf.snomedboot.ReleaseImporter.unzipRelease(ReleaseImporter.java:108) at org.ihtsdo.otf.snomedboot.ReleaseImporter.loadSnapshotReleaseFiles(ReleaseImporter.java:79) at org.snomed.snowstorm.core.rf2.rf2import.ImportService.snapshotImport(ImportService.java:203) at org.snomed.snowstorm.core.rf2.rf2import.ImportService.importFiles(ImportService.java:156) at org.snomed.snowstorm.core.rf2.rf2import.ImportService.importArchive(ImportService.java:109) at org.snomed.snowstorm.core.rf2.rf2import.ImportService.lambda$importArchiveAsync$1(ImportService.java:250) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835) Caused by: java.io.IOException: Stream Closed at java.base/java.io.FileInputStream.readBytes(Native Method) at java.base/java.io.FileInputStream.read(FileInputStream.java:251) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1127) at org.apache.commons.io.IOUtils.copy(IOUtils.java:849) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1104) at org.apache.commons.io.IOUtils.copy(IOUtils.java:825) at org.ihtsdo.otf.snomedboot.ReleaseImporter.unzipRelease(ReleaseImporter.java:132) ... 11 common frames omitted

This is the importRequest I am using: { "branchPath": "MAIN", "createCodeSystemVersion": true, "filePath": "E:\SNOMED\SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", "type": "SNAPSHOT" }

If I use a single backslash, I get a character error message, so I know I have to escape the backslash. I also tried changing the two backlashes to a single forward slash. I get the same Failed to unzip Snomed Snapshot release file error. I downloaded the SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip directly from NLM, so I am assuming it is not corrupted but maybe that is the problem? Can you direct me to an alternate source of release files to test that idea. Any other thoughts? Thanks,

On Thu, Sep 2, 2021 at 4:43 PM Kai Kewley @.***> wrote:

Hi @waydes https://github.com/waydes,

At the moment Snowstorm delegates the task of classification to the Classification Service microservice https://github.com/IHTSDO/classification-service.

Snowstorm Classification Overview The Snowstorm classification API is a way of creating a job for that service including a delta export of any changes from the current authoring cycle. The Snowstorm API will consume the results of the job once it is finished and support presenting the results for review. The user can then choose to save the classification changes which results in changes to the inferred relationships.

Setup

  • The Classification Service must be set up and running, see setup notes https://github.com/IHTSDO/classification-service#setup
  • Update the Classification-Service Snowstorm configuration https://github.com/IHTSDO/snowstorm/blob/7.1.2/src/main/resources/application.properties#L280
  • Add previousPackage and dependencyPackage items to the branch metadata on the extension branch with the names of the packages the Classification Service should load before applying any authored changes exported from Snowstorm. The previousPackage is the previous release of the extension, containing just the concepts from the extension. The dependencyPackage is the package that the extension is dependent on. Together these make up a whole ontology. To classify the International Edition or any extension that is packaged as an Edition (for example the US Edition) only the previousPackage setting is required.

Example branch metadata for classification of the Belgian extension on the MAIN/SNOMEDCT-BE branch:

{ "metadata": { "previousPackage": "SnomedCT_BelgiumExtensionRF2_PRODUCTION_20210315T120000Z.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip", } }

The Classification Service uses the Snomed Owl Toolkit https://github.com/IHTSDO/snomed-owl-toolkit as a Java library. That is capable of classifying SNOMED CT on the command line https://github.com/IHTSDO/snomed-owl-toolkit#snomed-rf2-classification which can be a nice quick test to check that the classification service will be able to load your release packages. (I know the Veterinary Extension uses datetime stamps which may be problematic).

Kind regards, Kai Kewley

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-912041752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF34X33WEJTV6QHMTBU3T77OY5ANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kaicode commented 2 years ago

Could you try uploading the archive through the API rather than pointing to a file on the server disk?

Create an import job using: POST /imports Then in the "Response Headers" section look for the "location" header and take the UUID from the end of the URL, for example something like "ba675592-f672-4722-8b33-f0cc40c61452".

Then upload the archive using: POST /imports/{importId}/archive The importId parameter is your UUID from your previous request.

waydes commented 2 years ago

Yes, that also works. The only one that does not work for me is in Exercise #1 on https://confluence.ihtsdotools.org/pages/viewpage.action?pageId=96808301. I am using the 7/31/2021 release.

Loading the initial data

Next load the SNAPSHOT of the January 2021 International Edition. (Documentation available loading-snomed https://github.com/IHTSDO/snowstorm/blob/master/docs/loading-snomed.md)

We will use the REST API to run the imports. Access the Snowstorm swagger interface using the AWS instance ip-address and port 8080, for example - http://:8080/

First we need to start the import process by creating a new import job. Look for the Import endpoints and then create a new import using the start-local-file-import endpoint with the following importRequest parameter { "branchPath": "MAIN", "createCodeSystemVersion": true, "filePath": "/opt/releases/SnomedCT_InternationalRF2_PRODUCTION_20210131T120000Z.zip", "type": "SNAPSHOT" }

... and click on 'Try it now'.

The Response Headers will contain the location of the newly created job. Copy this URL into a new tab to monitor the status of the job.

You can watch the Snowstorm log to see how this is progressing or fetch the job status from the import job URL - http://:8080/imports/ .

This should take around 30 minutes.

On Thu, Oct 14, 2021 at 6:22 AM Kai Kewley @.***> wrote:

Could you try uploading the archive through the API rather than pointing to a file on the server disk?

Create an import job using: POST /imports Then in the "Response Headers" section look for the "location" header and take the UUID from the end of the URL, for example something like "ba675592-f672-4722-8b33-f0cc40c61452".

Then upload the archive using: POST /imports/{importId}/archive The importId parameter is your UUID from your previous request.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-943264157, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF3ZI53LU276LE62HK6TUG24QRANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kaicode commented 2 years ago

Hi @waydes, just following up on this to see if you would like further assistance?

waydes commented 2 years ago

Any suggestions or solutions appreciated.

The snomed-owl-toolkit works from command line. When I try to use the Snowstorm API PUT /{branch}/classifications with { "metadata": { "previousPackage": "SnomedCT_Release_VTS1000009_20211001_mod.zip", "dependencyPackage": "SnomedCT_InternationalRF2_PRODUCTION_20220131T120000Z.zip" } } set correctly, and the files in the /store/releases directory, I get this error from Snowstorm: { "error": "INTERNAL_SERVER_ERROR", "message": "Failed to create classification." }

When I check the output in the terminal where Snowstorm is running, I get this stack trace and error message: 2022-02-08 16:43:04.385 ERROR 56339 --- [nio-8080-exec-1] o.s.s.rest.config.RestControllerAdvice : Failed to create classification.

org.snomed.snowstorm.core.data.services.ServiceException: Failed to create classification. at org.snomed.snowstorm.core.data.services.classification.ClassificationService.createClassification(ClassificationService.java:362) at org.snomed.snowstorm.core.data.services.classification.ClassificationService$$FastClassBySpringCGLIB$$6e11b14e.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687) at org.snomed.snowstorm.core.data.services.classification.ClassificationService$$EnhancerBySpringCGLIB$$cfd94a16.createClassification() at org.snomed.snowstorm.rest.ClassificationController.createClassification(ClassificationController.java:106) at org.snomed.snowstorm.rest.ClassificationController$$FastClassBySpringCGLIB$$f4f52aa8.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687) at org.snomed.snowstorm.rest.ClassificationController$$EnhancerBySpringCGLIB$$f96b127b.createClassification() at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterRequestDispatcher.forward(HeaderWriterFilter.java:172) at io.kaicode.rest.util.branchpathrewrite.BranchPathUriRewriteFilter.doFilter(BranchPathUriRewriteFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.snomed.snowstorm.rest.security.RequestHeaderAuthenticationDecoratorWithRequiredRole.doFilterInternal(RequestHeaderAuthenticationDecoratorWithRequiredRole.java:43) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 : [{"timestamp":"2022-02-08T22:43:04.350+0000","status":401,"error":"Unauthorized","message":"Unauthorized","path":"/classification-service/classifications"}] at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:105) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:184) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:125) at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:782) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:740) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:449) at org.snomed.snowstorm.core.data.services.classification.RemoteClassificationServiceClient.createClassification(RemoteClassificationServiceClient.java:68) at org.snomed.snowstorm.core.data.services.classification.ClassificationService.createClassification(ClassificationService.java:351) ... 121 common frames omitted

^[[A^[[B^C2022-02-08 16:44:39.974 INFO 56339 --- [extShutdownHook] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler' 2022-02-08 16:44:39.986 INFO 56339 --- [heManagerDaemon] o.s.s.c.d.s.i.IdentifierCacheManager : Identifier cache manager sleep interrupted. 2022-02-08 16:44:39.986 INFO 56339 --- [heManagerDaemon] o.s.s.c.d.s.i.IdentifierCacheManager : Identifier cache manager polling stopped.

CoderMChu commented 2 years ago

@waydes Can you please check the following configs are set correctly according to your classification service set up: classification-service.url= classification-service.username= classification-service.password=

The 401 error suggests that username and password are not configured properly which prevents snowstorm posting classification jobs.

waydes commented 2 years ago

Can you be more specific? Where is this configured? I thought it should be an application.properties file but I don't see one under the target folder after I compiled the server with mvn clean package. Do I need to create the application.properties file? Thanks

On Wed, Feb 9, 2022 at 10:13 AM Michael Chu @.***> wrote:

@waydes https://github.com/waydes Can you please check the following configs are set correctly according to your classification service set up: classification-service.url= classification-service.username= classification-service.password=

The 401 error suggests that username and password are not configured properly which prevents snowstorm posting classification jobs.

— Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-1033932973, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF36YQ6SN3CONZFQRLF3U2KHCDANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

CoderMChu commented 2 years ago

@waydes The default values are configured here in snowstorm https://github.com/IHTSDO/snowstorm/blob/master/src/main/resources/application.properties#L299 Yes you need to change these accordingly or add them in external application.properites file.

waydes commented 2 years ago

Thanks!

On Thu, Feb 10, 2022 at 10:28 AM Michael Chu @.***> wrote:

@waydes https://github.com/waydes The default values are configured here in snowstorm https://github.com/IHTSDO/snowstorm/blob/master/src/main/resources/application.properties#L299 Yes you need to change these accordingly or add them in external application.properites file.

— Reply to this email directly, view it on GitHub https://github.com/IHTSDO/snowstorm/issues/314#issuecomment-1035127777, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSUF3ZQGRPAJLD5D2PLMXDU2PRTFANCNFSM5DG7JA6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

waydes commented 2 years ago

The username and password are both set to classification, the default values. In reading the documentation, NGINX is mentioned as an authorization server. Do I need to add NGINX to get authorization to work correctly?