Skip to content

Mixed results on importing via REST API #679

@debakkerb

Description

@debakkerb

I've reported this problem already, but we keep running into it. It's very unpredictable, but quite often we run into the following problem when importing a file with data:

Caused by: java.lang.RuntimeException: 30,000 milliseconds timeout on connection http-outgoing-46 [ACTIVE]
	at org.springframework.data.elasticsearch.client.elc.ElasticsearchExceptionTranslator.translateException(ElasticsearchExceptionTranslator.java:63)
	... 46 common frames omitted
Caused by: java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection http-outgoing-46 [ACTIVE]
	at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:915)
	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:300)
	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
	at co.elastic.clients.transport.rest_client.RestClientHttpClient.performRequest(RestClientHttpClient.java:91)
	at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:144)
	at co.elastic.clients.elasticsearch.ElasticsearchClient.bulk(ElasticsearchClient.java:337)
	at org.springframework.data.elasticsearch.client.elc.ElasticsearchTemplate.lambda$doBulkOperation$11(ElasticsearchTemplate.java:296)
	at org.springframework.data.elasticsearch.client.elc.ElasticsearchTemplate.execute(ElasticsearchTemplate.java:633)
	... 45 common frames omitted
Caused by: java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection http-outgoing-46 [ACTIVE]
	at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.timeout(HttpAsyncRequestExecutor.java:387)
	at org.apache.http.impl.nio.client.InternalIODispatch.onTimeout(InternalIODispatch.java:98)
	at org.apache.http.impl.nio.client.InternalIODispatch.onTimeout(InternalIODispatch.java:40)
	at org.apache.http.impl.nio.reactor.AbstractIODispatch.timeout(AbstractIODispatch.java:175)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.sessionTimedOut(BaseIOReactor.java:261)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.timeoutCheck(AbstractIOReactor.java:506)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.validate(BaseIOReactor.java:211)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
	... 1 common frames omitted

We've already changed the startup parameters to reduce the batch size, but apparently that doesn't seem to fix the issue at hand:

    "--add-opens",
    "java.base/java.util=ALL-UNNAMED",
    "-Djava.security.egd=file:/dev/./urandom",
    "-Djavax.net.ssl.trustStore=/truststore/cacerts",
    "--add-opens=java.base/java.lang=ALL-UNNAMED",
    "-cp",
    "@/app/jib-classpath-file",
    "org.snomed.snowstorm.SnowstormApplication",
    "-Xms8g",
    "-Xmx10g",
    "--server.servlet.context-path=/snowstorm",
    "--elasticsearch.api-key=$(es_apikey)",
    "--elasticsearch.urls=https://ES_URL",
    "--elasticsearch.index.prefix=${var.namespace}-",
    "--elasticvc.save.batch-size=2500",

On Friday an import failed and now I'm running into the issue again that the MAIN is locked, with no way of unlocking it.

{
  "path" : "MAIN",
  "state" : "UP_TO_DATE",
  "containsContent" : true,
  "locked" : true,
  "creation" : "2025-05-09T03:57:26.119Z",
  "base" : "2025-05-09T03:57:26.119Z",
  "head" : "2025-05-09T03:57:26.405Z",
  "creationTimestamp" : 1746763046119,
  "baseTimestamp" : 1746763046119,
  "headTimestamp" : 1746763046405,
  "userRoles" : [ ],
  "metadata" : {
    "internal" : { },
    "lock" : {
      "context" : {
        "description" : "Loading components from RF2 import.",
        "userId" : "anonymousUser"
      },
      "creationDate" : "2025-05-09T06:26:04Z"
    }
  },
  "versionsReplacedCounts" : {
    "ReferenceSetType" : 0
  },
  "globalUserRoles" : [ ]
}

What's also weird is that whenever I start an import, I poll the /imports/ endpoint every 60 seconds to check where we are and to inform users that the import has finished. On Friday (and this has happened in the past), it seems like the import job has suddenly vanished from Snowstorm. The Status goes from RUNNING to an empty string, meaning that the import can't be retrieved anymore. It doesn't look like snowstorm has restarted, which would explain the behaviour.

When I now check the status of the import, I'm getting the following response:

{
  "status" : "FAILED",
  "type" : "SNAPSHOT",
  "branchPath" : "MAIN",
  "internalRelease" : false,
  "moduleIds" : [ ],
  "createCodeSystemVersion" : false
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions