gpt4 book ai didi

postgresql - Drupal 与 Docker 中的 Postgres : throws exception after install

转载 作者:行者123 更新时间:2023-11-29 13:07:40 24 4
gpt4 key购买 nike

这是我的docker-compose.yml:

version: '3.1'

services:
mydrupal:
image: drupal:8-apache
ports:
- '8080:80'
mydb:
image: postgres:12
environment:
POSTGRES_PASSWORD: password

在 docker-compose up 并完成 drupal 上的安装过程(在 localhost:8080 上)后,它会抛出异常:

Original
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42703]: Undefined column: 7 ERROR: column pg_attrdef.adsrc does not exist LINE 8: OR pg_attrdef.adsrc::text LIKE 'nextval%') ^: SELECT pg_attribute.attname AS column_name, format_type(pg_attribute.atttypid, pg_attribute.atttypmod) AS data_type, pg_get_expr(pg_attrdef.adbin, pg_attribute.attrelid) AS column_default FROM pg_attribute LEFT JOIN pg_attrdef ON pg_attrdef.adrelid = pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum WHERE pg_attribute.attnum > 0 AND NOT pg_attribute.attisdropped AND pg_attribute.attrelid = :key::regclass AND (format_type(pg_attribute.atttypid, pg_attribute.atttypmod) = 'bytea' OR pg_attrdef.adsrc LIKE 'nextval%'); Array ( [:key] => public.cache_bootstrap ) in Drupal\Core\Extension\ModuleHandler->getHookInfo() (line 297 of /var/www/html/core/lib/Drupal/Core/Extension/ModuleHandler.php).

Drupal\Core\Extension\ModuleHandler->getHookInfo() (Line: 625)
Drupal\Core\Extension\ModuleHandler->buildImplementationInfo('entity_type_build') (Line: 590)
Drupal\Core\Extension\ModuleHandler->getImplementationInfo('entity_type_build') (Line: 328)
Drupal\Core\Extension\ModuleHandler->getImplementations('entity_type_build') (Line: 127)
Drupal\Core\Entity\EntityTypeManager->findDefinitions() (Line: 175)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 132)
Drupal\Core\Config\ConfigManager->getEntityTypeIdByName('core.extension') (Line: 317)
Drupal\Core\Config\ConfigInstaller->createConfiguration('', Array) (Line: 132)
Drupal\Core\Config\ConfigInstaller->installDefaultConfig('core', 'core') (Line: 75)
Drupal\Core\ProxyClass\Config\ConfigInstaller->installDefaultConfig('core', 'core') (Line: 645)
drupal_install_system(Array) (Line: 1100)
install_base_system(Array) (Line: 702)
install_run_task(Array, Array) (Line: 577)
install_run_tasks(Array, NULL) (Line: 118)
install_drupal(Object) (Line: 44)
Additional
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42703]: Undefined column: 7 ERROR: column pg_attrdef.adsrc does not exist LINE 8: OR pg_attrdef.adsrc::text LIKE 'nextval%') ^: SELECT pg_attribute.attname AS column_name, format_type(pg_attribute.atttypid, pg_attribute.atttypmod) AS data_type, pg_get_expr(pg_attrdef.adbin, pg_attribute.attrelid) AS column_default FROM pg_attribute LEFT JOIN pg_attrdef ON pg_attrdef.adrelid = pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum WHERE pg_attribute.attnum > 0 AND NOT pg_attribute.attisdropped AND pg_attribute.attrelid = :key::regclass AND (format_type(pg_attribute.atttypid, pg_attribute.atttypmod) = 'bytea' OR pg_attrdef.adsrc LIKE 'nextval%'); Array ( [:key] => public.cache_config ) in Drupal\Core\Config\CachedStorage->readMultiple() (line 105 of /var/www/html/core/lib/Drupal/Core/Config/CachedStorage.php).

Drupal\Core\Config\CachedStorage->readMultiple(Array) (Line: 165)
Drupal\Core\Config\ConfigFactory->doLoadMultiple(Array, 1) (Line: 104)
Drupal\Core\Config\ConfigFactory->doGet('core.extension') (Line: 89)
Drupal\Core\Config\ConfigFactory->get('core.extension') (Line: 103)
Drupal\Core\Extension\ThemeHandler->listInfo() (Line: 63)
_drupal_maintenance_theme() (Line: 745)
drupal_maintenance_theme() (Line: 1028)
install_display_output(Array, Array, Array) (Line: 260)
_drupal_log_error(Array, 1) (Line: 605)
_drupal_exception_handler(Object)

有什么建议吗? docker-compose.yml 看起来与 drupal documentation 完全一样.

最佳答案

看起来drupal:8-apache不支持这个postgres:12

我尝试过:

image: postgres:10

并且不再发生异常。

关于postgresql - Drupal 与 Docker 中的 Postgres : throws exception after install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59059589/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com