Discuss.FOLIO.org is no longer used. This is a static snapshot of the website as of February 14, 2023.

deployment on okapi

Alice
27 Mar '18

Hello.
I’m trying to deploy a test module on okapi remotely. I follow okapi’s guide on github . I deployed moduleDescriptor.json but I have some problem on deployDescriptor.

When I check clusters with curl:
curl -w '\n' http://192.168.0.28:9130/_/discovery/nodes
I get this response:
[ {
“nodeId” : “10.0.2.15”,
“url” : “http://10.0.2.15:9130
} ]
I use nodeId to write deployDescriptor.json and call
curl -w '\n' -D - -s -X POST -H "Content-type: application/json" -d @/home/alice/atcult/FOLIO/DeploymentDescriptor-template.json http://192.168.0.28:9130/_/discovery/modules
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Content-Length: 95

Deployment failed. Could not connect to port 9131: Connection refused: localhost/127.0.0.1:9131

Here it is the log in okapi vagrant server:
2018-03-27 14:16:14,015 INFO ProxyService No tenantId, defaulting to okapi.supertenant
2018-03-27 14:16:14,016 INFO ProxyContext 269554/discovery REQ 10.0.2.2:54466 okapi.supertenant POST //discovery/modules okapi-1.10.0
2018-03-27 14:16:14,019 INFO DiscoveryManager addAndDeploy: {
“srvcId” : “cataloging-1.0.0”,
“nodeId” : “10.0.2.15”
}
2018-03-27 14:16:14,023 INFO ProxyService No tenantId, defaulting to okapi.supertenant
2018-03-27 14:16:14,025 INFO ProxyContext 543504/deployment REQ 10.0.2.15:40356 okapi.supertenant POST /
/deployment/modules okapi-1.10.0
2018-03-27 14:16:14,026 INFO DeploymentManager deploy instId 10.0.2.15-9131
2018-03-27 14:17:47,157 ERROR ProcessModuleHandle Failed to connect to service at port 9131 : Connection refused: localhost/127.0.0.1:9131
2018-03-27 14:17:47,157 WARN DeploymentManager Deploying cataloging-1.0.0 failed
2018-03-27 14:17:47,157 INFO ProxyContext 543504/deployment RES 500 okapi Deployment failed. Could not connect to port 9131: Connection refused: localhost/127.0.0.1:9131

How can I avoid it to connect to the wrong url “localhost/127.0.0.1:9131” ?

Here my moduleDescriptor.json:

{

“id”: “cataloging-1.0.0”,
“name”: “cataloging”,
“provides”: [
{
“id”: “cataloging”,
“version”: “0.1”,
“handlers”: [
{
“methods”: [ “GET”],
“pathPattern”: “/cataloging/authority-sources”
}
]
}
],
“requires”: [],
“launchDescriptor”: {
“exec”: “java -Dport=%p -jar /etc/folio/mod-cataloging/mod-cataloging-fat.jar”
}
}

bzhou
10 Oct '18

I have the same problem when deploying mod-users-bl. Have you resolved it?


ModuleDescriptor.json :
“launchDescriptor”: {
“exec”: “java -Dport=%p -jar /work/folio-sample/server-modules/mod-users-bl/mod-users-bl-fat.jar”
}


My okapi start with -Dport_start=9140, and i deploy mod-users-bl by :
cat > ./deployUserBLModToNode[localhost].json <<END
{
“srvcId”: “mod-users-bl-4.0.3-SNAPSHOT”,
“nodeId”: “localhost”
}
END

curl -w ‘\n’ -D - -s
-X POST
-H “Content-type: application/json”
-d @deployUserBLModToNode[localhost].json
http://localhost:9130/_/discovery/modules


Here is the log of okapi:

19:47:30 INFO ProxyContext 785995/discovery REQ 127.0.0.1:52701 supertenant POST //discovery/modules okapi-2.18.0-SNAPSHOT
19:47:30 INFO DiscoveryManager addAndDeploy: {
“srvcId” : “mod-users-bl-4.0.3-SNAPSHOT”,
“nodeId” : “localhost”
}
19:47:30 INFO ProxyContext 785995/discovery;806274/deployment REQ 127.0.0.1:52702 supertenant POST /
/deployment/modules okapi-2.18.0-SNAPSHOT
19:47:30 INFO DeploymentManager deploy instId e2de3cca-e59f-4a48-bb83-26961b2f05a2
starting rest verticle service…
19:47:31 DEBUG Slf4JLogger Using SLF4J as the default logging framework
19:47:31 DEBUG Slf4JLogger -Dio.netty.leakDetection.level: simple
19:47:31 DEBUG Slf4JLogger -Dio.netty.leakDetection.targetRecords: 4
19:47:31 DEBUG Slf4JLogger -Dio.netty.eventLoopThreads: 4
19:47:31 DEBUG Slf4JLogger -Dio.netty.noUnsafe: false
19:47:31 DEBUG Slf4JLogger Platform: Android
19:47:31 DEBUG Slf4JLogger Java version: 6
19:47:31 DEBUG Slf4JLogger Platform: Android
19:47:31 DEBUG Slf4JLogger sun.misc.Unsafe.theUnsafe: available
19:47:31 DEBUG Slf4JLogger sun.misc.Unsafe.copyMemory: available
19:47:31 DEBUG Slf4JLogger java.nio.Buffer.address: available
19:47:31 DEBUG Slf4JLogger direct buffer constructor: available
19:47:31 DEBUG Slf4JLogger java.nio.Bits.unaligned: available, true
19:47:31 DEBUG Slf4JLogger jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
19:47:31 DEBUG Slf4JLogger java.nio.DirectByteBuffer.(long, int): available
19:47:31 DEBUG Slf4JLogger sun.misc.Unsafe: unavailable (Android)
19:47:31 DEBUG Slf4JLogger -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
19:47:31 DEBUG Slf4JLogger -Dio.netty.bitMode: 64 (sun.arch.data.model)
19:47:31 DEBUG Slf4JLogger -Dio.netty.noPreferDirect: true
19:47:31 DEBUG Slf4JLogger -Dio.netty.maxDirectMemory: -1 bytes
19:47:31 DEBUG Slf4JLogger -Dio.netty.uninitializedArrayAllocationThreshold: -1
19:47:31 DEBUG Slf4JLogger -Dio.netty.noKeySetOptimization: false
19:47:31 DEBUG Slf4JLogger -Dio.netty.selectorAutoRebuildThreshold: 512
19:47:31 DEBUG Slf4JLogger org.jctools-core.MpscChunkedArrayQueue: unavailable
19:47:31 DEBUG Slf4JLogger Default DNS servers: [/10.143.22.116:53, /10.143.22.118:53] (sun.net.dns.ResolverConfiguration)
19:47:31 DEBUG Slf4JLogger -Djava.net.preferIPv4Stack: false
19:47:31 DEBUG Slf4JLogger -Djava.net.preferIPv6Addresses: false
19:47:31 DEBUG Slf4JLogger Loopback interface: lo (lo, 127.0.0.1)
19:47:31 DEBUG Slf4JLogger /proc/sys/net/core/somaxconn: 128
19:47:32 INFO Messages Loading messages from /infra-messages/APIMessages_en.properties …
19:47:32 INFO Messages Loading messages from /infra-messages/APIMessages_de.properties …
19:47:32 INFO RestVerticle git: https://github.com/folio-org/raml-module-builder.git f26727be3ff1a97f60db64939bb0ece02fad1951
no rules directory found, continuing…
19:47:33 WARN AbstractKieModule No files found for KieBase defaultKieBase
19:47:33 INFO KieRepositoryImpl KieModule was added: MemoryKieModule[releaseId=org.default:artifact:1.0.0-SNAPSHOT]
19:47:33 DEBUG KnowledgeBaseImpl Starting Engine in PHREAK mode
19:47:33 INFO LogUtil org.folio.rest.RestVerticle start metrics enabled: true
19:47:34 INFO AnnotationGrabber$1 Mapping functions in org.folio.rest.jaxrs.resource.BlUsersResource class to appropriate urls
19:47:34 INFO AnnotationGrabber$1 Mapping functions in org.folio.rest.jaxrs.resource.AdminResource class to appropriate urls
19:47:34 INFO AnnotationGrabber$1 Mapping functions in org.folio.rest.jaxrs.resource.TenantResource class to appropriate urls
19:47:34 INFO AnnotationGrabber$1 Mapping functions in org.folio.rest.jaxrs.resource.RmbtestsResource class to appropriate urls
19:47:34 INFO AnnotationGrabber$1 Mapping functions in org.folio.rest.jaxrs.resource.JobsResource class to appropriate urls
19:47:34 INFO AnnotationGrabber$1 Mapping functions in org.folio.rest.jaxrs.resource.ConfigurationsResource class to appropriate urls
19:47:34 INFO RestVerticle ^/bl-users
19:47:34 INFO RestVerticle ^/admin
19:47:34 INFO RestVerticle ^/_/tenant
19:47:34 INFO RestVerticle ^/rmbtests
19:47:34 INFO RestVerticle ^/jobs
19:47:34 INFO RestVerticle ^/configurations
19:47:34 INFO RestVerticle 1 verticles deployed
19:47:35 INFO RestVerticle init succeeded…
19:47:35 INFO LogUtil org.folio.rest.RestVerticle runPeriodicHook no periodic implementation found, continuing with deployment
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.numHeapArenas: 4
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.numDirectArenas: 4
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.pageSize: 8192
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.maxOrder: 11
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.chunkSize: 16777216
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.tinyCacheSize: 512
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.smallCacheSize: 256
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.normalCacheSize: 64
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.maxCachedBufferCapacity: 32768
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.cacheTrimInterval: 8192
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.useCacheForAllThreads: true
19:47:36 DEBUG Slf4JLogger -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
19:47:36 DEBUG Slf4JLogger -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
19:47:36 DEBUG Slf4JLogger -Dio.netty.processId: 1112 (auto-detected)
19:47:36 DEBUG Slf4JLogger -Dio.netty.machineId: 00:16:3e:ff:fe:0c:d1:93 (auto-detected)
19:47:36 DEBUG Slf4JLogger -Dio.netty.initialSeedUniquifier: 0xe80eb0d2e55cd766
19:47:36 DEBUG Slf4JLogger -Dio.netty.allocator.type: unpooled
19:47:36 DEBUG Slf4JLogger -Dio.netty.threadLocalDirectBufferSize: 65536
19:47:36 DEBUG Slf4JLogger -Dio.netty.maxThreadLocalCharBufferSize: 16384
19:47:36 INFO LogUtil org.folio.rest.RestVerticle runPostDeployHook no Post Deploy Hook implementation found, continuing with deployment
19:47:36 INFO LogUtil org.folio.rest.RestVerticle start http server for apis and docs started on port 8081.
19:47:36 INFO LogUtil org.folio.rest.RestVerticle start Documentation available at: http://localhost:8081/apidocs/
19:47:36 INFO ertxIsolatedDeployer Succeeded in deploying verticle
19:49:05 INFO LogUtil org.folio.rest.RestVerticle runShutdownHook no shutdown hook implementation found, continuing with shutdown
19:49:05 WARN DeploymentManager Deploying mod-users-bl-4.0.3-SNAPSHOT failed
19:49:05 INFO ProxyContext 785995/discovery;806274/deployment RES 400 94409820us okapi Deployment failed. Could not connect to port 9140: Connection refused: localhost/127.0.0.1:9140
19:49:05 ERROR HttpResponse HTTP response code=400 msg=Deployment failed. Could not connect to port 9140: Connection refused: localhost/127.0.0.1:9140
19:49:05 INFO ProxyContext 785995/discovery RES 400 94431415us okapi Deployment failed. Could not connect to port 9140: Connection refused: localhost/127.0.0.1:9140
19:49:05 ERROR HttpResponse HTTP response code=400 msg=Deployment failed. Could not connect to port 9140: Connection refused: localhost/127.0.0.1:9140


The process of mod-users-bl was found before the log show “Could not connect to port 9140: Connection refused: localhost/127.0.0.1:9140”, and crushed after it without any log created by mod-users-bl process.

What’s wrong during this process?

peter
17 Oct '18

Hello @bzhou

There are not many developers on Discuss.FOLIO.org. Most of them use the Slack team for communication. You can sign up for a Slack account, then use its #support channel to post questions.