-
Notifications
You must be signed in to change notification settings - Fork 769
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When specifying v18+ of PostgreSQL using the official postgres container, it will fail to start due to a change in the data path being used.
Example Failure
.WithDataVolume() uses the /var/lib/postgresql/data path.
builder
.AddPostgres("pg")
// Forcing v18.1
.WithImage("postgres:18.1")
// Adding a data volume to persist data between runs
.WithDataVolume()
;Workaround
Specify the updated path according to the postgres:18 Dockerfile: /var/lib/postgresql.
builder
.AddPostgres("pg")
// Forcing v18.1
.WithImage("postgres:18.1")
// Adding a data volume to persist data between runs
.WithVolume("pg-data", "/var/lib/postgresql")
;Expected Behavior
Container loads without issue and persists data to new location.
Steps To Reproduce
builder
.AddPostgres("pg")
// Forcing v18.1
.WithImage("postgres:18.1")
// Adding a data volume to persist data between runs
.WithDataVolume()
;The container will fail to start with the follow error in the container logs:
[sys] Added new ContainerNetworkConnection: ContainerName = pg-bqvpmpze
[sys] Failed to start Container: ContainerName = pg-bqvpmpze, ContainerId = 4513c0ee2b25:
[sys] container 'pg-bqvpmpze' start failed (exit code 1)
[sys] writer is closed
[sys] not all requested objects were returned
[sys] only 0 out of 1 containers were successfully started
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names). This better reflects how
PostgreSQL itself works, and how upgrades are to be performed.
See also https://github.com/docker-library/postgres/pull/1259
Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)
This is usually the result of upgrading the Docker image without
upgrading the underlying database using "pg_upgrade" (which requires both
versions).
The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql which will then place PostgreSQL data in a
subdirectory, allowing usage of "pg_upgrade --link" without mount point
boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
Exceptions (if any)
No response
.NET Version info
.NET SDK:
Version: 10.0.101
Commit: fad253f51b
Workload version: 10.0.101.1
MSBuild version: 18.0.6+fad253f51
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.101\
.NET workloads installed:
[android]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 36.1.2/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.android\36.1.2\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 26.2.10191/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.2.10191\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 26.2.10191/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maccatalyst\26.2.10191\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 10.0.1/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.1\WorkloadManifest.json
Install Type: Msi
[wasm-tools]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 10.0.101/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.101\WorkloadManifest.json
Install Type: Msi
[wasm-tools-net8]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 10.0.101/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.net8\10.0.101\WorkloadManifest.json
Install Type: Msi
[wasm-tools-net9]
Installation Source: SDK 10.0.100, VS 18.3.11312.210
Manifest Version: 10.0.101/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.net9\10.0.101\WorkloadManifest.json
Install Type: Msi
Configured to use workload sets when installing new manifests.
Host:
Version: 10.0.1
Architecture: x64
Commit: fad253f51b
.NET SDKs installed:
8.0.416 [C:\Program Files\dotnet\sdk]
9.0.308 [C:\Program Files\dotnet\sdk]
10.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
DOTNET_CLI_TELEMETRY_OPTOUT [1]
DOTNET_NOLOGO [1]
global.json file:
{obfuscated}\global.json
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Anything else?
No response
Metadata
Metadata
Assignees
Labels
No labels