无法打开扩展控制文件"/usr/share/pgsql/extension/uuid-ossp.control":没有此类文件或目录



我们有一个使用Postgres 9.6的web应用程序内置框架。它运行良好。然而,我们正在尝试安装Postgres13,所以我们的应用程序使用Postgres13而不是Postgres9.6。这是运行Linux的AmazonLinux2(EC2(机器。

cat /proc/version
Linux version 4.14.252-195.483.amzn2.x86_64 (mockbuild@ip-1-0-1-1) (gcc version 7.3.1 20180712 (Red Hat 7.3.1-13) (GCC))

我已经安装了Postgres13通过亚马逊linux附加:

postgresql.x86_64                  13.3-2.amzn2.0.1                  @amzn2extra-postgresql13

这台机器已经有Postgres 9.6了。

机器上安装的其他一些软件包包括:

# yum list installed | grep -i postgre
libpq.x86_64                       13.3-1.amzn2                      @amzn2extra-postgresql13
libpq-devel.x86_64                 13.3-1.amzn2                      @amzn2extra-postgresql13
postgresql.x86_64                  13.3-2.amzn2.0.1                  @amzn2extra-postgresql13
postgresql-contrib.x86_64          13.3-2.amzn2.0.1                  @amzn2extra-postgresql13
postgresql-server.x86_64           13.3-2.amzn2.0.1                  @amzn2extra-postgresql13
postgresql-server-devel.x86_64     13.3-2.amzn2.0.1                  @amzn2extra-postgresql13
postgresql96.x86_64                9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-devel.x86_64          9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-libs.x86_64           9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-server.x86_64         9.6.24-1PGDG.rhel6                @pgdg96

注意:我删除了postgresql96-contrib.x86_64来修复错误,但这没有帮助!

在启动web应用程序时,出现以下错误:

[ERROR] - from play.api.db.evolutions.DefaultEvolutionsApi in main - ERROR: could not open extension control file "/usr/share/pgsql/extension/uuid-ossp.control": No such file or directory [ERROR:0, SQLSTATE:58P01]

文件确实存在:

# ll /usr/share/pgsql/extension/uuid-ossp.control
-rw-r--r-- 1 root root 178 Jun 21  2021 /usr/share/pgsql/extension/uuid-ossp.control
# ll /usr/lib64/pgsql/uuid-ossp.so
-rwxr-xr-x 1 root root 11272 Jun 21  2021 /usr/lib64/pgsql/uuid-ossp.so
bash-4.2$ psql
psql (13.3)
Type "help" for help.
postgres=# CREATE EXTENSION "uuid-ossp";
CREATE EXTENSION
postgres=# select uuid_generate_v1();
uuid_generate_v1
--------------------------------------
49634f70-6329-11ec-87cf-020c60b9374c
(1 row)
# pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/pgsql
INCLUDEDIR-SERVER = /usr/include/pgsql/server
LIBDIR = /usr/lib64
PKGLIBDIR = /usr/lib64/pgsql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/pgsql
SYSCONFDIR = /etc
PGXS = /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--build=x86_64-koji-linux-gnu' '--host=x86_64-koji-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-rpath' '--with-ldap' '--with-openssl' '--with-gssapi' '--enable-nls' '--without-readline' '--datadir=/usr/share/pgsql' 'build_alias=x86_64-koji-linux-gnu' 'host_alias=x86_64-koji-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches    -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro ' 'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches    -m64-mtune=generic' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches    -m64 -mtune=generic
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-z,relro -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lpthread -lssl -lcrypto -lgssapi_krb5 -lz -lrt -ldl -lm
VERSION = PostgreSQL 13.3

我已经尝试在/etc/ld.so.conf.d中添加/usr/lib64/pgsql并运行ldconfig,但这没有帮助。我在重启Postgres 13后尝试过。

我完全没有主意了。我错过了什么?

我尝试通过PGDG repo进行安装,但遇到了同样的错误。然而,删除play_evolutions表最终解决了这个错误。我看到这个表有错误和相应的plv8创建查询。我不能100%确定为什么删除此表可以解决错误。但我认为play框架使用这个表从缓存中挑选了一些东西,因此错误不断重复。我还认为这个错误更多地与play框架有关,而不是Postgres。

相关内容

最新更新