Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres:9 database doesn't work on restart #4229

Closed
1 task done
njt1982 opened this issue Sep 27, 2022 · 2 comments
Closed
1 task done

postgres:9 database doesn't work on restart #4229

njt1982 opened this issue Sep 27, 2022 · 2 comments

Comments

@njt1982
Copy link

njt1982 commented Sep 27, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Run a Diagnostic and Paste Link Here

DDEV version:  ITEM             VALUE
 DDEV version     vHEAD-cc46a7d
 architecture     amd64
 db               drud/ddev-dbserver-mariadb-10.4:v1.20.0
 dba              phpmyadmin:5
 ddev-ssh-agent   drud/ddev-ssh-agent:v1.20.0
 docker           20.10.11
 docker-compose   v2.10.2
 docker-platform  colima
 mutagen          0.16.0-beta1
 os               darwin
 router           drud/ddev-router:v1.20.0
 web              drud/ddev-webserver:20220921_php_8.2

docker version:
Client: Docker Engine - Community
 Version:           20.10.15
 API version:       1.41
 Go version:        go1.18.1
 Git commit:        fd82621d35
 Built:             Thu Apr 21 14:44:35 2022
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       847da184ad5048b27f5bdf9d53d070f731b43180
  Built:            Wed Apr 13 23:41:08 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.5.8
  GitCommit:        1e5ef943eb76627a6d3b6de8cd1ef6537f393a71
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:

Expected Behavior

Should be able to start a project with postgres:9 and restart it.

Actual Behavior

When restarting (or starting again if it failed to start), get the following error:

Failed to restart XXXX: Unable to start project XXXX because the configured database type does not match the current actual database. Please change your database type back to mariadb:9.6 and start again, export, delete, and then change configuration and start. To get back to existing type use 'ddev config --database=mariadb:9.6' and then you might want to try 'ddev debug migrate-database postgres:9', see docs at https://ddev.readthedocs.io/en/latest/users/extend/database_types/

Steps To Reproduce

  1. Was reproduced by @rfay in a clean environment
  2. Start a project with postgres:9
  3. restart it

Anything else?

This does not happen with postgres >=10. It seems to be specific to 9.

Also tried ddev delete before starting too; this helped it start the first time as the environment was "clean".

@rfay
Copy link
Member

rfay commented Sep 27, 2022

The problem is weak code in https://github.com/drud/ddev/blob/0864cebe7aa37b0c562a243237ffa80781fa9910/pkg/ddevapp/db.go#L12-L28

You interested in taking a stab at it? :)

@rfay
Copy link
Member

rfay commented Sep 30, 2022

@rfay rfay closed this as completed in c6effb7 Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants