Details
-
Bug
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
None
-
-
eHoldings Sprint 124
-
2
-
Spitfire
Description
Precondition: mod-source-record-manager module already enabled for any tenant.
There is such message in a mod-source-record-manager log while enabling the module for one more tenant.
05:56:35.557 [vert.x-eventloop-thread-1] INFO PostgresClient [9371531eqId] trying to execute: {} DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'rule_type') THEN create type rule_type AS ENUM ('MARC_BIB', 'MARC_HOLDING'); END IF; END $$; ALTER TABLE mapping_rules ADD COLUMN IF NOT EXISTS record_type rule_type NOT NULL DEFAULT 'MARC_BIB'; 05:56:35.559 [vert.x-eventloop-thread-1] ERROR PostgresClient [9371533eqId] { "message": "type \"rule_type\" does not exist", "severity": "ERROR", "code": "42704", "position": "234", "file": "parse_type.c", "line": "271", "routine": "typenameType" } io.vertx.pgclient.PgException: { "message": "type \"rule_type\" does not exist", "severity": "ERROR", "code": "42704", "position": "234", "file": "parse_type.c", "line": "271", "routine": "typenameType" } at io.vertx.pgclient.impl.codec.ErrorResponse.toException(ErrorResponse.java:31) ~[mod-source-record-manager-server-fat.jar:?] at io.vertx.pgclient.impl.codec.QueryCommandBaseCodec.handleErrorResponse(QueryCommandBaseCodec.java:57) ~[mod-source-record-manager-server-fat.jar:?] at io.vertx.pgclient.impl.codec.PgDecoder.decodeError(PgDecoder.java:246) ~[mod-source-record-manager-server-fat.jar:?] at io.vertx.pgclient.impl.codec.PgDecoder.decodeMessage(PgDecoder.java:131) [mod-source-record-manager-server-fat.jar:?] at io.vertx.pgclient.impl.codec.PgDecoder.channelRead(PgDecoder.java:111) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [mod-source-record-manager-server-fat.jar:?] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [mod-source-record-manager-server-fat.jar:?] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [mod-source-record-manager-server-fat.jar:?] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [mod-source-record-manager-server-fat.jar:?] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [mod-source-record-manager-server-fat.jar:?] at java.lang.Thread.run(Thread.java:829) [?:?]
It is necessary to change condition to take into account that several tenant DB schemas could have "rule_type" enum.
Solution example for the same issue: https://github.com/folio-org/mod-source-record-storage/pull/377